diff options
| author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-09-24 16:42:27 +0300 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-09-25 16:15:22 -0500 |
| commit | a43ac325c7cbbfe72bdf9178059b3ee9f5a2c7dd (patch) | |
| tree | 555efc06723957c60eaf28cf6eba68c0c870f059 | |
| parent | 15c5867b0ae6a47914b45daf3b64e2d2aceb4ee5 (diff) | |
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
| -rw-r--r-- | drivers/pci/probe.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index eaeb66bec433..86a83ab043d2 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -537,10 +537,14 @@ static void pci_read_bridge_windows(struct pci_dev *bridge) } if (io) { bridge->io_window = 1; - pci_read_bridge_io(bridge, &res, true); + pci_read_bridge_io(bridge, + pci_resource_n(bridge, PCI_BRIDGE_IO_WINDOW), + true); } - pci_read_bridge_mmio(bridge, &res, true); + pci_read_bridge_mmio(bridge, + pci_resource_n(bridge, PCI_BRIDGE_MEM_WINDOW), + true); /* * 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) bridge->pref_64_window = 1; } - pci_read_bridge_mmio_pref(bridge, &res, true); + pci_read_bridge_mmio_pref(bridge, + pci_resource_n(bridge, + PCI_BRIDGE_PREF_MEM_WINDOW), + true); } void pci_read_bridge_bases(struct pci_bus *child) |