Ben Hutchings <ben@xxxxxxxxxxxxxxx> (2024-07-25): > If CONFIG_USB_XHCI_PCI_RENESAS is enabled, xhci-pci conditionally > calls into the xhci-pci-renesas module, which means both modules must > be loaded to use any xHCI PCI controller. > > The MODULE_FIRMWARE declaration in the base xhci-pci module causes > initramfs-tools to check for and warn about missing firmware for the > Renesas xHCI controllers, when any xHCI PCI controller is present. > And because of the previous oddity, simply moving this declaration to > xhci-pci-renesas wouldn't help. > > To fix this, reverse the relationship between the modules: > > - Remove the quirk for the Renesas xHCIs, and the driver_data > structure used only for them > - In xhci-pci: > - Rename xhci_pci_probe() to xhci_pci_common_probe() > - Export xhci_pci_common_probe() and xhci_pci_remove() > - Use a new probe function that rejects the Renesas xHCIs and then > calls the common probe function > - In xhci-pci-renesas: > - Stop exporting renesas_xhci_check_request_fw() > - Add a probe function that calls renesas_xhci_check_request_fw() > followed by xhci_pci_common_probe() > - Add and register a new pci_driver matching only the Renesas xHCIs > and using its own probe function, but with other operations the > same as in xhci-pci > - Make CONFIG_USB_XHCI_PCI_RENESAS depend on CONFIG_USB_XHCI_PCI, > not the other way around > > Finally, move the MODULE_FIRMWARE declaration to xhci-pci-renesas. > > Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx> Tested-by: Cyril Brulebois <cyril@xxxxxxxxxxx> On top of 16f3a28cf5f876a7f3550d8f4c870a7b41bcfaef, starting from a distribution-oriented .config (Debian's 6.10-1~exp1 arm64 package), default answers to oldconfig, adding CONFIG_USB_XHCI_PCI_RENESAS=m afterwards. On the hardware side: Raspberry Pi CM4 Lite on a CM4 IO Board, with two (slightly) different Supahub PCIe-to-quad-USB cards (006 and 006S), everything is good with the firmware available. Otherwise this happens: [ 7.965954] xhci-pci-renesas 0000:01:00.0: failed to load firmware renesas_usb_fw.mem, fallback to ROM [ 7.975705] xhci-pci-renesas 0000:01:00.0: xHCI Host Controller [ 7.981728] xhci-pci-renesas 0000:01:00.0: new USB bus registered, assigned bus number 1 [ 27.982001] xhci-pci-renesas 0000:01:00.0: can't setup: -110 [ 27.987787] xhci-pci-renesas 0000:01:00.0: USB bus 1 deregistered [ 27.994007] xhci-pci-renesas 0000:01:00.0: init 0000:01:00.0 fail, -110 [ 28.000742] xhci-pci-renesas 0000:01:00.0: probe with driver xhci-pci-renesas failed with error -110 (No onboard ROM on those.) Thanks, Ben! Cheers, -- Cyril Brulebois (kibi@xxxxxxxxxx) <https://debamax.com/> D-I release manager -- Release team member -- Freelance Consultant
Attachment:
signature.asc
Description: PGP signature