Skip to content

Commit

Permalink
mmc: dw_mmc: Fix switch from DMA to PIO
Browse files Browse the repository at this point in the history
When dw_mci_pre_dma_transfer returns failure in some reasons,
dw_mci_submit_data will prepare to switch the PIO mode from DMA.
After switching to PIO mode, DMA(IDMAC in particular) is still
enabled. This makes the corruption in handling interrupt and
the driver lock-up.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Seungwon Jeon authored and Chris Ball committed Apr 21, 2012
1 parent 32d317c commit a99aa9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,10 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
return -ENODEV;

sg_len = dw_mci_pre_dma_transfer(host, data, 0);
if (sg_len < 0)
if (sg_len < 0) {
host->dma_ops->stop(host);
return sg_len;
}

host->using_dma = 1;

Expand Down

0 comments on commit a99aa9b

Please sign in to comment.