]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: dw_mmc: fix stop when fallen back to PIO
authorJames Hogan <james.hogan@imgtec.com>
Wed, 29 Jun 2011 08:28:43 +0000 (09:28 +0100)
committerChris Ball <cjb@laptop.org>
Wed, 20 Jul 2011 21:21:05 +0000 (17:21 -0400)
commitbd80cced108e493147d60344da6677d19ec2a1e3
tree989d0a96a03d8838de7617f6eb0062ed2a7065e6
parenta74a0b5cbf93e3cadb3608226450b0d3f43ee91e
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>
drivers/mmc/host/dw_mmc.c
include/linux/mmc/dw_mmc.h