public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mx6: fsl_esdhc: Fix waiting for DMA operation completion
Date: Wed, 03 Apr 2013 06:38:12 -0700	[thread overview]
Message-ID: <515C30C4.1030802@boundarydevices.com> (raw)
In-Reply-To: <6C5EA58090A5ED459815C4D04C2B466FD931DFA2@EU-MBX-03.mgc.mentorg.com>

Hi Andrew,

On 04/02/2013 11:48 PM, Gabbasov, Andrew wrote:

>>>> 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.
>>>>>
 >>>
>>
>>  <snip>
>>
>> Looking at the code with fresh eyes, it appears that
>> the cache invalidate is in the wrong place (after
>> "command complete" but before "transfer complete"
>> is checked).
>>
>>  <snip>
>>
>> Andrew, can you test with this patch to see if
>> it also addresses the issue?
>>
> Hi Eric,
>
> Yes, this patch seems to fix the issue too.
>

Thanks for testing.

> I think, it would be useful to have both patches. Although invalidating cache
> (by adding some delay) indirectly helps with waiting for DMA End event,
> it is probably worth having explicit DMA completion waiting patch too.
>
I agree wholeheartedly.

I do wonder if the previous loop should be re-worked though.
It seems that we should be waiting for TC & (DINT|DMAE) on
all processor variants and the previous loop has tests for
timeout and data errors.

Regards,


Eric

  reply	other threads:[~2013-04-03 13:38 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
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 [this message]
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=515C30C4.1030802@boundarydevices.com \
    --to=eric.nelson@boundarydevices.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox