[PATCH] mmci: restrict DMA usage to large, even multiblock transfers

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Feb 1 05:54:08 EST 2011


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.

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;



More information about the linux-arm-kernel mailing list