Skip to contentSkip to conversation

PCI: X-Gene: assign resource to bus before adding new devices

PATCH In review Duc Dang 2 participants 2 messages Nov 7, 2014 – Nov 13, 2014 PCI

lore
Share & tools
lore

Duc Dang

author
#0 lore raw

PATCH 1/1 PCI: X-Gene: assign resource to bus before adding new devices

X-Gene PCIE driver currently depends on Liviu Dudau's patch
https://lkml.org/lkml/2014/9/30/166 in order to assign resource to root bus and endpoint devices. The patch was dropped because it will break x86, powerpc and probably others. So X-Gene PCIE host functionality is currently broken.

This patch adds function calls to create and scan root_bus as well as assign unassigned bus resource (similar to Liviu Dudau's patch above). This will help resolve the dependency to Liviu Dudau's patch and make X-Gene PCIE work in latest open-source kernel.

---
 drivers/pci/host/pci-xgene.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pci/host/pci-xgene.c +6 -1
index 9ecabfa..2988fe1 100644
@@ -631,10 +631,15 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	bus = pci_scan_root_bus(&pdev->dev, 0, &xgene_pcie_ops, port, &res);
+	bus = pci_create_root_bus(&pdev->dev, 0,
+					&xgene_pcie_ops, port, &res);
 	if (!bus)
 		return -ENOMEM;
 
+	pci_scan_child_bus(bus);
+	pci_assign_unassigned_bus_resources(bus);
+	pci_bus_add_devices(bus);
+
 	platform_set_drvdata(pdev, port);
 	return 0;
 }
Signature · 1 line
1.8.2.1
maintainer
#1 lore raw
Quoted 6 lines · Duc Dang

X-Gene PCIE driver currently depends on Liviu Dudau's patch
https://lkml.org/lkml/2014/9/30/166 in order to assign resource to root bus and endpoint devices. The patch was dropped because it will break x86, powerpc and probably others. So X-Gene PCIE host functionality is currently broken.

Quoted 7 lines

This patch adds function calls to create and scan root_bus as well as assign unassigned bus resource (similar to Liviu Dudau's patch above). This will help resolve the dependency to Liviu Dudau's patch and make X-Gene PCIE work in latest open-source kernel.

I applied this to for-linus for v3.18, because it fixes a driver we added in the v3.18 merge window. Thanks!

Quoted 28 lines
---
 drivers/pci/host/pci-xgene.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pci/host/pci-xgene.c +6 -1
index 9ecabfa..2988fe1 100644
@@ -631,10 +631,15 @@ static int xgene_pcie_probe_bridge(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	bus = pci_scan_root_bus(&pdev->dev, 0, &xgene_pcie_ops, port, &res);
+	bus = pci_create_root_bus(&pdev->dev, 0,
+					&xgene_pcie_ops, port, &res);
 	if (!bus)
 		return -ENOMEM;
 
+	pci_scan_child_bus(bus);
+	pci_assign_unassigned_bus_resources(bus);
+	pci_bus_add_devices(bus);
+
 	platform_set_drvdata(pdev, port);
 	return 0;
 }
Signature · 1 line
1.8.2.1