Skip to contentSkip to conversation

mmc: renesas_sdhi: special 4tap settings only apply to HS400

PATCH Superseded Wolfram Sang 3 participants 6 messages Apr 1, 2022 – Apr 6, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wolfram Sang

author maintainer
#0 lore raw

PATCH 1/1 mmc: renesas_sdhi: special 4tap settings only apply to HS400

Previous doucmentation was vague, so we included SDR104 for slow SDnH clock settings. It turns out now, that it is only needed for HS400.

Fixes bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling")
---
 drivers/mmc/host/renesas_sdhi_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +2 -2
index 2797a9c0f17d..2a4d314aa027 100644
@@ -144,9 +144,9 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
 		return clk_get_rate(priv->clk);
 
 	if (priv->clkh) {
+		/* HS400 with 4TAP needs different clock settings */
 		bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
-		bool need_slow_clkh = (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) ||
-				      (host->mmc->ios.timing == MMC_TIMING_MMC_HS400);
+		bool need_slow_clkh = host->mmc->ios.timing == MMC_TIMING_MMC_HS400;
 		clkh_shift = use_4tap && need_slow_clkh ? 1 : 2;
 		ref_clk = priv->clkh;
 	}
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Wolfram-san,

Thank you for the patch!

Quoted 3 lines

From: Wolfram Sang, Sent: Friday, April 1, 2022 9:45 PM

Previous doucmentation was vague, so we included SDR104 for slow SDnH

s/doucmentation/documentation/

Quoted 5 lines

clock settings. It turns out now, that it is only needed for HS400.

Fixes bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling")

After fixed the typo,

Best regards,
Yoshihiro Shimoda

author maintainer
#2 lore raw
Quoted 4 lines
Quoted 2 lines

Previous doucmentation was vague, so we included SDR104 for slow SDnH

s/doucmentation/documentation/

Oops, thank you! v2 sent out now.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Wolfram Sang

Hi Wolfram,

Quoted 6 lines · Wolfram Sang

Previous doucmentation was vague, so we included SDR104 for slow SDnH clock settings. It turns out now, that it is only needed for HS400.

Fixes bb6d3fa98a41 ("clk: renesas: rcar-gen3: Switch to new SD clock handling")

(after fixing the typo)

drivers/mmc/host/renesas_sdhi_core.c static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host, · line 149

Quoted 11 lines
drivers/mmc/host/renesas_sdhi_core.c +2 -2
@@ -144,9 +144,9 @@ static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
                return clk_get_rate(priv->clk);
 
        if (priv->clkh) {
+               /* HS400 with 4TAP needs different clock settings */
                bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
-               bool need_slow_clkh = (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) ||
-                                     (host->mmc->ios.timing == MMC_TIMING_MMC_HS400);
+               bool need_slow_clkh = host->mmc->ios.timing == MMC_TIMING_MMC_HS400;

I'm wondering if we've lost the critical mass for keeping the bools?

drivers/mmc/host/renesas_sdhi_core.c static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host, · line 150

Quoted 1 line
drivers/mmc/host/renesas_sdhi_core.c +0 -0
                clkh_shift = use_4tap && need_slow_clkh ? 1 : 2;

Unfortunately I don't see a good way to rewrite this, without inflating source code size...

drivers/mmc/host/renesas_sdhi_core.c static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host, · line 152

Quoted 2 lines
drivers/mmc/host/renesas_sdhi_core.c +0 -0
                ref_clk = priv->clkh;
        }

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

author maintainer
#4 lore raw
Quoted 7 lines

drivers/mmc/host/renesas_sdhi_core.c static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host, · line 149

Quoted 5 lines
                bool use_4tap = priv->quirks && priv->quirks->hs400_4taps;
drivers/mmc/host/renesas_sdhi_core.c +1 -2
-               bool need_slow_clkh = (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) ||
-                                     (host->mmc->ios.timing == MMC_TIMING_MMC_HS400);
+               bool need_slow_clkh = host->mmc->ios.timing == MMC_TIMING_MMC_HS400;

I'm wondering if we've lost the critical mass for keeping the bools?

Might be. I'll think about it.

author maintainer
#5 lore raw
In reply to Geert Uytterhoeven
Quoted 2 lines

I'm wondering if we've lost the critical mass for keeping the bools?

So, I had a look at this and think that the current version is still way better in terms of readability. I think the compilers will optimize enough. It is not a hot path anyway. So, I'd like to keep the code.