mmc: dw_mmc: Dont wait for DRTO on Write RSP error
Subsystems (2)
PATCH 1/1 mmc: dw_mmc: Dont wait for DRTO on Write RSP error
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 attest 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.
--- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/dw_mmc.c +2 -1
@@ -2081,7 +2081,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)* 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 ; }
Signature · 4 lines
2.32.0 Hyperstone GmbH | Line-Eid-Strasse 3 | 78467 Konstanz Managing Directors: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782
Jaehoon Chung
maintainerHi Chritstian,
Quoted 14 lines · Christian Löhle
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 attest 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.
Sorry for reply too late. I'm checking your patch on my target. I will share the result.
Best Regards,
Jaehoon Chung
Quoted 21 lines
Signed-off-by Christian Loehle <[email protected]>--- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/dw_mmc.c +2
-1@@ -2081,7 +2081,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)* 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 ; }
Quoted 18 lines · Jaehoon Chung
Hi Chritstian,
Quoted 14 lines · Christian Löhle
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 attest 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.
Quoted 8 lines
Sorry for reply too late. I'm checking your patch on my target. I will share the result.
Best Regards,
Jaehoon ChungQuoted 2 lines
Signed-off-by Christian Loehle <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 21 lines
Quoted 19 lines
--- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/dw_mmc.c +2
-1@@ -2081,7 +2081,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)* 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 ; }
Quoted 16 lines · Christian Löhle
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 attest 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.
Quoted 1 line
Signed-off-by Christian Loehle <[email protected]>
Applied for next and by adding a stable tag, thanks!
If you don't think we need the stable tag, please tell me.
Kind regards
Uffe
Quoted 24 lines
--- drivers/mmc/host/dw_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/host/dw_mmc.c +2
-2@@ -2081,7 +2081,8 @@ static void dw_mci_tasklet_func(struct tasklet_struct *t)* 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 ; } --2.32.0
Hyperstone GmbH | Line-Eid-Strasse 3 | 78467 Konstanz Managing Directors: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782