summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/dw_mmc.c
diff options
context:
space:
mode:
authorChristian Löhle <CLoehle@hyperstone.com>2021-09-16 05:59:19 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-17 09:48:17 +0100
commitacbc2a08ea7c99fbbb1a5983eff83477adf1c4e5 (patch)
tree18fdfd53ffed7dccad0d2c43be79827b661a09f6 /drivers/mmc/host/dw_mmc.c
parent5ee76475f82a1d464adfa3b43a659754836e5212 (diff)
downloadlinux-stable-acbc2a08ea7c99fbbb1a5983eff83477adf1c4e5.tar.gz
linux-stable-acbc2a08ea7c99fbbb1a5983eff83477adf1c4e5.tar.bz2
linux-stable-acbc2a08ea7c99fbbb1a5983eff83477adf1c4e5.zip
mmc: dw_mmc: Dont wait for DRTO on Write RSP error
commit 43592c8736e84025d7a45e61a46c3fa40536a364 upstream. Only wait for DRTO on reads, otherwise the driver hangs. The driver prevents sending CMD12 on response errors like CRCs. According to the comment this is because some cards have problems with this during the UHS tuning sequence. Unfortunately this workaround currently also applies for any command with data. On reads this will set the drto timer, which then triggers after a while. On writes this will not set any timer and the tasklet will not be scheduled again. I cannot test for the UHS workarounds need, but even if so, it should at most apply to reads. I have observed many hangs when CMD25 response contained a CRC error. This patch fixes this without touching the actual UHS tuning workaround. Signed-off-by: Christian Loehle <cloehle@hyperstone.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/af8f8b8674ba4fcc9a781019e4aeb72c@hyperstone.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc.c')
-rw-r--r--drivers/mmc/host/dw_mmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 7b280cb36327..ba37be8e423c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -2013,7 +2013,8 @@ static void dw_mci_tasklet_func(unsigned long priv)
* delayed. Allowing the transfer to take place
* avoids races and keeps things simple.
*/
- if (err != -ETIMEDOUT) {
+ if (err != -ETIMEDOUT &&
+ host->dir_status == DW_MCI_RECV_STATUS) {
state = STATE_SENDING_DATA;
continue;
}