aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2019-06-24 14:39:35 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2019-06-29 10:41:50 +1000
commit80d9a360d43ef17763bc55ac0e45cf4da5347140 (patch)
tree7d061f23878f769a18cb2165ef81af89a7808fda
parentec1ea2b46d1a0f58eebee16bb5426b1c6d9c1745 (diff)
downloadpci-80d9a360d43ef17763bc55ac0e45cf4da5347140.tar.gz
PCI: controller: vmd: Use pci_host_resource_survey()HEADmaster
It should be equivalent to the pci_assign_unassigned_bus_resources() call with the policy set to "assign only". It handles the PCIe settings as well. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--drivers/pci/controller/vmd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index 999a5509e57eb..310784a216ea6 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -564,7 +564,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
LIST_HEAD(resources);
resource_size_t offset[2] = {0};
resource_size_t membar2_offset = 0x2000, busn_start = 0;
- struct pci_bus *child;
+ struct pci_host_bridge *host;
/*
* Shadow registers may exist in certain VMD device ids which allow
@@ -688,22 +688,15 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
irq_domain_remove(vmd->irq_domain);
return -ENODEV;
}
+ host = pci_find_host_bridge(vmd->bus);
+ host->rsrc_policy = pci_rsrc_assign_only;
vmd_attach_resources(vmd);
vmd_setup_dma_ops(vmd);
dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain);
pci_scan_child_bus(vmd->bus);
- pci_assign_unassigned_bus_resources(vmd->bus);
-
- /*
- * VMD root buses are virtual and don't return true on pci_is_pcie()
- * and will fail pcie_bus_configure_settings() early. It can instead be
- * run on each of the real root ports.
- */
- list_for_each_entry(child, &vmd->bus->children, node)
- pcie_bus_configure_settings(child);
-
+ pci_host_resource_survey(vmd->bus);
pci_bus_add_devices(vmd->bus);
WARN(sysfs_create_link(&vmd->dev->dev.kobj, &vmd->bus->dev.kobj,