mmc: dw_mmc: Fix switch from DMA to PIO
Subsystems (2)
PATCH 1/1 mmc: dw_mmc: Fix switch from DMA to PIO
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.
--- drivers/mmc/host/dw_mmc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/mmc/host/dw_mmc.c +3 -1
@@ -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 ;
Signature · 1 line
1.7.0.4
Quoted 7 lines · Seungwon Jeon
When
dw_mci_pre_dma_transferreturns failure in some reasons,dw_mci_submit_datawill 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 <[email protected]>
This looks ok to me.
Hi,
Quoted 7 lines · Will Newton
Quoted 6 lines · Seungwon Jeon
When
dw_mci_pre_dma_transferreturns failure in some reasons,dw_mci_submit_datawill 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.
Quoted 5 lines
Quoted 1 line
Signed-off-by Seungwon Jeon <[email protected]>This looks ok to me.
Acked-by Will Newton <[email protected]>
Thanks, pushed to mmc-next for 3.4.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child