Skip to content

Commit e585a37

Browse files
guilhermepiccolibjorn-helgaas
authored andcommitted
PCI: Only override AMD USB controller if required
By running a Van Gogh device (Steam Deck), the following message was noticed in the kernel log: pci 0000:04:00.3: PCI class overridden (0x0c03fe -> 0x0c03fe) so dwc3 driver can claim this instead of xhci Effectively this means the quirk executed but changed nothing, since the class of this device was already the proper one (likely adjusted by newer firmware versions). Check and perform the override only if necessary. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Huang Rui <[email protected]> Cc: Vicki Pfau <[email protected]>
1 parent d9dcdb4 commit e585a37

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/pci/quirks.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,13 @@ static void quirk_amd_dwc_class(struct pci_dev *pdev)
702702
{
703703
u32 class = pdev->class;
704704

705-
/* Use "USB Device (not host controller)" class */
706-
pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
707-
pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
708-
class, pdev->class);
705+
if (class != PCI_CLASS_SERIAL_USB_DEVICE) {
706+
/* Use "USB Device (not host controller)" class */
707+
pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
708+
pci_info(pdev,
709+
"PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
710+
class, pdev->class);
711+
}
709712
}
710713
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
711714
quirk_amd_dwc_class);

0 commit comments

Comments
 (0)