]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
mmc: dw_mmc: Fix hang on data CRC error
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Wed, 30 Jun 2021 10:22:32 +0000 (12:22 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 24 Sep 2021 10:27:51 +0000 (12:27 +0200)
commit33d35c930b899d23ce97f8314f512390601b58fd
tree1000fbd4aff01ab530a9104bb20723db6903c35b
parentaae99b8053c600ffb2e2fbab4c3646663421d38d
mmc: dw_mmc: Fix hang on data CRC error

BugLink: https://bugs.launchpad.net/bugs/1944212
[ Upstream commit 25f8203b4be1937c4939bb98623e67dcfd7da4d1 ]

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>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210630102232.16011-1-vincent.whitchurch@axis.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/mmc/host/dw_mmc.c