Re: [PATCH v24 07/15] mmc: renesas_sdhi: Add tuning delay support for RZ/G2L

From: Wolfram Sang

Date: Thu Sep 03 2026 - 05:46:37 EST



This might be over-engineering a bit, but let's discuss:

> +static void renesas_sdhi_set_hw_adjustment_delay(struct tmio_mmc_host *host)

How about adding a 'bool force_clear' parameter here...

> +{
> + struct renesas_sdhi *priv = host_to_priv(host);
> +
> + if (!(host->pdata->flags & TMIO_MMC_TUNING_DELAY))
> + return;
> +
> + if (host->mmc->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330)

add '|| force_clear' here ...

> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x0);
> + else
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x1);
> +}

...

> + if ((host->pdata->flags & TMIO_MMC_TUNING_DELAY) && priv->tap_num == 8)
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0);

and simplify this to

/* add comment why on tap_num == 8 */
if (priv->tap_num == 8)
renesas_sdhi_set_hw_adjustment_delay(host, true);

?

The other call to renesas_sdhi_set_hw_adjustment_delay needs the bool
parameter 'false' then, of course.

What do you think? Rest looks good.

Attachment: signature.asc
Description: PGP signature