[RFC] PCIe host controller async probe vs PHY request_module deadlock
From: Hans Zhang
Date: Fri Nov 27 2026 - 02:44:56 EST
Hi Andrew, Bjorn, Mani,
I'd like to raise a cross-subsystem issue before sending a one-line fix.
Several PCIe host controller drivers set PROBE_PREFER_ASYNCHRONOUS so
their root complexes are enumerated in parallel. On the CIX Sky1 SoC the
driver probes up to five root complexes. When it enumerates an RTL8126A
NIC, the NIC's mdiobus_register() runs in an async worker, and
phy_device_create() then calls request_module() synchronously. That hits:
WARN_ON_ONCE(wait && current_is_async());
and can deadlock, because module init may call async_synchronize_full().
This is not specific to Sky1. The same pattern exists in many PCIe host
drivers, for example:
pcie-mediatek-gen3.c, pcie-rzg3s-host.c, pcie-aspeed.c,
pcie-stm32.c, pcie-qcom.c, pcie-spacemit-k1.c, pcie-rcar-gen4.c,
pcie-andes-qilai.c, pci-layerscape.c, pci-imx6.c, pcie-nxp-s32g.c
So any of them could hit the same problem when a downstream device probes
an MDIO bus.
I see two possible fixes:
1. PCI side: force synchronous probing on the affected host controller
driver (PROBE_FORCE_SYNCHRONOUS). This is self-contained and low-risk,
but serializes the root complex enumeration. On sky1-xcp (three root
complexes) the measured boot time is close to the async baseline, but
that measurement does not include PCIe PHY enumeration or link-training
timeouts. Serializing the root complexes would sum those latencies, so
the real cost grows with the number of root complexes and PHYs.
2. net/phy side: return -EPROBE_DEFER from __mdiobus_register() when
current_is_async() is true. This keeps async probing and fixes all MAC
drivers, but I audited the in-tree mdiobus_register() callers and found
some (lantiq_etop, smsc911x, smsc9420) that convert any error to
-ENXIO and would not defer correctly.
Could you advise which layer should carry the fix? If the preference is
the general net/phy approach, I can follow up with a more detailed audit
of the callers.
Test data on sky1-xcp:
- unpatched async kernel: the kmod WARN is present;
- PROBE_FORCE_SYNCHRONOUS: WARN is gone, both RTL8126A NICs still probe
and bind their PHY driver, NVMe/root and the serial console are normal.
Init starts at ~2.63s versus ~2.79s for the async baseline in this
three-root-complex configuration. This measurement has no PCIe PHY or
link-training timeout in the path, so it is a lower bound.
Best regards,
Hans