[PATCH] dm: pinctrl: Revert "pinctrl: probe pinctrl drivers during post-bind"

Pali Rohár pali at kernel.org
Thu Dec 22 00:02:30 CET 2022


On Wednesday 21 December 2022 07:27:39 Simon Glass wrote:
> This breaks chromebook_coral and it is also not how things should work. If
> a board needs to bind GPIOs as part of a pinctrl driver this can be done
> during the bind step, if needed.
> 
> We cannot probe pinctrl devices when binding as a rule, since it cannot be
> supported on some platforms.
> 
> The bind and probe steps are separate in U-Boot and they should remain
> separate.
> 
> This reverts commit f9ec791b5e24378b71590877499f8683d5f54dac.

Unfortunately reverting this patch would break other devices, mostly
A3720 based where pinctrl driver acts also as gpio driver. Because no
other caller then register gpio driver and so other drivers which parses
gpios from DT (which belongs to that gpio driver) will fail during
probe.

Also I think that pinctrl command would not work in this case if pinctrl
would not be probed.

> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
>  drivers/pinctrl/pinctrl-uclass.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
> index ce2d5ddf6d9..a1b85ca87e5 100644
> --- a/drivers/pinctrl/pinctrl-uclass.c
> +++ b/drivers/pinctrl/pinctrl-uclass.c
> @@ -403,13 +403,6 @@ static int __maybe_unused pinctrl_post_bind(struct udevice *dev)
>  {
>  	const struct pinctrl_ops *ops = pinctrl_get_ops(dev);
>  
> -	/*
> -	 * Make sure that the pinctrl driver gets probed after binding
> -	 * as some pinctrl drivers also register the GPIO driver during
> -	 * probe, and if they are not probed GPIO-s are not registered.
> -	 */
> -	dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
> -
>  	if (!ops) {
>  		dev_dbg(dev, "ops is not set.  Do not bind.\n");
>  		return -EINVAL;
> -- 
> 2.39.0.314.g84b9a713c41-goog
> 


More information about the U-Boot mailing list