PCI: Only override AMD USB controller if required
authorGuilherme G. Piccoli <gpiccoli@igalia.com>
Mon, 20 Nov 2023 16:04:36 +0000 (13:04 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:14:31 +0000 (20:14 +0000)
commitcc56867d3226c1b5f142c77af8de149c0d5f774c
tree675a37a4f490ab2b09402172b6334841a789cd64
parenta71f8c0a1ba2916441d276279c809b3848b9fe8b
PCI: Only override AMD USB controller if required

[ Upstream commit e585a37e5061f6d5060517aed1ca4ccb2e56a34c ]

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/20231120160531.361552-1-gpiccoli@igalia.com
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Huang Rui <ray.huang@amd.com>
Cc: Vicki Pfau <vi@endrift.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/quirks.c