All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: renesas_sdhi: set CBSY flag before probing TMIO host
@ 2019-03-19 10:34 Wolfram Sang
  2019-03-19 10:57 ` Geert Uytterhoeven
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wolfram Sang @ 2019-03-19 10:34 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Niklas Söderlund, Marek Vasut,
	Yoshihiro Shimoda, Wolfram Sang

The CBSY flag should be proper before calling tmio_mmc_host_probe()
because this function will already use write16 which checks this bit.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This patch depends on "[RFT] mmc: renesas_sdhi: limit block count to 16 bit for
old revisions" [1]. This one, however, is not backed by a bug report but just
found by code review. I wouldn't suggest stable here because the non-working
case is probably more on the academic side (unless I overlooked something).
Yet, the code becomes easier to read because it is the flow one would expect.
So, I post this already for discussion. We need to wait for the dependency
first, of course.

Tested on the SDR50 only SDHI of a Renesas Lager board (R-Car H2). No
regressions encountered: still probes fine and works at the same speed.

[1] https://patchwork.kernel.org/patch/10859279/

 drivers/mmc/host/renesas_sdhi_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 8742e27e4e8b..5885f3fb0b2f 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -779,14 +779,14 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	if (ver < SDHI_VER_GEN2_SDR104 && mmc_data->max_blk_count > U16_MAX)
 		mmc_data->max_blk_count = U16_MAX;
 
-	ret = tmio_mmc_host_probe(host);
-	if (ret < 0)
-		goto edisclk;
-
 	/* One Gen2 SDHI incarnation does NOT have a CBSY bit */
 	if (ver == SDHI_VER_GEN2_SDR50)
 		mmc_data->flags &= ~TMIO_MMC_HAVE_CBSY;
 
+	ret = tmio_mmc_host_probe(host);
+	if (ret < 0)
+		goto edisclk;
+
 	/* Enable tuning iff we have an SCC and a supported mode */
 	if (of_data && of_data->scc_offset &&
 	    (host->mmc->caps & MMC_CAP_UHS_SDR104 ||
-- 
2.11.0


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

end of thread, other threads:[~2019-03-25 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 10:34 [PATCH] mmc: renesas_sdhi: set CBSY flag before probing TMIO host Wolfram Sang
2019-03-19 10:57 ` Geert Uytterhoeven
2019-03-19 11:29   ` Wolfram Sang
2019-03-19 11:45 ` Simon Horman
2019-03-20 20:14 ` Niklas Söderlund
2019-03-25 13:26 ` Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.