diff options
| author | Bjorn Helgaas <bhelgaas@google.com> | 2025-03-27 13:14:43 -0500 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2025-03-27 13:14:43 -0500 |
| commit | e9e224daddecffe8a924b985f0b1956d7199d4e3 (patch) | |
| tree | d2145c1098c1b1d0d6230cfb1568aa3e7a6d288a /drivers/pci/pci.c | |
| parent | 651aa9052c35287fd0bf280ba847b3de051f20f5 (diff) | |
| parent | 6e8d06e5096c80cbf41313b4a204f43071ca42be (diff) | |
Merge branch 'pci/enumeration'
- Enable Configuration RRS SV early instead of during child bus scanning
(Bjorn Helgaas)
- Cache offset of Resizable BAR capability to avoid redundant searches for
it (Bjorn Helgaas)
- Fix reference leaks in pci_register_host_bridge() and
pci_alloc_child_bus() (Ma Ke)
- Drop put_device() in pci_register_host_bridge() left over from converting
device_register() to device_add() (Dan Carpenter)
* pci/enumeration:
PCI: Remove stray put_device() in pci_register_host_bridge()
PCI: Fix reference leak in pci_alloc_child_bus()
PCI: Fix reference leak in pci_register_host_bridge()
PCI: Cache offset of Resizable BAR capability
PCI: Enable Configuration RRS SV early
Diffstat (limited to 'drivers/pci/pci.c')
| -rw-r--r-- | drivers/pci/pci.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9c0d99964351..f869f4c1a293 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1879,7 +1879,7 @@ static void pci_restore_rebar_state(struct pci_dev *pdev) unsigned int pos, nbars, i; u32 ctrl; - pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_REBAR); + pos = pdev->rebar_cap; if (!pos) return; @@ -3726,6 +3726,11 @@ void pci_acs_init(struct pci_dev *dev) pci_enable_acs(dev); } +void pci_rebar_init(struct pci_dev *pdev) +{ + pdev->rebar_cap = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_REBAR); +} + /** * pci_rebar_find_pos - find position of resize ctrl reg for BAR * @pdev: PCI device @@ -3740,7 +3745,7 @@ static int pci_rebar_find_pos(struct pci_dev *pdev, int bar) unsigned int pos, nbars, i; u32 ctrl; - pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_REBAR); + pos = pdev->rebar_cap; if (!pos) return -ENOTSUPP; |