Skip to content

Commit 647f80a

Browse files
jh80chungUlf Hansson
authored andcommitted
mmc: dw_mmc: fix the error handling for dma operation
When dma->start is failed,then it has to fall back to PIO mode for current transfer. But Host controller was already set to bits relevant to DMA operation. If needs to use the PIO mode, Host controller has to stop the DMA operation. (It's more stable than now.) When it occurred error, it's not running any request. Fixes: 3fc7eae ("mmc: dw_mmc: Add external dma interface support") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com> Cc: <stable@vger.kernel.org> # v4.3+ Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent b0921d5 commit 647f80a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/mmc/host/dw_mmc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
10581058
spin_unlock_irqrestore(&host->irq_lock, irqflags);
10591059

10601060
if (host->dma_ops->start(host, sg_len)) {
1061+
host->dma_ops->stop(host);
10611062
/* We can't do DMA, try PIO for this one */
10621063
dev_dbg(host->dev,
10631064
"%s: fall back to PIO mode for current transfer\n",

0 commit comments

Comments
 (0)