* [PATCH] PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race
@ 2026-11-09 11:57 Jacky Chou
2026-11-09 12:13 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Jacky Chou @ 2026-11-09 11:57 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, Joel Stanley,
Andrew Jeffery, Ryan Chen, Billy Tsai
Cc: linux-aspeed, linux-pci, linux-arm-kernel, linux-kernel,
Jacky Chou
The ASPEED PCIe RC driver opts in to asynchronous probing via
PROBE_PREFER_ASYNCHRONOUS. This allows the driver core to probe it
on a kthread in parallel with other drivers instead of waiting for
it to finish during the synchronous probe pass.
On boards where a PCIe endpoint driver is bound early (e.g. built
into the kernel or probed from an initcall that runs before late_
initcall), this races against the RC driver: the EP driver can start
probing before the RC driver has finished enumerating the bus, so the
EP device is not yet present and the EP driver fails to bind.
Remove PROBE_PREFER_ASYNCHRONOUS so the RC driver probes
synchronously again, guaranteeing that bus enumeration completes
before any downstream EP driver's probe() runs.
Fixes: 9aa0cb68fcc1 ("PCI: aspeed: Add ASPEED PCIe RC driver")
Signed-off-by: Jacky Chou <jacky_chou@aspeedtech.com>
---
drivers/pci/controller/pcie-aspeed.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pci/controller/pcie-aspeed.c b/drivers/pci/controller/pcie-aspeed.c
index ecb7562f84c0..def5591010ca 100644
--- a/drivers/pci/controller/pcie-aspeed.c
+++ b/drivers/pci/controller/pcie-aspeed.c
@@ -1104,7 +1104,6 @@ static struct platform_driver aspeed_pcie_driver = {
.name = "aspeed-pcie",
.of_match_table = aspeed_pcie_of_match,
.suppress_bind_attrs = true,
- .probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = aspeed_pcie_probe,
};
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261109-aspeed-pcie-sync-probe-fa1d96eb3ce9
Best regards,
--
Jacky Chou <jacky_chou@aspeedtech.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race
2026-11-09 11:57 [PATCH] PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race Jacky Chou
@ 2026-11-09 12:13 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-09 12:13 UTC (permalink / raw)
To: Jacky Chou; +Cc: linux-pci
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] PCI: aspeed: dropping PROBE_PREFER_ASYNCHRONOUS does not fix
EP probe order
--
commit 0a5273357bc4c6f662270192044fe2acfee34187
Author: Jacky Chou <jacky_chou@aspeedtech.com>
PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race
This commit removes PROBE_PREFER_ASYNCHRONOUS from aspeed_pcie_driver so
that the ASPEED PCIe Root Complex driver probes synchronously.
> diff --git a/drivers/pci/controller/pcie-aspeed.c b/drivers/pci/controller/pcie-aspeed.c
> index ecb7562f84c01..def5591010cac 100644
> --- a/drivers/pci/controller/pcie-aspeed.c
> +++ b/drivers/pci/controller/pcie-aspeed.c
> @@ -1104,7 +1104,6 @@ static struct platform_driver aspeed_pcie_driver = {
> .name = "aspeed-pcie",
> .of_match_table = aspeed_pcie_of_match,
> .suppress_bind_attrs = true,
> - .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> },
> .probe = aspeed_pcie_probe,
> };
[Severity: Medium]
Does dropping PROBE_PREFER_ASYNCHRONOUS from aspeed_pcie_driver actually
solve the endpoint probe ordering problem described in the commit message?
Registering a struct pci_driver before the bus is enumerated succeeds and
adds the driver to pci_bus_type; its probe() callback does not run until
aspeed_pcie_probe() finishes enumeration and pci_bus_add_device() calls
device_initial_probe(&dev->dev), which binds any already-registered
pci_driver even when aspeed_pcie_probe() runs on an async worker.
If a consumer instead looks up a pci_dev directly from an initcall or an
on-board endpoint requires another driver to run before bus enumeration,
removing PROBE_PREFER_ASYNCHRONOUS still does not guarantee that
aspeed_pcie_probe() runs before late_initcall: aspeed_pcie_driver is
registered at device_initcall via builtin_platform_driver(), and
aspeed_pcie_probe() acquires resets, clocks, and PHYs (h2xrst, port->clk,
port->phy, port->perst) that can defer probing via -EPROBE_DEFER or
fw_devlink until deferred_probe_initcall() at late_initcall.
Meanwhile, forcing synchronous probing serializes the 10 ms mdelay() in
aspeed_host_reset() and the 100 ms msleep() per port in
aspeed_pcie_port_init() on the main boot thread across all RC instances.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-aspeed-pcie-sync-probe-v1-1-71cc9e718623@aspeedtech.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-09 12:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09 11:57 [PATCH] PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race Jacky Chou
2026-11-09 12:13 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox