U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH RFC] gpio: Fix probing of gpio-hogs
Date: Mon, 29 Jul 2024 16:44:33 +0100	[thread overview]
Message-ID: <CB131E81-078E-43FF-BE67-90D7F48EDB2E@arachsys.com> (raw)
In-Reply-To: <CAFLszTiwfVg7o+Rhf10U2exgUA-vJ4V_A-2L75ZLpwJ8sW=9Kw@mail.gmail.com>

Simon Glass <sjg@chromium.org> wrote:

> We cannot probe devices when they are bound since it breaks the
> ordering of driver model.
>
> From your trace it looks like everything is happening after
> relocation. I can't quite see what is actually going wrong. But if you
> look at dm_init_and_scan(), it does the probe at the end, immediately
> after all devices have been bound. So it should do what you want.
>
> Is the GPIO device not being bound? There is something strange here.

Hi Simon, many thanks for your follow up. Yes I wasn't convinced the patch  
was the correct fix (hence the RFC) but posted as it was one of the two  
ways I found to make gpio-hog work, the other being adding a .bind  
function in U_BOOT_DRIVER(mt7981_pinctrl) like

     static int mtk_pinctrl_mt7981_bind(struct udevice *dev)
     {
     	dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
     	return 0;
     }

to force a probe after bind in the parent pinctrl device. I was hoping  
someone with more clue than me might go 'Aha! This is just...'  :)

The device I tested on has been deployed but I can probably get it back  
for a bit and resolder a serial console on to test again if that would be  
helpful. Are there other significant places I should be adding some traces  
that would make the problem clearer?

Is it significant/relevant that the gpio device is a child of the pinctrl  
device in the mt7981 device tree?

I think the gpio device must be getting bound, because otherwise my trace  
in gpio_post_bind() wouldn't get called at all, but perhaps it's bound too  
late somehow?

Best wishes,

Chris.

  reply	other threads:[~2024-07-29 15:44 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
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 [this message]
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=CB131E81-078E-43FF-BE67-90D7F48EDB2E@arachsys.com \
    --to=chris@arachsys.com \
    --cc=sjg@chromium.org \
    --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