[PATCH v0 12/13] PCI: Keep searching upstream for enclosing bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When reassigning a device's BARs, look for an enumeration profile in all
upstream buses, not just the immediate upstream bus.

Signed-off-by: Jason Tang <jason.tang2@xxxxxxx>
---
 drivers/pci/pci_static_enum.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pci_static_enum.c b/drivers/pci/pci_static_enum.c
index 50f4db4..14626cd 100644
--- a/drivers/pci/pci_static_enum.c
+++ b/drivers/pci/pci_static_enum.c
@@ -542,11 +542,14 @@ void pci_static_enum_device(struct pci_dev *dev)
 	 */
 	parent = pci_upstream_bridge(dev);
 
-	if (parent) {
+	while (parent) {
 		setting = pci_static_enum_find_setting(pci_domain_nr(dev->bus),
 						       parent->bus->number,
 						       parent->devfn);
-		if (setting)
+		if (setting) {
 			pci_static_enum_set_mmio_bars(dev, setting);
+			break;
+		}
+		parent = pci_upstream_bridge(parent);
 	}
 }
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux