Skip to content

Commit

Permalink
PCI: xgene: Assign resources to bus before adding new devices
Browse files Browse the repository at this point in the history
The X-Gene PCIe driver assumes pci_scan_root_bus() assigns resources as
proposed in [1].  But we dropped patch [1] because it would break some
architectures, which means the X-Gene PCIe driver is currently broken.

Add calls to scan the bus, assign resources, and add devices in the X-Gene
driver to fix this.

[bhelgaas: changelog]
[1] http://lkml.kernel.org/r/1412000971-9242-11-git-send-email-Liviu.Dudau@arm.com
Signed-off-by: Duc Dang <dhdang@apm.com>
Signed-off-by: Tanmay Inamdar <tinamdar@apm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Duc Dang authored and Bjorn Helgaas committed Nov 13, 2014
1 parent 32f638f commit 336b5be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/pci/host/pci-xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 336b5be

Please sign in to comment.