Skip to content

Commit 647f80a

Browse files
jh80chungstorulf
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 <[email protected]> Signed-off-by: Jaehoon Chung <[email protected]> Reviewed-by: Shawn Lin <[email protected]> Cc: <[email protected]> # v4.3+ Signed-off-by: Jaehoon Chung <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent b0921d5 commit 647f80a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)