Thread (103 messages) 103 messages, 7 authors, 2016-05-02

Re: [PATCH v8 32/45] powerpc/pci: Update bridge windows on PCI plug

From: Alexey Kardashevskiy <hidden>
Date: 2016-04-19 08:47:21
Also in: linux-devicetree, linux-pci

On 02/17/2016 02:44 PM, Gavin Shan wrote:
On the PCI plugging event, PCI slot's subordinate devices are
scanned and their (IO and MMIO) resources are assigned. Platform
dependent resources (PE#, IO/MMIO/DMA windows) are allocated or
created on updating windows of the slot's upstream bridge.

This updates the windows of the hot plugged slot's upstream bridge
in pcibios_finish_adding_to_bus() so that the platform resources
(PE#, IO/MMIO/DMA segments) are allocated or created accordingly.

Signed-off-by: Gavin Shan <redacted>

To my very limited knowledge of the common PCI code, looks good.


Reviewed-by: Alexey Kardashevskiy <redacted>



quoted hunk ↗ jump to hunk
---
  arch/powerpc/kernel/pci-common.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 40df3a5..be9e515 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1444,8 +1444,12 @@ void pcibios_finish_adding_to_bus(struct pci_bus *bus)
  	/* Allocate bus and devices resources */
  	pcibios_allocate_bus_resources(bus);
  	pcibios_claim_one_bus(bus);
-	if (!pci_has_flag(PCI_PROBE_ONLY))
-		pci_assign_unassigned_bus_resources(bus);
+	if (!pci_has_flag(PCI_PROBE_ONLY)) {
+		if (bus->self)
+			pci_assign_unassigned_bridge_resources(bus->self);
+		else
+			pci_assign_unassigned_bus_resources(bus);
+	}

  	/* Fixup EEH */
  	eeh_add_device_tree_late(bus);

-- 
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help