diff mbox

[RESEND,PATCHv2] mmc: dw_mmc: fix the error handling for dma operation

Message ID 20161121015148.5699-1-jh80.chung@samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jaehoon Chung Nov. 21, 2016, 1:51 a.m. UTC
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: 3fc7eaef44db ("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>
---
Changelog on V2
- Change the Fixes Commit Id
- Added the Marek's Reported-by tags

 drivers/mmc/host/dw_mmc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jaehoon Chung Nov. 21, 2016, 4:23 a.m. UTC | #1
On 11/21/2016 10:51 AM, Jaehoon Chung wrote:
> 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: 3fc7eaef44db ("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>

Applied on my fixes branch with stable tags.

Best Regards,
Jaehoon Chung

> ---
> Changelog on V2
> - Change the Fixes Commit Id
> - Added the Marek's Reported-by tags
> 
>  drivers/mmc/host/dw_mmc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 50a674b..df478ae 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1058,6 +1058,7 @@ static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
>  	spin_unlock_irqrestore(&host->irq_lock, irqflags);
>  
>  	if (host->dma_ops->start(host, sg_len)) {
> +		host->dma_ops->stop(host);
>  		/* We can't do DMA, try PIO for this one */
>  		dev_dbg(host->dev,
>  			"%s: fall back to PIO mode for current transfer\n",
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 50a674b..df478ae 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1058,6 +1058,7 @@  static int dw_mci_submit_data_dma(struct dw_mci *host, struct mmc_data *data)
 	spin_unlock_irqrestore(&host->irq_lock, irqflags);
 
 	if (host->dma_ops->start(host, sg_len)) {
+		host->dma_ops->stop(host);
 		/* We can't do DMA, try PIO for this one */
 		dev_dbg(host->dev,
 			"%s: fall back to PIO mode for current transfer\n",