[PATCH 02/11] PCI: Use Header Type in __pci_bridge_assign_resources()
From: Ilpo Järvinen
Date: Mon Nov 09 2026 - 16:08:56 EST
Commit b2fb5cc57469 ("PCI: Rely on config space header type, not class
code") converted bridge window sizing and assignment to use the Header
Type but __pci_bridge_assign_resources() still uses the Class Code to
decide how to program the bridge windows. A Type 1 bridge whose Class
Code is not PCI_CLASS_BRIDGE_PCI gets its windows sized and assigned but
they are never programmed into the bridge.
Use the Header Type also in __pci_bridge_assign_resources().
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
---
I don't have known failure to point to with this, thus I've not added the
Fixes tag (the commit ref is available in the changelog if it's needed).
drivers/pci/setup-bus.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index ed16ef7c26fa..6209773a35f1 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1636,12 +1636,12 @@ static void __pci_bridge_assign_resources(struct pci_dev *bridge,
__pci_bus_assign_resources(b, add_list, fail_head);
- switch (bridge->class >> 8) {
- case PCI_CLASS_BRIDGE_PCI:
+ switch (bridge->hdr_type) {
+ case PCI_HEADER_TYPE_BRIDGE:
pci_setup_bridge(b);
break;
- case PCI_CLASS_BRIDGE_CARDBUS:
+ case PCI_HEADER_TYPE_CARDBUS:
pci_setup_cardbus_bridge(b);
break;
--
2.47.3