提交 e082e99f 编写于 作者: P Pali Rohár 提交者: Michael Ellerman

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.
Signed-off-by: NPali Rohár <pali@kernel.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220820123327.20551-1-pali@kernel.org
上级 67bbb62f
...@@ -1138,6 +1138,19 @@ void __init fsl_pci_assign_primary(void) ...@@ -1138,6 +1138,19 @@ void __init fsl_pci_assign_primary(void)
return; 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 * If there's no PCI host bridge with ISA, arbitrarily
* designate one as primary. This can go away once * designate one as primary. This can go away once
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册