public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
Cc: Saravana Kannan <saravanak@google.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, patches@armlinux.org.uk,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v2] ARM: Add sanity check for dev->periphid in amba_probe()
Date: Tue, 30 Aug 2022 11:36:55 +0100	[thread overview]
Message-ID: <Yw3oR6WhM0O5LQX5@shell.armlinux.org.uk> (raw)
In-Reply-To: <2452e7b0-d4fd-2e27-a336-bf87b85a8d50@huawei.com>

On Tue, Aug 30, 2022 at 06:31:14PM +0800, Leizhen (ThunderTown) wrote:
> On 2022/8/30 18:07, Russell King (Oracle) wrote:
> > For an amba driver, drv->bus will always be pointing at amba_bustype.
> > That always has a "match" operation. Therefore, the default of '1'
> > above will *never* be used for an AMBA driver.
> > 
> > If drv->bus does not point at amba_bustype, then amba_probe() will
> > not be called for "drv".
> > 
> > Therefore, amba_match() must always be called before amba_probe().
> 
> Oh, I was careless. I think it's drv->match. But the processing flow
> will continue to go to "dev->bus->probe".
> 
> __driver_attach():
>         ret = driver_match_device(drv, dev);
>         if (ret == 0) {
>                 /* no match */
>                 return 0;
>         } else if (ret == -EPROBE_DEFER) {               <------no return in this branch
>                 dev_dbg(dev, "Device match requests probe deferral\n");
>                 dev->can_match = true;
>                 driver_deferred_probe_add(dev);
>         } else if (ret < 0) {
>                 dev_dbg(dev, "Bus failed to match device: %d\n", ret);
>                 return ret;
>         } /* ret > 0 means positive match */
> 
>         ... ...
>         driver_probe_device(drv, dev);
>              ......
>                   dev->bus->probe

And that makes no sense, is an already known issue, and there is a patch
to fix it:

https://lore.kernel.org/all/20220817184026.3468620-1-isaacmanjarres@google.com/

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

  reply	other threads:[~2022-08-30 10:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-30  6:54 [PATCH v2] ARM: Add sanity check for dev->periphid in amba_probe() Zhen Lei
2022-08-30  7:20 ` Saravana Kannan
2022-08-30  9:47   ` Russell King (Oracle)
2022-08-30  9:48     ` Russell King (Oracle)
2022-08-30 10:03     ` Leizhen (ThunderTown)
2022-08-30 10:07       ` Russell King (Oracle)
2022-08-30 10:31         ` Leizhen (ThunderTown)
2022-08-30 10:36           ` Russell King (Oracle) [this message]
2022-08-30 11:19             ` Linus Walleij
2022-08-30 11:49               ` Leizhen (ThunderTown)
2022-08-30 17:34             ` Saravana Kannan
2022-08-30 23:48               ` Saravana Kannan
2022-08-30  9:50 ` Russell King (Oracle)
2022-08-30 10:07   ` Leizhen (ThunderTown)
2022-08-30 12:11     ` Leizhen (ThunderTown)
2022-08-30 10:28 ` Russell King (Oracle)

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=Yw3oR6WhM0O5LQX5@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@armlinux.org.uk \
    --cc=saravanak@google.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    /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