Skip to contentSkip to conversation

powerpc/fsl-pci: Choose PCI host bridge with alias pci0 as the primary

PATCH Applied Pali Rohár 2 participants 5 messages Aug 20, 2022 – Dec 8, 2022 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/fsl-pci: Choose PCI host bridge with alias pci0 as the primary

If there's no PCI host bridge with ISA then check for PCI host bridge with alias "pci0" (first PCI host bridge) and if it exists then choose it as the primary PCI host bridge.

This makes choice of primary PCI host bridge more stable across boots and updates as the last fallback candidate for primary PCI host bridge (if there is no choice) is selected arbitrary.

---
 arch/powerpc/sysdev/fsl_pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/powerpc/sysdev/fsl_pci.c +13 -0
index 1011cfea2e32..e4b703943dd3 100644
@@ -1125,6 +1125,19 @@ void __init fsl_pci_assign_primary(void)
 			return;
 	}
 
+	/*
+	 * If there's no PCI host bridge with ISA then check for
+	 * PCI host bridge with alias "pci0" (first PCI host bridge).
+	 */
+	np = of_find_node_by_path("pci0");
+	if (np && of_match_node(pci_ids, np) && of_device_is_available(np)) {
+		fsl_pci_primary = np;
+		of_node_put(np);
+		return;
+	}
+	if (np)
+		of_node_put(np);
+
 	/*
 	 * If there's no PCI host bridge with ISA, arbitrarily
 	 * designate one as primary.  This can go away once
Signature · 1 line
2.20.1
#1 lore raw

Hello! Any opinion on this patch?

Quoted 40 lines · On Saturday 20 August 2022 14:33:27 Pali Rohár wrote:

If there's no PCI host bridge with ISA then check for PCI host bridge with alias "pci0" (first PCI host bridge) and if it exists then choose it as the primary PCI host bridge.

This makes choice of primary PCI host bridge more stable across boots and updates as the last fallback candidate for primary PCI host bridge (if there is no choice) is selected arbitrary.

---
 arch/powerpc/sysdev/fsl_pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/powerpc/sysdev/fsl_pci.c +13 -0
index 1011cfea2e32..e4b703943dd3 100644
@@ -1125,6 +1125,19 @@ void __init fsl_pci_assign_primary(void)
 			return;
 	}
 
+	/*
+	 * If there's no PCI host bridge with ISA then check for
+	 * PCI host bridge with alias "pci0" (first PCI host bridge).
+	 */
+	np = of_find_node_by_path("pci0");
+	if (np && of_match_node(pci_ids, np) && of_device_is_available(np)) {
+		fsl_pci_primary = np;
+		of_node_put(np);
+		return;
+	}
+	if (np)
+		of_node_put(np);
+
 	/*
 	 * If there's no PCI host bridge with ISA, arbitrarily
 	 * designate one as primary.  This can go away once
Signature · 1 line
2.20.1
#2 lore raw

Hello! I would like to remind this patch.

Quoted 43 lines · On Sunday 09 October 2022 13:08:08 Pali Rohár wrote:

Hello! Any opinion on this patch?

Quoted 40 lines · On Saturday 20 August 2022 14:33:27 Pali Rohár wrote:

If there's no PCI host bridge with ISA then check for PCI host bridge with alias "pci0" (first PCI host bridge) and if it exists then choose it as the primary PCI host bridge.

This makes choice of primary PCI host bridge more stable across boots and updates as the last fallback candidate for primary PCI host bridge (if there is no choice) is selected arbitrary.

---
 arch/powerpc/sysdev/fsl_pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/powerpc/sysdev/fsl_pci.c +13 -0
index 1011cfea2e32..e4b703943dd3 100644
@@ -1125,6 +1125,19 @@ void __init fsl_pci_assign_primary(void)
 			return;
 	}
 
+	/*
+	 * If there's no PCI host bridge with ISA then check for
+	 * PCI host bridge with alias "pci0" (first PCI host bridge).
+	 */
+	np = of_find_node_by_path("pci0");
+	if (np && of_match_node(pci_ids, np) && of_device_is_available(np)) {
+		fsl_pci_primary = np;
+		of_node_put(np);
+		return;
+	}
+	if (np)
+		of_node_put(np);
+
 	/*
 	 * If there's no PCI host bridge with ISA, arbitrarily
 	 * designate one as primary.  This can go away once
Signature · 1 line
2.20.1
#3 lore raw

PING?

Quoted 46 lines · On Tuesday 01 November 2022 23:19:09 Pali Rohár wrote:

Hello! I would like to remind this patch.

Quoted 43 lines · On Sunday 09 October 2022 13:08:08 Pali Rohár wrote:

Hello! Any opinion on this patch?

Quoted 40 lines · On Saturday 20 August 2022 14:33:27 Pali Rohár wrote:

If there's no PCI host bridge with ISA then check for PCI host bridge with alias "pci0" (first PCI host bridge) and if it exists then choose it as the primary PCI host bridge.

This makes choice of primary PCI host bridge more stable across boots and updates as the last fallback candidate for primary PCI host bridge (if there is no choice) is selected arbitrary.

---
 arch/powerpc/sysdev/fsl_pci.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/powerpc/sysdev/fsl_pci.c +13 -0
index 1011cfea2e32..e4b703943dd3 100644
@@ -1125,6 +1125,19 @@ void __init fsl_pci_assign_primary(void)
 			return;
 	}
 
+	/*
+	 * If there's no PCI host bridge with ISA then check for
+	 * PCI host bridge with alias "pci0" (first PCI host bridge).
+	 */
+	np = of_find_node_by_path("pci0");
+	if (np && of_match_node(pci_ids, np) && of_device_is_available(np)) {
+		fsl_pci_primary = np;
+		of_node_put(np);
+		return;
+	}
+	if (np)
+		of_node_put(np);
+
 	/*
 	 * If there's no PCI host bridge with ISA, arbitrarily
 	 * designate one as primary.  This can go away once
Signature · 1 line
2.20.1
#4 lore raw
In reply to Pali Rohár
Quoted 9 lines · Pali Rohár

If there's no PCI host bridge with ISA then check for PCI host bridge with alias "pci0" (first PCI host bridge) and if it exists then choose it as the primary PCI host bridge.

This makes choice of primary PCI host bridge more stable across boots and updates as the last fallback candidate for primary PCI host bridge (if there is no choice) is selected arbitrary.

[...]

Applied to powerpc/next.

[1/1] powerpc/fsl-pci: Choose PCI host bridge with alias pci0 as the primary

      https://git.kernel.org/powerpc/c/e082e99f6f87f5204b2531d5a3db7bbd929d23b1

cheers