From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Jon Derrick <jonathan.derrick@intel.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
Keith Busch <keith.busch@intel.com>
Subject: Re: [PATCH] PCI/VMD: Configure MPS settings before adding devices
Date: Wed, 30 Jan 2019 11:15:17 +0000 [thread overview]
Message-ID: <20190130111453.GA30991@e107981-ln.cambridge.arm.com> (raw)
In-Reply-To: <1544718222-35404-2-git-send-email-jonathan.derrick@intel.com>
On Thu, Dec 13, 2018 at 09:23:42AM -0700, Jon Derrick wrote:
> 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>
> ---
> drivers/pci/controller/vmd.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
Applied to pci/vmd for v5.1, thanks and apologies for the delay.
Lorenzo
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index e50b0b5..818dda8 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -585,6 +585,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;
>
> /*
> * Shadow registers may exist in certain VMD device ids which allow
> @@ -712,7 +713,19 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
> vmd_attach_resources(vmd);
> vmd_setup_dma_ops(vmd);
> dev_set_msi_domain(&vmd->bus->dev, vmd->irq_domain);
> - pci_rescan_bus(vmd->bus);
> +
> + 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_bus_add_devices(vmd->bus);
>
> WARN(sysfs_create_link(&vmd->dev->dev.kobj, &vmd->bus->dev.kobj,
> "domain"), "Can't create symlink to domain\n");
> --
> 1.8.3.1
>
prev parent reply other threads:[~2019-01-30 11:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 16:23 [PATCH] VMD: Configuring bus settings Jon Derrick
2018-12-13 16:23 ` [PATCH] PCI/VMD: Configure MPS settings before adding devices Jon Derrick
2018-12-14 14:44 ` Keith Busch
2019-01-14 17:56 ` Derrick, Jonathan
2019-01-29 23:14 ` Bjorn Helgaas
2019-01-30 11:15 ` Lorenzo Pieralisi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190130111453.GA30991@e107981-ln.cambridge.arm.com \
--to=lorenzo.pieralisi@arm.com \
--cc=helgaas@kernel.org \
--cc=jonathan.derrick@intel.com \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).