DORMANTno replies

[PATCH] mmci: don't try DMA on anything <= fifosize

From: Linus Walleij <hidden>
Date: 2011-02-01 12:21:36
Subsystem: arm primecell mmci pl180/1 driver, multimedia card (mmc), secure digital (sd) and sdio subsystem, the rest · Maintainers: Russell King, Ulf Hansson, Linus Torvalds

There is no point in using DMA on anything that will fit just fine
in the FIFO. Let's just read and retrieve it from the FIFO.

Cc: Ulf Hansson <redacted>
Cc: Sebastian Rasmussen <redacted>
Signed-off-by: Linus Walleij <redacted>
---
This patch on top of the latest DMA code makes U8500 work again,
without the need for any completion callback patches.
---
 drivers/mmc/host/mmci.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 800b69c..c87a8d2 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -463,10 +463,12 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
 		datactrl |= MCI_DPSM_DIRECTION;
 
 	/*
-	 * Attempt to use DMA operation mode, if this
-	 * should fail, fall back to PIO mode
+	 * When we want to transfer something less than or equal to the FIFO
+	 * depth, PIO works just fine, no risk of overrun. Else try DMA
+	 * first and foremost.
 	 */
-	if (!mmci_dma_start_data(host, datactrl))
+	if (host->size > variant->fifosize &&
+	    !mmci_dma_start_data(host, datactrl))
 		return;
 
 	/* IRQ mode, map the SG list for CPU reading/writing */
-- 
1.7.3.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help