Re: [PATCH v6 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue
From: Jihong Min
Date: Mon May 18 2026 - 19:07:02 EST
On 5/19/26 06:37, Michal Pecio wrote:
> That's true.
> Making this possible is the whole purpose of "if IS_ENABLED" here:
I re-checked the Kconfig cases, and I think you are right here.
The two cases I was trying to avoid are:
1. the sensor driver is built as a module, or loads only after the
initramfs stage, but the PROM21 controller has already been bound by
the generic xhci-pci driver, so no auxiliary device exists for the
sensor driver to bind to;
2. the built-in generic xhci-pci driver rejects the PROM21 controller, but
xhci-pci-prom21 is only available as a module and is not present during
initramfs, leaving USB behind that controller unavailable at that
stage.
Looking at your proposed Kconfig shape again, it handles both cases.
If SENSORS_PROM21_XHCI=n, then no sensor support is requested and
USB_XHCI_PCI_PROM21 can stay disabled. In that case generic xhci-pci binds
the controller, which is fine because there is no sensor driver that
needs an
auxiliary device.
If SENSORS_PROM21_XHCI=m or y and USB_XHCI_PCI=y, then
USB_XHCI_PCI_PROM21 follows USB_XHCI_PCI and becomes y. That means the
PROM21
glue is available during early boot, creates the auxiliary device, and the
hwmon driver can still bind later if it is built as a module.
If USB_XHCI_PCI=m, then xhci-pci itself is modular. In that case needing the
PROM21 glue module in initramfs is not a PROM21-specific built-in/module
split
problem; it is the normal requirement for a modular xHCI PCI setup.
So I agree that tying the hidden glue option to whether
SENSORS_PROM21_XHCI is enabled is reasonable.
> Currently, you have a weird situation where xhci-pci-prom21 always
> binds on x86 and xhci-pci on other platforms (with the unofficial PCIe
> card you mentioned), plus the sensor cannot work on other platforms.
Agreed. I also agree that the X86 dependency is only a heuristic and is
not a
good restriction for a PCI ID based driver. PROM21 is mainly used on AMD x86
desktop platforms today, but the unofficial PCIe card example shows that the
device can exist outside the normal AMD x86 chipset topology.
I do not know whether other PROM21-related functionality is supported on
non-x86 platforms, but this driver does not need to prevent the xHCI
temperature sensor path from being built there.
> One could further argue that neither should it care whether some hwmon
> driver exists at all, or which kernel releases it exists in :)
Right. I think the cleanest result is:
- generic xhci-pci handles PROM21 when no sensor support is requested;
- xhci-pci-prom21 handles PROM21 only when the sensor path is enabled;
- the hwmon driver remains the user-visible option.
Unless Guenter or the USB maintainers object, I plan to change the next
revision in that direction and test the Kconfig combinations locally.
Sincerely,
Jihong Min