lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 26 Jul 2021 06:42:16 +0900
From:   Jaehoon Chung <jh80.chung@...sung.com>
To:     Vincent Whitchurch <vincent.whitchurch@...s.com>,
        Ulf Hansson <ulf.hansson@...aro.org>
Cc:     kernel@...s.com, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: Fix hang on data CRC error

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@...s.com>

Reviewed-by: Jaehoon Chung <jh80.chung@...sung.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;
>  			}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ