* [PATCH] PCI: Only override AMD USB controller if required
@ 2023-11-20 16:04 Guilherme G. Piccoli
2023-11-20 22:17 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Guilherme G. Piccoli @ 2023-11-20 16:04 UTC (permalink / raw)
To: linux-pci
Cc: bhelgaas, kernel, kernel-dev, Guilherme G. Piccoli, Huang Rui,
Vicki Pfau
By running a Vangogh 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).
Hence, let's just check and perform the override only if necessary.
Cc: Huang Rui <ray.huang@amd.com>
Cc: Vicki Pfau <vi@endrift.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
---
drivers/pci/quirks.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index ea476252280a..4e3bb1643b09 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -702,10 +702,13 @@ static void quirk_amd_dwc_class(struct pci_dev *pdev)
{
u32 class = pdev->class;
- /* Use "USB Device (not host controller)" class */
- pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
- pci_info(pdev, "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
- class, pdev->class);
+ if (class != PCI_CLASS_SERIAL_USB_DEVICE) {
+ /* Use "USB Device (not host controller)" class */
+ pdev->class = PCI_CLASS_SERIAL_USB_DEVICE;
+ pci_info(pdev,
+ "PCI class overridden (%#08x -> %#08x) so dwc3 driver can claim this instead of xhci\n",
+ class, pdev->class);
+ }
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB,
quirk_amd_dwc_class);
--
2.42.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCI: Only override AMD USB controller if required
2023-11-20 16:04 [PATCH] PCI: Only override AMD USB controller if required Guilherme G. Piccoli
@ 2023-11-20 22:17 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2023-11-20 22:17 UTC (permalink / raw)
To: linux-pci, Guilherme G. Piccoli; +Cc: kernel, kernel-dev, Huang Rui, Vicki Pfau
On Mon, 20 Nov 2023 13:04:36 -0300, Guilherme G. Piccoli wrote:
> By running a Vangogh 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).
>
> [...]
Applied, thanks!
[1/1] PCI: Only override AMD USB controller if required
commit: e585a37e5061f6d5060517aed1ca4ccb2e56a34c
Best regards,
--
Bjorn Helgaas <bhelgaas@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-20 22:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 16:04 [PATCH] PCI: Only override AMD USB controller if required Guilherme G. Piccoli
2023-11-20 22:17 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox