linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: kernel@axis.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: Fix hang on data CRC error
Date: Mon, 26 Jul 2021 06:42:16 +0900	[thread overview]
Message-ID: <9c1ae48f-f60a-0dd9-00f0-84ef60da68e5@samsung.com> (raw)
In-Reply-To: <20210630102232.16011-1-vincent.whitchurch@axis.com>

On 6/30/21 7:22 PM, Vincent Whitchurch wrote:
> When a Data CRC interrupt is received, the driver disables the DMA, then
> sends the stop/abort command and then waits for Data Transfer Over.
> 
> However, sometimes, when a data CRC error is received in the middle of a
> multi-block write transfer, the Data Transfer Over interrupt is never
> received, and the driver hangs and never completes the request.
> 
> The driver sets the BMOD.SWR bit (SDMMC_IDMAC_SWRESET) when stopping the
> DMA, but according to the manual CMD.STOP_ABORT_CMD should be programmed
> "before assertion of SWR".  Do these operations in the recommended
> order.  With this change the Data Transfer Over is always received
> correctly in my tests.
> 
> Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/host/dw_mmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index f85271f5c4fa..845b0745ea37 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -2083,8 +2083,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)
>  					continue;
>  				}
>  
> -				dw_mci_stop_dma(host);
>  				send_stop_abort(host, data);
> +				dw_mci_stop_dma(host);
>  				state = STATE_SENDING_STOP;
>  				break;
>  			}
> @@ -2108,10 +2108,10 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)
>  			 */
>  			if (test_and_clear_bit(EVENT_DATA_ERROR,
>  					       &host->pending_events)) {
> -				dw_mci_stop_dma(host);
>  				if (!(host->data_status & (SDMMC_INT_DRTO |
>  							   SDMMC_INT_EBE)))
>  					send_stop_abort(host, data);
> +				dw_mci_stop_dma(host);
>  				state = STATE_DATA_ERROR;
>  				break;
>  			}
> @@ -2144,10 +2144,10 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)
>  			 */
>  			if (test_and_clear_bit(EVENT_DATA_ERROR,
>  					       &host->pending_events)) {
> -				dw_mci_stop_dma(host);
>  				if (!(host->data_status & (SDMMC_INT_DRTO |
>  							   SDMMC_INT_EBE)))
>  					send_stop_abort(host, data);
> +				dw_mci_stop_dma(host);
>  				state = STATE_DATA_ERROR;
>  				break;
>  			}
> 


  parent reply	other threads:[~2021-07-25 21:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210630102240epcas1p33bbdffb5eb553a49badaffab756d482c@epcas1p3.samsung.com>
2021-06-30 10:22 ` [PATCH] mmc: dw_mmc: Fix hang on data CRC error Vincent Whitchurch
2021-06-30 22:06   ` Jaehoon Chung
2021-07-14 11:49     ` Vincent Whitchurch
2021-07-14 21:46       ` Jaehoon Chung
2021-07-14 21:48       ` Jaehoon Chung
2021-07-25 21:42   ` Jaehoon Chung [this message]
2021-08-04 11:34   ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c1ae48f-f60a-0dd9-00f0-84ef60da68e5@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=vincent.whitchurch@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).