From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmci: calculate remaining bytes at error correctly
Date: Mon, 31 Jan 2011 14:00:09 +0000 [thread overview]
Message-ID: <20110131140009.GA13918@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTimTbn-rQik+PvC-GyLd3HBAuGi3f8kR-T2GcvK8@mail.gmail.com>
On Mon, Jan 31, 2011 at 02:53:32PM +0100, Linus Walleij wrote:
> On Mon, Jan 31, 2011 at 11:40 AM, Russell King - ARM Linux <
> linux at arm.linux.org.uk> wrote:
>
> What can happen is you receive the DATAEND interrupt,
> > which tears down the data side of the request, and starts the stop
> > command. Meanwhile there's still data left in the FIFO for the CPU
> > to read.
> >
> > I suspect there's a similar race between DMA and the host CPU too as
> > you leave the DATAEND interrupt on. I suspect for reliability, we
> > need to have the DMA controller callback function in place to enable
> > the DATAEND interrupt. Or something like that.
> >
>
> Yes I get it now, well, what we do is essentially create three state
> variables that are all checked at end of DMA (by adding a
> DMA termination callback), end of PIO or DATAEND IRQ arrival.
There's no need, and you don't want to do it like that. If you receive
and ack the data end interrupt before you've completed the transfer,
then you need additional complexity in the PIO data handler.
Keep it simple. Keep DATAEND masked until you've finished transfering
the data and then enable it - you'll get the interrupt at the right point
that way.
> I'll cook up some patch ASAP, just need to backport some
> stuff on top of your latest MMCI patches.
I have a number of patches on top of just these two. There's eight
in total. See the mmci-dma branch. I want to discard the top patch
as I still don't think the mmci imposes that requirement.
PS, don't send me html encoded mail...
next prev parent reply other threads:[~2011-01-31 14:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-27 14:14 [PATCH] mmci: calculate remaining bytes at error correctly Linus Walleij
2011-01-27 16:36 ` Russell King - ARM Linux
2011-01-27 16:43 ` Linus Walleij
2011-01-27 16:47 ` Russell King - ARM Linux
2011-01-30 21:28 ` Russell King - ARM Linux
2011-01-30 21:29 ` Russell King - ARM Linux
2011-01-31 10:24 ` Linus Walleij
2011-02-03 0:30 ` Russell King - ARM Linux
2011-02-03 14:00 ` Russell King - ARM Linux
2011-02-04 13:24 ` Linus Walleij
2011-01-31 10:17 ` Linus Walleij
2011-01-31 10:27 ` Russell King - ARM Linux
2011-01-31 10:31 ` Linus Walleij
2011-01-31 10:40 ` Russell King - ARM Linux
2011-01-31 13:53 ` Linus Walleij
2011-01-31 14:00 ` Russell King - ARM Linux [this message]
2011-01-31 12:00 ` Sergei Shtylyov
2011-01-31 12:25 ` Russell King - ARM Linux
2011-01-31 12:31 ` Sergei Shtylyov
2011-02-01 23:40 ` Russell King - ARM Linux
-- strict thread matches above, loose matches on Subject: below --
2011-01-27 14:02 Linus Walleij
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=20110131140009.GA13918@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).