All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI: vmd: Fix secondary bus reset for Intel bridges
@ 2022-09-23 20:37 francisco.munoz.ruiz
  2022-09-26 21:07 ` Jonathan Derrick
  2022-10-24 20:45 ` Bjorn Helgaas
  0 siblings, 2 replies; 9+ messages in thread
From: francisco.munoz.ruiz @ 2022-09-23 20:37 UTC (permalink / raw)
  To: helgaas, lorenzo.pieralisi
  Cc: jonathan.derrick, linux-pci, Francisco Munoz, Nirmal Patel

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, the reset API 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. This change feeds a child
device of an Intel Bridge to the reset API and internally the reset is
applied to its parent.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@linux.intel.com>
Reviewed-by: Nirmal Patel <nirmal.patel@linux.intel.com>
---
 drivers/pci/controller/vmd.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index e06e9f4fc50f..34d6ba675440 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -859,8 +859,16 @@ 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)) {
+			pci_reset_bus(list_first_entry(&child->devices,
+						       struct pci_dev,
+						       bus_list));
+			break;
+		}
+	}
+
 	pci_assign_unassigned_bus_resources(vmd->bus);
 
 	/*
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-03 17:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 20:37 [PATCH] PCI: vmd: Fix secondary bus reset for Intel bridges francisco.munoz.ruiz
2022-09-26 21:07 ` Jonathan Derrick
2022-10-06 18:26   ` Munoz Ruiz, Francisco
2022-10-06 19:21     ` Bjorn Helgaas
2022-10-24 20:45 ` Bjorn Helgaas
2022-10-31 21:45   ` [PATCH V2] " francisco.munoz.ruiz
2022-11-02 23:42     ` Bjorn Helgaas
2022-11-03  3:58       ` Munoz Ruiz, Francisco
2022-11-03 17:15       ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.