Skip to content

Commit a43ac32

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Set up bridge resources earlier
Bridge windows are read twice from PCI Config Space, the first time from pci_read_bridge_windows(), which does not set up the device's resources. This causes problems down the road as child resources of the bridge cannot check whether they reside within the bridge window or not. Set up the bridge windows already in pci_read_bridge_windows(). Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Link: https://patch.msgid.link/20250924134228.1663-2-ilpo.jarvinen@linux.intel.com
1 parent 15c5867 commit a43ac32

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

drivers/pci/probe.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,14 @@ static void pci_read_bridge_windows(struct pci_dev *bridge)
537537
}
538538
if (io) {
539539
bridge->io_window = 1;
540-
pci_read_bridge_io(bridge, &res, true);
540+
pci_read_bridge_io(bridge,
541+
pci_resource_n(bridge, PCI_BRIDGE_IO_WINDOW),
542+
true);
541543
}
542544

543-
pci_read_bridge_mmio(bridge, &res, true);
545+
pci_read_bridge_mmio(bridge,
546+
pci_resource_n(bridge, PCI_BRIDGE_MEM_WINDOW),
547+
true);
544548

545549
/*
546550
* DECchip 21050 pass 2 errata: the bridge may miss an address
@@ -578,7 +582,10 @@ static void pci_read_bridge_windows(struct pci_dev *bridge)
578582
bridge->pref_64_window = 1;
579583
}
580584

581-
pci_read_bridge_mmio_pref(bridge, &res, true);
585+
pci_read_bridge_mmio_pref(bridge,
586+
pci_resource_n(bridge,
587+
PCI_BRIDGE_PREF_MEM_WINDOW),
588+
true);
582589
}
583590

584591
void pci_read_bridge_bases(struct pci_bus *child)

0 commit comments

Comments
 (0)