From: ulf.hansson@stericsson.com (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmci: restrict DMA usage to large, even multiblock transfers
Date: Tue, 1 Feb 2011 12:34:14 +0100 [thread overview]
Message-ID: <4D47EFB6.5090509@stericsson.com> (raw)
In-Reply-To: <20110201105408.GA31216@n2100.arm.linux.org.uk>
>> On Tue, Feb 01, 2011 at 11:41:13AM +0100, Linus Walleij wrote:
>> This will restrict the use of DMA to only cover multi-block
>> transfers of blocks that are evenly divisible with the FIFO
>> halfsize (8 4-byte words, 32 bytes). This will be true for any
>> normal, large MMC file transfer, falling back to PIO mode for
>> any smallish reads.
> Russell King - ARM Linux wrote:
> That's a very bad idea. If it's an ARM primecell, and we (by some magical
> reason) are using DMA, we want to always use DMA for transfers larger than
> the FIFO depth. If we switch to PIO mode, we will see FIFO overruns/
> underruns if the CPU can't keep up with the data rate.
>
> So I think you actually want:
>
> if (host->size >= variant->fifosize &&
> !mmci_dma_start_data(host, datactrl))
> return;
Getting FIFO overrun/underruns is then as of today already the case when
running PIO for ARM primecell. To prevent this; you probably now that
already, hardware flow control is implemented in ST version of the ARM
primecell.
For performance gain I think the threshold should probably not be less
than a 512 bytes block, but of course performance test needs to verify this.
Maybe a better option would be to specify a dma_threshold value in the
variant struct. Thus the value can differ between what version of the
ARM primcell we are using.
Finally I would prefer to move this "threshold" check into the
mmci_dma_start_data function instead, since there anyway can be other
reasons to why we want to fall back to PIO mode. Better to do that from
one place.
/Ulf Hansson
next prev parent reply other threads:[~2011-02-01 11:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 10:41 [PATCH] mmci: restrict DMA usage to large, even multiblock transfers Linus Walleij
2011-02-01 10:54 ` Russell King - ARM Linux
2011-02-01 11:34 ` Ulf Hansson [this message]
2011-02-01 11:45 ` Russell King - ARM Linux
2011-02-01 11:56 ` Ulf Hansson
2011-02-01 11:58 ` Russell King - ARM Linux
2011-02-01 14:07 ` Linus Walleij
2011-02-01 14:44 ` Russell King - ARM Linux
2011-02-02 9:39 ` Linus Walleij
2011-02-01 15:05 ` Russell King - ARM Linux
2011-02-02 9:34 ` 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=4D47EFB6.5090509@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).