From: ulf.hansson@stericsson.com (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmci: sync DATAEND irq with dma transfer done
Date: Fri, 6 May 2011 10:13:33 +0200 [thread overview]
Message-ID: <4DC3ADAD.70603@stericsson.com> (raw)
In-Reply-To: <20110429134936.GQ5126@n2100.arm.linux.org.uk>
Russell King - ARM Linux wrote:
> On Fri, Apr 29, 2011 at 02:44:59PM +0200, Ulf Hansson wrote:
>>> That's rather unfortunate, because it means that trying it on ARM
>>> hardware is going to hang indefinitely waiting for the nonexistent
>>> DMA stuff to finish.
>> I see the problem, we need a way of being able to switch between using
>> the dma callback and not using it. I think the variant data should be
>> used for this, what do you think?
>
> How can we do that when it actually depends on how the primecell is wired
> and the characteristics of the DMA controller to which it is connected?
OK, lets add a new member in the mmci amba platform struct then. That
should do it!?
>
>> host->dataend and host->size==0 controls whether the data transfer has
>> finished successfully. I believe this should be handled correctly in my
>> patch. Maybe it is possible to make some minor restructuring to make it
>> more clear what the end condition really is, I can see if I can figure
>> something out.
>
> host->size never goes to zero when DMA is in progress, as it doesn't
> track the progress of the transfer. That's only tracked with PIO,
> and the remainder is calculated on error from the primecells counters.
>
The error handling is almost the same for PIO and DMA. If we get
MCI_DATACRCFAIL | MCI_DATATIMEOUT | MCI_TXUNDERRUN | MCI_RXOVERRUN, then
we use the DATACNT register to find out the remainder of data, done in
mmci_data_irq function. There is no difference between DMA and PIO here.
But, if we are "hanging" for a dma_callback to be called to fully
complete the data transfer there is no error handling. You proposed to
use a timer, which should be set when DATAEND occurs and if we still are
waiting for the dma callback. I think this is good approach!
If that timer runs out, we could potentially read the DATACNT register
to find out the remainder of data as we do when we handle
MCI_DATACRCFAIL | MCI_DATATIMEOUT | MCI_TXUNDERRUN | MCI_RXOVERRUN
errors. We must also take actions to terminate the dma job.
next prev parent reply other threads:[~2011-05-06 8:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 9:02 [PATCH] mmci: sync DATAEND irq with dma transfer done Linus Walleij
2011-04-19 9:20 ` Russell King - ARM Linux
2011-04-19 12:00 ` Linus Walleij
2011-04-19 12:03 ` Russell King - ARM Linux
2011-04-20 16:29 ` Linus Walleij
2011-04-20 16:46 ` Vitaly Wool
2011-04-20 17:17 ` Linus Walleij
2011-04-20 17:58 ` Vitaly Wool
2011-04-20 20:11 ` Linus Walleij
2011-04-28 17:03 ` Russell King - ARM Linux
2011-04-28 22:24 ` Martin Furmanski
2011-05-11 20:13 ` Linus Walleij
2011-04-29 12:44 ` Ulf Hansson
2011-04-29 13:49 ` Russell King - ARM Linux
2011-05-06 8:13 ` Ulf Hansson [this message]
2011-05-12 8:36 ` Per Forlin
2011-05-12 13:15 ` 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=4DC3ADAD.70603@stericsson.com \
--to=ulf.hansson@stericsson.com \
--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).