U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Chris Webb <chris@arachsys.com>, Marek Vasut <marex@denx.de>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH RFC] gpio: Fix probing of gpio-hogs
Date: Thu, 20 Jun 2024 14:16:17 -0600	[thread overview]
Message-ID: <20240620201617.GA3566532@bill-the-cat> (raw)
In-Reply-To: <0b24ac9c0f40ba2410529ee6e0ffd603c9453cff.1718275638.git.chris@arachsys.com>

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

On Thu, Jun 13, 2024 at 11:59:05AM +0100, Chris Webb wrote:

> 48b3ecbe replumbed the gpio-hog probing to use DM_FLAG_PROBE_AFTER_BIND.
> 
> Unfortunately gpio_post_bind is called after the non-preloc recursive
> dm_probe_devices completes, so setting this flag does not have the intended
> effect and the gpio-hogs never get probed. With instrumentation:
> 
>   [...]
>   CPU:   MediaTek MT7981
>   Model: GL.iNet GL-X3000
>   DRAM:  512 MiB
>   <mtk_pinctrl_mt7981_bind called>
>   <dm_probe_devices called: root root_driver root_driver [+] [ ]>
>   <dm_probe_devices called: clk fixed_clock gpt_dummy20m [ ] [ ]>
>   [...]
>   <dm_probe_devices called: led gpio_led signal-4 [ ] [ ]>
>   Core:  34 devices, 14 uclasses, devicetree: separate
>   MMC:   <gpio_post_bind called>
>   mmc@11230000: 0
>   [...]
> 
> Probe them directly in gpio_post_bind instead.
> 
> Signed-off-by: Chris Webb <chris@arachsys.com>
> ---
>  drivers/gpio/gpio-uclass.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
> index 4234cd91..1c6e1715 100644
> --- a/drivers/gpio/gpio-uclass.c
> +++ b/drivers/gpio/gpio-uclass.c
> @@ -1539,7 +1539,9 @@ static int gpio_post_bind(struct udevice *dev)
>  				 * since hogs can be essential to the hardware
>  				 * system.
>  				 */
> -				dev_or_flags(child, DM_FLAG_PROBE_AFTER_BIND);
> +				ret = device_probe(child);
> +				if (ret)
> +					return ret;
>  			}
>  		}
>  	}

Adding Marek, as the author of commit 48b3ecbedf82 ("gpio: Get rid of
gpio_hog_probe_all()").

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2024-06-20 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-13 10:59 [PATCH RFC] gpio: Fix probing of gpio-hogs Chris Webb
2024-06-20 20:16 ` Tom Rini [this message]
2024-06-22 11:04   ` Chris Webb
2024-07-03  9:49     ` Chris Webb
2024-07-29  7:45       ` Chris Webb
2024-07-29 15:25 ` Simon Glass
2024-07-29 15:44   ` Chris Webb
2024-07-29 16:18     ` Simon Glass
2024-07-29 16:45       ` Chris Webb
2024-07-29 17:21         ` Simon Glass
2024-07-31 10:14           ` Chris Webb
2024-07-31 14:38             ` Simon Glass
2024-07-31 18:14               ` Chris Webb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240620201617.GA3566532@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=chris@arachsys.com \
    --cc=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox