aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2011-06-29 04:28:43 -0400
committerChris Ball <cjb@laptop.org>2011-07-20 17:21:05 -0400
commit03e8cb534e7cc3f71a07528a44da7ce68e5b5708 (patch)
tree989d0a96a03d8838de7617f6eb0062ed2a7065e6 /include/linux/mmc
parent65d13516b2358c38ac56a5f83e989a6837dcf825 (diff)
mmc: dw_mmc: fix stop when fallen back to PIO
There are several situations when dw_mci_submit_data_dma() decides to fall back to PIO mode instead of using DMA, due to a short (to avoid overhead) or "complex" (e.g. with unaligned buffers) transaction, even though host->use_dma is set. However dw_mci_stop_dma() decides whether to stop DMA or set the EVENT_XFER_COMPLETE event based on host->use_dma. When falling back to PIO mode this results in data timeout errors getting missed and the driver locking up. Therefore add host->using_dma to indicate whether the current transaction is using dma or not, and adjust dw_mci_stop_dma() to use that instead. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Will Newton <will.newton@imgtec.com> Tested-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/dw_mmc.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index f3f68ee08a1..6b46819705d 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -48,6 +48,7 @@ struct mmc_data;
48 * @data: The data currently being transferred, or NULL if no data 48 * @data: The data currently being transferred, or NULL if no data
49 * transfer is in progress. 49 * transfer is in progress.
50 * @use_dma: Whether DMA channel is initialized or not. 50 * @use_dma: Whether DMA channel is initialized or not.
51 * @using_dma: Whether DMA is in use for the current transfer.
51 * @sg_dma: Bus address of DMA buffer. 52 * @sg_dma: Bus address of DMA buffer.
52 * @sg_cpu: Virtual address of DMA buffer. 53 * @sg_cpu: Virtual address of DMA buffer.
53 * @dma_ops: Pointer to platform-specific DMA callbacks. 54 * @dma_ops: Pointer to platform-specific DMA callbacks.
@@ -121,6 +122,7 @@ struct dw_mci {
121 122
122 /* DMA interface members*/ 123 /* DMA interface members*/
123 int use_dma; 124 int use_dma;
125 int using_dma;
124 126
125 dma_addr_t sg_dma; 127 dma_addr_t sg_dma;
126 void *sg_cpu; 128 void *sg_cpu;