All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: fsl_esdhc: Fix waiting for DMA operation completion
Date: Tue, 02 Apr 2013 20:10:47 +0200	[thread overview]
Message-ID: <515B1F27.4010702@gmail.com> (raw)
In-Reply-To: <515AFE1E.801@boundarydevices.com>

Am 02.04.2013 17:49, schrieb Eric Nelson:
> Thanks Andrew,
>
> On 04/02/2013 03:04 AM, Andrew Gabbasov wrote:
>> On iMX6 sometimes the Transfer Complete interrupt occurs earlier
>> than the DMA part completes its operation. If immediately after that
>> the read data is used for some data verification, those obtained data
>> may be incomplete, which causes intermittent verification failures.
>>
>
> Can you describe how to repeat this?
>
>> For example, when the default environment command tries to load and run
>> boot script from FAT partition on SD/MMC card, it sometimes fails,
>> reporting invalid partition table, or unknown partition type, or
>> something else of that kind. Such errors disappear if the build
>> configuration has CONFIG_SYS_FSL_ESDHC_USE_PIO, or if some delay
>> is added after transfer completion.
>>
> We do this on every boot on SABRE Lite and Nitrogen6x boards,
> and haven't seen an issue.
>
> What board are you testing on?
>
> Do you have cache enabled?
>
> Is this with an SD card or eMMC?

Andrew will have the details, but to my understanding this implements 
in U-Boot what the Freescale kernel has in

http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/tree/drivers/mmc/host/sdhci-esdhc-imx.c?h=imx_3.0.35_12.09.01#n234

for TO 1.0.

Best regards

Dirk

>> Adding extra waiting for DMA completion after Transfer Complete
>> event fixes this issue.
>>
>> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
>> ---
>>   drivers/mmc/fsl_esdhc.c |    6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>> index d2a505e..806c6dd 100644
>> --- a/drivers/mmc/fsl_esdhc.c
>> +++ b/drivers/mmc/fsl_esdhc.c
>> @@ -402,6 +402,12 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd
>> *cmd, struct mmc_data *data)
>>                   return COMM_ERR;
>>           } while (!(irqstat & IRQSTAT_TC) &&
>>                   (esdhc_read32(&regs->prsstat) & PRSSTAT_DLA));
>> +#ifdef CONFIG_MX6
>> +        /* In imx6 TC (data end) interrupt sometimes occur earlier
>> +           than DMA completes. In this case just wait a little
>> more. */
>> +        while (!(irqstat & (IRQSTAT_DINT | IRQSTAT_DMAE)))
>> +            irqstat = esdhc_read32(&regs->irqstat);
>> +#endif
>>   #endif
>>       }
>>
>>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

  reply	other threads:[~2013-04-02 18:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-02 10:04 [U-Boot] [PATCH] mx6: fsl_esdhc: Fix waiting for DMA operation completion Andrew Gabbasov
2013-04-02 15:49 ` Eric Nelson
2013-04-02 18:10   ` Dirk Behme [this message]
2013-04-02 21:50     ` Eric Nelson
2013-04-03  7:33       ` Gabbasov, Andrew
2013-04-02 18:21   ` Gabbasov, Andrew
2013-04-02 21:38     ` Eric Nelson
2013-04-03  6:48       ` Gabbasov, Andrew
2013-04-03 13:38         ` Eric Nelson
2013-04-03 17:30           ` Gabbasov, Andrew
2013-04-03 23:17             ` Eric Nelson
2013-04-03 23:47               ` Eric Nelson
2013-04-04 18:03                 ` Gabbasov, Andrew
2013-04-04 18:41                   ` Eric Nelson
2013-04-05 20:18                     ` Fleming Andy-AFLEMING
2013-04-06 21:31                       ` Eric Nelson
2013-04-08  9:13                       ` Gabbasov, Andrew
2013-04-04 18:12               ` Fabio Estevam
2013-04-04 18:14                 ` Fleming Andy-AFLEMING

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515B1F27.4010702@gmail.com \
    --to=dirk.behme@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.