diff mbox

mmc: dw_mmc: Reset DMA before enabling IDMAC

Message ID CAD=FV=VQe-9c+QOYEmsuHwY+9qF1tkTgiakdSUWhUoWw6zuHSA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Doug Anderson Oct. 10, 2014, 12:36 a.m. UTC
Alim,

On Thu, Oct 9, 2014 at 3:19 PM, Alim Akhtar <alim.akhtar@gmail.com> wrote:
> Thats fine, I think every vendor (most of them) has a custom
> implementation of dw_mmc, but they do have VERID register to check the
> dw_mmc version.
> The reason why I asked is, I have seen inconsistency in card
> enumeration on few controller version, and this patch alone does not
> help, and adding a call to dw_mci_idmac_reset() after DMA reset is
> needed. And this is what is recommended in the synopsys's data book
> also.
> Do you see any issue/side effect after adding dw_mci_idmac_reset()?

A quick test shows no problem with adding this to Sonny's patch:

        temp = mci_readl(host, CTRL);

I'll start reboot tests now to see how it behaves...  I think Sonny is
out of the office for a few days so we might need to wait for a spin,
but I'll run with that change in the meantime and see how it behaves
for me.

Thanks!

-Doug

Comments

Doug Anderson Oct. 14, 2014, 4:51 p.m. UTC | #1
Hi,

On Thu, Oct 9, 2014 at 5:36 PM, Doug Anderson <dianders@chromium.org> wrote:
> Alim,
>
> On Thu, Oct 9, 2014 at 3:19 PM, Alim Akhtar <alim.akhtar@gmail.com> wrote:
>> Thats fine, I think every vendor (most of them) has a custom
>> implementation of dw_mmc, but they do have VERID register to check the
>> dw_mmc version.
>> The reason why I asked is, I have seen inconsistency in card
>> enumeration on few controller version, and this patch alone does not
>> help, and adding a call to dw_mci_idmac_reset() after DMA reset is
>> needed. And this is what is recommended in the synopsys's data book
>> also.
>> Do you see any issue/side effect after adding dw_mci_idmac_reset()?
>
> A quick test shows no problem with adding this to Sonny's patch:
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 66dc8fe..588b5b8 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -481,6 +481,7 @@ static void dw_mci_idmac_start_dma(struct dw_mci
> *host, unsigned int sg_len)
>
>         /* Make sure to reset DMA in case we did PIO before this */
>         dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET);
> +       dw_mci_idmac_reset(host);
>
>         /* Select IDMAC interface */
>         temp = mci_readl(host, CTRL);
>
> I'll start reboot tests now to see how it behaves...  I think Sonny is
> out of the office for a few days so we might need to wait for a spin,
> but I'll run with that change in the meantime and see how it behaves
> for me.
>
> Thanks!

Just FYI that I've been running with Alim's proposed change for
several days and it seems solid.  I think Sonny may be able to spin
his patch this week.  :)

-Doug
Alim Akhtar Oct. 14, 2014, 7:58 p.m. UTC | #2
Hi Doug,

On Tue, Oct 14, 2014 at 10:21 PM, Doug Anderson <dianders@chromium.org> wrote:
> Hi,
>
> On Thu, Oct 9, 2014 at 5:36 PM, Doug Anderson <dianders@chromium.org> wrote:
>> Alim,
>>
>> On Thu, Oct 9, 2014 at 3:19 PM, Alim Akhtar <alim.akhtar@gmail.com> wrote:
>>> Thats fine, I think every vendor (most of them) has a custom
>>> implementation of dw_mmc, but they do have VERID register to check the
>>> dw_mmc version.
>>> The reason why I asked is, I have seen inconsistency in card
>>> enumeration on few controller version, and this patch alone does not
>>> help, and adding a call to dw_mci_idmac_reset() after DMA reset is
>>> needed. And this is what is recommended in the synopsys's data book
>>> also.
>>> Do you see any issue/side effect after adding dw_mci_idmac_reset()?
>>
>> A quick test shows no problem with adding this to Sonny's patch:
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 66dc8fe..588b5b8 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -481,6 +481,7 @@ static void dw_mci_idmac_start_dma(struct dw_mci
>> *host, unsigned int sg_len)
>>
>>         /* Make sure to reset DMA in case we did PIO before this */
>>         dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET);
>> +       dw_mci_idmac_reset(host);
>>
>>         /* Select IDMAC interface */
>>         temp = mci_readl(host, CTRL);
>>
>> I'll start reboot tests now to see how it behaves...  I think Sonny is
>> out of the office for a few days so we might need to wait for a spin,
>> but I'll run with that change in the meantime and see how it behaves
>> for me.
>>
>> Thanks!
>
> Just FYI that I've been running with Alim's proposed change for
> several days and it seems solid.  I think Sonny may be able to spin
> his patch this week.  :)
>
Sounds great. Thanks for testing.
> -Doug
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 66dc8fe..588b5b8 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -481,6 +481,7 @@  static void dw_mci_idmac_start_dma(struct dw_mci
*host, unsigned int sg_len)

        /* Make sure to reset DMA in case we did PIO before this */
        dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET);
+       dw_mci_idmac_reset(host);

        /* Select IDMAC interface */