lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <721420c6-5e65-48a4-81c5-b161d0df8cfd@pengutronix.de>
Date: Wed, 21 May 2025 13:44:59 +0200
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: ziniu.wang_1@....com, haibo.chen@....com, adrian.hunter@...el.com,
 ulf.hansson@...aro.org, linux-mmc@...r.kernel.org
Cc: imx@...ts.linux.dev, s32@....com, shawnguo@...nel.org,
 s.hauer@...gutronix.de, linux-kernel@...r.kernel.org, kernel@...gutronix.de,
 festevam@...il.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: inherit pins_100mhz from
 pins_200mhz when unconfigured

Hi Luke,

Thanks for your patch.

On 21.05.25 13:20, ziniu.wang_1@....com wrote:
> From: Luke Wang <ziniu.wang_1@....com>
> 
> On some new i.MX platforms, hardware guidelines recommend using identical
> pin configurations for SDR50/DDR50 (100MHz) and SDR104/HS400 (200MHz)
> modes. But defining two identical pinctrl for 100MHz and 200MHz in dts
> creates redundancy.

I am not convinced this is an improvement. If 200mhz is missing, it's understood
that it's not supported. Now if 100mhz is missing, it means something different
depending on whether state_200mhz exists or not. This is more mental overhead
than having:

  pinctrl-names = "default", "state_100mhz", "state_200mhz";
  pinctrl-0 = <&pinctrl_usdhc1>;        
  pinctrl-1 = <&pinctrl_usdhc1_uhs>;   
  pinctrl-2 = <&pinctrl_usdhc1_uhs>;

where it's directly evident that you share pinctrl states.

> In this case, omit explicit 100MHz configuration,
> driver will inherit 100MHz pinctrl from 200MHz.
> 
> Preserves existing behavior if 100MHz is configured but 200MHz not (e.g,
> imx8mp-navq.dts usdhc1 supports SDR50/DDR50 but SDR104/HS400 not).

This conflicts with the binding, which doesn't allow for state_200mhz
to exist without state_100mhz, so that would need adaptation.

As noted before though, I don't think we really need to change anything
here though.

Thanks,
Ahmad

> 
> Signed-off-by: Luke Wang <ziniu.wang_1@....com>
> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index f206b562a6e3..dfd8be5000c8 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1810,6 +1810,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>  						ESDHC_PINCTRL_STATE_100MHZ);
>  		imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,
>  						ESDHC_PINCTRL_STATE_200MHZ);
> +
> +		if (IS_ERR_OR_NULL(imx_data->pins_100mhz))
> +			imx_data->pins_100mhz = imx_data->pins_200mhz;
>  	}
>  
>  	/* call to generic mmc_of_parse to support additional capabilities */


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ