回覆: [PATCH] PCI: aspeed: Drop PROBE_PREFER_ASYNCHRONOUS to fix enumeration race
From: Manivannan Sadhasivam
Date: Sun Nov 29 2026 - 11:09:34 EST
On 2026-11-23 05:21 +0000, Jacky Chou wrote:
> Hi Mani,
>
> Thank you for your reply.
>
> > > 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.
> > >
> >
> > I don't understand the problem here. EP drivers will get enumerated only
> > during bus scan, which depends on the RC driver's pci_host_probe() call.
> >
> > Are you saying that the PCI devices are created before RC driver probe and
> > gettting enumerated? Not sure how that can happen.
> >
>
> We found there is a NIC from Realtek (10ec:8168) could reproduce this.
> The following log is from dmesg when booting on our system.
>
> ```
> [ 2.127140] aspeed-pcie 120f0000.pcie: PCI host bridge to bus
> ** replaying previous printk message **
> [ 2.127140] aspeed-pcie 120f0000.pcie: PCI host bridge to bus 0001:00
> [ 2.127158] pci_bus 0001:00: root bus resource [bus 00-ff]
> [ 2.127168] pci_bus 0001:00: root bus resource [mem 0x80000000-0x9fffffff]
> [ 2.127259] pci 0001:00:00.0: [1a03:1150] type 01 class 0x060400 PCIe Root Port
> [ 2.127281] pci 0001:00:00.0: PCI bridge to [bus 00]
> [ 2.127291] pci 0001:00:00.0: bridge window [io 0x0000-0x0fff]
> [ 2.127299] pci 0001:00:00.0: bridge window [mem 0x00000000-0x000fffff]
> [ 2.127311] pci 0001:00:00.0: bridge window [mem 0x00000000-0x000fffff 64bit pref]
> [ 2.127324] pci 0001:00:00.0: enabling Extended Tags
> [ 2.130479] pci 0001:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
> [ 2.130629] pci 0001:01:00.0: [10ec:8168] type 00 class 0x020000 PCIe Endpoint
> [ 2.130780] pci 0001:01:00.0: BAR 0 [io 0x0000-0x00ff]
> [ 2.130796] pci 0001:01:00.0: BAR 2 [mem 0x00000000-0x00000fff 64bit]
> [ 2.130808] pci 0001:01:00.0: BAR 4 [mem 0x00000000-0x00003fff 64bit pref]
> [ 2.130966] pci 0001:01:00.0: supports D1 D2
> [ 2.130972] pci 0001:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [ 2.131287] pci_bus 0001:01: busn_res: [bus 01-ff] end is updated to 01
> [ 2.131324] pci 0001:00:00.0: bridge window [mem 0x80000000-0x800fffff]: assigned
> [ 2.131335] pci 0001:00:00.0: bridge window [mem 0x80100000-0x801fffff 64bit pref]: assigned
> [ 2.131344] pci 0001:00:00.0: bridge window [io size 0x1000]: can't assign; no space
> [ 2.131351] pci 0001:00:00.0: bridge window [io size 0x1000]: failed to assign
> [ 2.131368] pci 0001:00:00.0: bridge window [io size 0x1000]: can't assign; no space
> [ 2.131375] pci 0001:00:00.0: bridge window [io size 0x1000]: failed to assign
> [ 2.131385] pci 0001:01:00.0: BAR 4 [mem 0x80100000-0x80103fff 64bit pref]: assigned
> [ 2.131411] pci 0001:01:00.0: BAR 2 [mem 0x80000000-0x80000fff 64bit]: assigned
> [ 2.131434] pci 0001:01:00.0: BAR 0 [io size 0x0100]: can't assign; no space
> [ 2.131440] pci 0001:01:00.0: BAR 0 [io size 0x0100]: failed to assign
> [ 2.131455] pci 0001:01:00.0: BAR 0 [io size 0x0100]: can't assign; no space
> [ 2.131462] pci 0001:01:00.0: BAR 0 [io size 0x0100]: failed to assign
> [ 2.131476] pci 0001:00:00.0: PCI bridge to [bus 01]
> [ 2.131485] pci 0001:00:00.0: bridge window [mem 0x80000000-0x800fffff]
> [ 2.131494] pci 0001:00:00.0: bridge window [mem 0x80100000-0x801fffff 64bit pref]
> [ 2.131504] pci_bus 0001:00: Some PCI device resources are unassigned, try booting with pci=realloc
> [ 2.131510] pci_bus 0001:00: resource 4 [mem 0x80000000-0x9fffffff]
> [ 2.131517] pci_bus 0001:01: resource 0 [io size 0x1000]
> [ 2.131524] pci_bus 0001:01: resource 1 [mem 0x80000000-0x800fffff]
> [ 2.131531] pci_bus 0001:01: resource 2 [mem 0x80100000-0x801fffff 64bit pref]
> [ 2.131876] pcieport 0001:00:00.0: enabling device (0000 -> 0002)
> [ 2.133870] pcieport 0001:00:00.0: PME: Signaling with IRQ 68
> [ 2.134638] r8169 0001:01:00.0: enabling device (0000 -> 0002)
> [ 2.135491] ------------[ cut here ]------------
> [ 2.135497] WARNING: kernel/module/kmod.c:145 at __request_module+0x1bc/0x2c0, CPU#0: kworker/u16:1/41
> [ 2.455514] Modules linked in:
> [ 2.458928] CPU: 0 UID: 0 PID: 41 Comm: kworker/u16:1 Tainted: G W T 7.4.0-rc3+ #8 PREEMPT(full)
> [ 2.470290] Tainted: [W]=WARN, [T]=RANDSTRUCT
> [ 2.475147] Hardware name: AST2700 EVB (DT)
> [ 2.479812] Workqueue: async async_run_entry_fn
> [ 2.484874] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [ 2.492645] pc : __request_module+0x1bc/0x2c0
> [ 2.497506] lr : __request_module+0x1b8/0x2c0
> [ 2.502367] sp : ffff8000820bb370
> [ 2.506061] x29: ffff8000820bb370 x28: ffff000006ed6000 x27: ffff000006ed5000
> [ 2.514032] x26: ffff000006ed60b8 x25: ffff000005d5ea80 x24: 0000000000000000
> [ 2.522004] x23: ffff000006ed5000 x22: ffff80008098fd6c x21: 0000000000000001
> [ 2.529976] x20: 00000000001cc915 x19: ffff800081470d78 x18: 0000000000000002
> [ 2.537948] x17: 0000000000000000 x16: 0000000000000001 x15: 0000000000000000
> [ 2.545920] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000001
> [ 2.553891] x11: 0000000000000000 x10: 0000000000000001 x9 : 0000000000000000
> [ 2.561861] x8 : ffff8000820bb428 x7 : 0000000000000000 x6 : 0000000000000000
> [ 2.569831] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000030
> [ 2.577802] x2 : 0000000000000008 x1 : ffff80008008ba74 x0 : 0000000000000001
> [ 2.585774] Call trace:
> [ 2.588499] __request_module+0x1bc/0x2c0 (P)
> [ 2.593363] phy_request_driver_module+0x118/0x17c
> [ 2.598713] phy_device_create+0x238/0x264
Ah, the classic PHY/driver core issue with async probing. We were bitten by it
already [1], but no fix yet.
I'll apply this one.
- Mani
[1] https://lore.kernel.org/linux-pci/20260226101032.1042-1-linux.amoon@xxxxxxxxx/