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: Sat, 06 Apr 2013 14:31:17 -0700 [thread overview]
Message-ID: <51609425.3080702@boundarydevices.com> (raw)
In-Reply-To: <CC6546B78A5F204290BB35835D3E85813A9815@039-SN2MPN1-011.039d.mgd.msft.net>
Thanks for the review Andy.
On 04/05/2013 01:18 PM, Fleming Andy-AFLEMING wrote:
>
> On Apr 4, 2013, at 1:41 PM, Eric Nelson wrote:
>
>> Hi Andrew,
>>
>> On 04/04/2013 11:03 AM, Gabbasov, Andrew wrote:
>>> Hi Eric,
>>>
>>>> From: Eric Nelson [eric.nelson at boundarydevices.com] Sent:
>>>> Thursday, April 04, 2013 03:47 To: Gabbasov, Andrew Cc:
>>>> u-boot at lists.denx.de; Behme, Dirk - Bosch; Fabio Estevam
>>>> Subject: Re: [U-Boot] [PATCH] mx6: fsl_esdhc: Fix waiting for
>>>> DMA operation completion
>>>>
>>>
>>> So, do you think the latter (modified) loop condition
>>>
>>> } while (!(irqstat & IRQSTAT_TC) || !(irqstat & IRQSTAT_DINT) ||
>>> (esdhc_read32(®s->prsstat) & PRSSTAT_DLA));
>>>
>>> will be correct?
>>>
>>
>> I think the right thing to do is eliminate the DLA test entirely,
>> so the loop condition can be simplified to something like this:
>>
>> #define TRANSFER_COMPLETE (IRQSTAT_TC|IRQSTAT_DINT)
>>
>> do { ... } while (TRANSFER_COMPLETE !=
>> (irqstat&TRANSFER_COMPLETE));
>
> That looks right to me. I have been known to mistakenly write loops
> that are supposed to wait for two conditions to only wait for one of
> those. Apparently I need remedial boolean logic lessons.
>
>
>>
>> If there is another part that needs to bail out on PRSSTAT_DLA, it
>> seems that the affected part should be the one with the #ifdef
>
> I don't think we need a special case. Just correct logic. :/
>
Cool. It's always hard to tell when IP like this is used for
multiple processors.
So many data sheets, so little time...
Regards,
Eric
next prev parent reply other threads:[~2013-04-06 21:31 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
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 [this message]
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=51609425.3080702@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