[PATCH] mmc: core: host: fix mmc retuning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As per the JEDEC spec, tuning(command CMD21) is not allowed in
RPMB partition.

To avoid retuning while switching to RPMB, hold_retune variable was
introduced but it is not taken into account while making the tuning
decision. As a consequence of this, mmc driver aborts while switching to
RPMB partition:
 mmc0: mmc_hs400_to_hs200 failed, error -84

To fix this, take hold_retune variable into account while making retune
decision in mmc_retune() function.

Fixes: 57da0c042f4a ("mmc: block: Pause re-tuning while switched to the RPMB partition")
Reported-by: Judy Wang <wangjudy@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Shyam Saini <shyamsaini@xxxxxxxxxxxxxxxxxxx>
---
 drivers/mmc/core/host.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index b89dca1f15e9..342c1f5c256b 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -181,6 +181,9 @@ int mmc_retune(struct mmc_host *host)
 	bool return_to_hs400 = false;
 	int err;
 
+	if (host->hold_retune >= 1)
+		return 0;
+
 	if (host->retune_now)
 		host->retune_now = 0;
 	else
-- 
2.34.1




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux