Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sunxi: reset the controller after an update-clock timeout
@ 2026-10-27  3:52 Tam Do
  0 siblings, 0 replies; only message in thread
From: Tam Do @ 2026-10-27  3:52 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-mmc,
	linux-sunxi, linux-arm-kernel, linux-kernel

If the clock-update command times out it stays pending in the
controller, and every later clock update times out as well, so the
card cannot be initialised until the next probe.

This happens on an R16 board whose SDIO Wi-Fi holds DAT0 busy while
its supply comes up during the first clock update.

Reset the controller on timeout so the next attempt can succeed.

Fixes: 3cbcb16095f9 ("mmc: sunxi: Add driver for SD/MMC hosts found on Allwinner sunxi SoCs")
Cc: stable@vger.kernel.org
Signed-off-by: Tam Do <tam.do@manyhobbies.com>
---
 drivers/mmc/host/sunxi-mmc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index fe4c0f6..439cfa4 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -688,6 +688,7 @@ static int sunxi_mmc_oclk_onoff(struct sunxi_mmc_host *host, u32 oclk_en)
 
 	if (rval & SDXC_START) {
 		dev_err(mmc_dev(host->mmc), "fatal err update clk timeout\n");
+		sunxi_mmc_init_host(host);
 		return -EIO;
 	}
 
-- 
2.39.5



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-27  3:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27  3:52 [PATCH] mmc: sunxi: reset the controller after an update-clock timeout Tam Do

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox