From: Herve Codina <herve.codina@bootlin.com>
To: sashiko-bot@kernel.org
Cc: sashiko-reviews@lists.linux.dev, linux-pci@vger.kernel.org
Subject: Re: [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node
Date: Tue, 26 May 2026 16:38:54 +0200 [thread overview]
Message-ID: <20260526163854.6cb05dae@bootlin.com> (raw)
In-Reply-To: <20260512233518.0B0F8C2BCB0@smtp.kernel.org>
Hi all,
On Tue, 12 May 2026 23:35:17 +0000
sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] Removing `fwnode_dev_initialized()` causes consumers of the PCI host bridge to indefinitely defer probe or suffer a 30-second boot delay.
> --
>
> commit 77e0afe5e647b8f57bcce68df03d0b7040fbfe25
> Author: Herve Codina <herve.codina@bootlin.com>
>
> PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node
>
> This commit removes the fwnode_dev_initialized() call during the creation of
> the PCI host bridge node to allow devlink to correctly create links for
> devices in device-tree overlays.
>
> > diff --git a/drivers/pci/of.c b/drivers/pci/of.c
> > index 25fb02c3dc720..53a8a4f30eb66 100644
> > --- a/drivers/pci/of.c
> > +++ b/drivers/pci/of.c
> > @@ -811,7 +811,6 @@ void of_pci_make_host_bridge_node(struct pci_host_bridge *bridge)
> > */
> > of_node_set_flag(np, OF_POPULATED);
> > fw_devlink_set_device(&np->fwnode, &bridge->dev);
> > - fwnode_dev_initialized(&np->fwnode, true);
>
> Will removing this cause consumers of the PCI host bridge to indefinitely
> defer probe or suffer a 30-second boot delay?
No, nothing of this kind has been observed.
>
> The commit message indicates that the device related to this firmware node
> is handled using driver core mechanisms and is fully compliant with devlink
> expectations. However, isn't bridge->dev a structural device with no bus
> (dev->bus == NULL)? If so, it would never undergo driver matching or
> probing.
>
> If fwnode_dev_initialized() is removed, FWNODE_FLAG_INITIALIZED is cleared.
> When consumer devices are parsed, fw_devlink creates a managed device link
> from the consumer to bridge->dev, expecting it to eventually probe. Since
> the bridge device never probes, its status remains DL_DEV_NO_DRIVER.
>
> When the consumer device attempts to probe, device_links_check_suppliers()
> might see a dormant supplier and return -EPROBE_DEFER.
>
> Additionally, because device_add(&bridge->dev) executes before
> of_pci_make_host_bridge_node() attaches the fwnode, device_add() would see a
> NULL fwnode and skip the fallback fw_devlink_unblock_consumers() call.
>
> >
> > ret = of_changeset_apply(cset);
> > if (ret)
>
No devlink should be created with a consumer/supplier relationship between
a device and the host bridge.
The traditional parent/child relationship between the host bridge and
devices behind the bridge is sufficient and fully handled without devlink.
With the flag set, the trace 'Not linking xxxx - might never become dev' [1]
is present for devlink creation where chidren of the host bridge are involved.
Don't confuse devlink setting this flag while all devices are created using
driver core mechanism.
Maybe Sashiko is confused also by the way things are done. Usually, fwnodes
are created first and devices are instantiated based on those fwnodes. Here,
devices already exist and OF nodes (fwnodes) are created and attached to
those devices. Indeed, we are on the PCI enumeration and missing OF nodes are
dynamically created.
[1] https://elixir.bootlin.com/linux/v7.1-rc4/source/drivers/base/core.c#L2167
Best regards,
Hervé
prev parent reply other threads:[~2026-05-26 14:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 15:59 [PATCH v7 0/8] lan966x pci device: Add support for SFPs, PCI part Herve Codina
2026-05-11 15:59 ` [PATCH v7 1/8] driver core: fw_devlink: Introduce fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 2/8] drivers: core: Use fw_devlink_set_device() Herve Codina
2026-05-11 15:59 ` [PATCH v7 3/8] pinctrl: cs42l43: " Herve Codina
2026-05-11 15:59 ` [PATCH v7 4/8] cxl/test: Use device_set_node() Herve Codina
2026-05-12 8:26 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 5/8] cxl/test: Use fw_devlink_set_device() Herve Codina
2026-05-12 8:27 ` Andy Shevchenko
2026-05-11 15:59 ` [PATCH v7 6/8] PCI: of: " Herve Codina
2026-05-11 15:59 ` [PATCH v7 7/8] PCI: of: Set fwnode device of newly created PCI device nodes Herve Codina
2026-05-12 22:46 ` sashiko-bot
2026-05-13 14:56 ` Herve Codina
2026-05-11 15:59 ` [PATCH v7 8/8] PCI: of: Remove fwnode_dev_initialized() call for a PCI root bridge node Herve Codina
2026-05-12 23:35 ` sashiko-bot
2026-05-26 14:38 ` Herve Codina [this message]
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=20260526163854.6cb05dae@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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