linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: renesas_sdhi: fix regression with hard reset on old SDHIs
@ 2021-08-26  8:21 Wolfram Sang
  2021-08-26 14:25 ` Geert Uytterhoeven
  2021-10-05 17:02 ` Biju Das
  0 siblings, 2 replies; 14+ messages in thread
From: Wolfram Sang @ 2021-08-26  8:21 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Geert Uytterhoeven, Yoshihiro Shimoda, Wolfram Sang

Old SDHI instances have a default value for the reset register which
keeps it in reset state by default. So, when applying a hard reset we
need to manually leave the soft reset state as well. Later SDHI
instances have a different default value, the one we write manually now.

Fixes: b4d86f37eacb ("mmc: renesas_sdhi: do hard reset if possible")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Geez, typical SDHI nastiness here...

Geert: I think this fixes the issue you saw on Koelsch. It works fine on
my Lager now at least. Can you please test and tag if all goes well?
It would be great to have this in 5.14 but it definately needs Geert's
confirmation first.

 drivers/mmc/host/renesas_sdhi_core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 6fc4cf3c9dce..a4407f391f66 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -561,6 +561,8 @@ static void renesas_sdhi_reset(struct tmio_mmc_host *host)
 		/* Unknown why but without polling reset status, it will hang */
 		read_poll_timeout(reset_control_status, ret, ret == 0, 1, 100,
 				  false, priv->rstc);
+		/* At least SDHI_VER_GEN2_SDR50 needs manual release of reset */
+		sd_ctrl_write16(host, CTL_RESET_SD, 0x0001);
 		priv->needs_adjust_hs400 = false;
 		renesas_sdhi_set_clock(host, host->clk_cache);
 	} else if (priv->scc_ctl) {
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-10-06 12:53 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26  8:21 [PATCH] mmc: renesas_sdhi: fix regression with hard reset on old SDHIs Wolfram Sang
2021-08-26 14:25 ` Geert Uytterhoeven
2021-08-26 14:31   ` Wolfram Sang
2021-09-06 17:09     ` Ulf Hansson
2021-09-09 12:56       ` Wolfram Sang
2021-09-27  7:57       ` Wolfram Sang
2021-09-27 11:55         ` Ulf Hansson
2021-09-27 12:02           ` Wolfram Sang
2021-08-26 16:34   ` Wolfram Sang
2021-09-09  9:33   ` Geert Uytterhoeven
2021-09-09 12:55     ` Wolfram Sang
2021-10-05 17:02 ` Biju Das
2021-10-06 12:45   ` Biju Das
2021-10-06 12:53     ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).