From: "Munoz Ruiz, Francisco" <francisco.munoz.ruiz@linux.intel.com>
To: helgaas@kernel.org, alex.williamson@redhat.com, myron.stowe@redhat.com
Cc: lorenzo.pieralisi@arm.com, jonathan.derrick@linux.dev,
linux-pci@vger.kernel.org,
Nirmal Patel <nirmal.patel@linux.intel.com>
Subject: Re: [PATCH V3] PCI: vmd: Fix secondary bus reset for Intel bridges
Date: Mon, 28 Nov 2022 15:38:24 -0800 [thread overview]
Message-ID: <ea3fe84c-ec76-86d9-5ec6-22bf73c47756@linux.intel.com> (raw)
In-Reply-To: <20221103201407.3158-1-francisco.munoz.ruiz@linux.intel.com>
On 11/3/2022 1:14 PM, francisco.munoz.ruiz@linux.intel.com wrote:
> From: Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
>
> The reset was never applied in the current implementation because Intel
> Bridges owned by VMD are parentless. Internally, pci_reset_bus() applies
> a reset to the parent of the PCI device supplied as argument, but in this
> case it failed because there wasn't a parent.
>
> In more detail, this change allows the VMD driver to enumerate NVMe devices
> in pass-through configurations when guest reboots are performed. Commit id
> 6aab5622296b ("PCI: vmd: Clean up domain before enumeration") attempted to
> fix this, but later we discovered that the code inside pci_reset_bus() wasn’t
> triggering secondary bus resets. Therefore, we updated the parameters passed
> to it, and now NVMe SSDs attached to VMD bridges are properly enumerated in
> VT-d pass-through scenarios.
>
> Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
> Reviewed-by: Nirmal Patel <nirmal.patel@linux.intel.com>
> Reviewed-by: Jonathan Derrick <jonathan.derrick@linux.dev>
> ---
> V3:
> - Add WARN_ON
> - Include Jonathan as reviewer
> - Update commit message
> V2:
> - Update commit message
>
> drivers/pci/controller/vmd.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> index e06e9f4fc50f..2406be6644f3 100644
> --- a/drivers/pci/controller/vmd.c
> +++ b/drivers/pci/controller/vmd.c
> @@ -859,8 +859,17 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
>
> pci_scan_child_bus(vmd->bus);
> vmd_domain_reset(vmd);
> - list_for_each_entry(child, &vmd->bus->children, node)
> - pci_reset_bus(child->self);
> +
> + list_for_each_entry(child, &vmd->bus->children, node) {
> + if (!list_empty(&child->devices)) {
> + ret = pci_reset_bus(list_first_entry(&child->devices,
> + struct pci_dev,
> + bus_list));
> + WARN_ON(ret);
> + break;
> + }
> + }
> +
> pci_assign_unassigned_bus_resources(vmd->bus);
>
> /*
Hi,
Just a gentle reminder for this one
Best wishes,
Francisco.
next prev parent reply other threads:[~2022-11-28 23:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 20:14 [PATCH V3] PCI: vmd: Fix secondary bus reset for Intel bridges francisco.munoz.ruiz
2022-11-28 23:38 ` Munoz Ruiz, Francisco [this message]
2022-12-05 16:53 ` Lorenzo Pieralisi
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=ea3fe84c-ec76-86d9-5ec6-22bf73c47756@linux.intel.com \
--to=francisco.munoz.ruiz@linux.intel.com \
--cc=alex.williamson@redhat.com \
--cc=helgaas@kernel.org \
--cc=jonathan.derrick@linux.dev \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=myron.stowe@redhat.com \
--cc=nirmal.patel@linux.intel.com \
/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