diff options
author | Jon Derrick <jonathan.derrick@intel.com> | 2018-12-13 11:23:42 -0500 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2019-01-30 06:00:04 -0500 |
commit | 0294951030eb8e7d808d7f151a2cf0a2ef1afb64 (patch) | |
tree | 70ac5c515267dbe235f17a1e0188a3a3b1d6127a | |
parent | bfeffd155283772bbe78c6a05dec7c0128ee500c (diff) |
PCI/VMD: Configure MPS settings before adding devices
In order to provide the most performance and/or compatible settings,
ensure VMD root buses observe the pcie bus tuning settings by
configuring those settings prior to adding the devices to the pcie tree.
This patch open-codes pci_rescan_bus() and configures the buses prior to
adding devices and attaching drivers.
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
-rw-r--r-- | drivers/pci/controller/vmd.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 3890812cdf87..cf6816b55b5e 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c | |||
@@ -571,6 +571,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) | |||
571 | LIST_HEAD(resources); | 571 | LIST_HEAD(resources); |
572 | resource_size_t offset[2] = {0}; | 572 | resource_size_t offset[2] = {0}; |
573 | resource_size_t membar2_offset = 0x2000, busn_start = 0; | 573 | resource_size_t membar2_offset = 0x2000, busn_start = 0; |
574 | struct pci_bus *child; | ||
574 | 575 | ||
575 | /* | 576 | /* |
576 | * Shadow registers may exist in certain VMD device ids which allow | 577 | * Shadow registers may exist in certain VMD device ids which allow |
@@ -698,7 +699,19 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) | |||
698 | vmd_attach_resources(vmd); | 699 | vmd_attach_resources(vmd); |
699 | vmd_setup_dma_ops(vmd); | 700 | vmd_setup_dma_ops(vmd); |
700 | dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain); | 701 | dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain); |
701 | pci_rescan_bus(vmd->bus); | 702 | |
703 | pci_scan_child_bus(vmd->bus); | ||
704 | pci_assign_unassigned_bus_resources(vmd->bus); | ||
705 | |||
706 | /* | ||
707 | * VMD root buses are virtual and don't return true on pci_is_pcie() | ||
708 | * and will fail pcie_bus_configure_settings() early. It can instead be | ||
709 | * run on each of the real root ports. | ||
710 | */ | ||
711 | list_for_each_entry(child, &vmd->bus->children, node) | ||
712 | pcie_bus_configure_settings(child); | ||
713 | |||
714 | pci_bus_add_devices(vmd->bus); | ||
702 | 715 | ||
703 | WARN(sysfs_create_link(&vmd->dev->dev.kobj, &vmd->bus->dev.kobj, | 716 | WARN(sysfs_create_link(&vmd->dev->dev.kobj, &vmd->bus->dev.kobj, |
704 | "domain"), "Can't create symlink to domain\n"); | 717 | "domain"), "Can't create symlink to domain\n"); |