Skip to contentSkip to conversation

powerpc: PCI does not require PowerNV

PATCH Applied Jason A. Donenfeld 4 participants 4 messages Jan 15, 2019 – Jan 17, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: PCI does not require PowerNV

Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but did not conditionalize it inside of the PCI pSeries driver. This meant that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted in:

powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function `pSeries_final_fixup':
pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init'

This commit therefore wraps that line in an ifdef, so that PCI works without PowerNV.

Fixes 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
Cc Alexey Kardashevskiy <[email protected]>
Cc Michael Ellerman <[email protected]>
---
 arch/powerpc/platforms/pseries/pci.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/pseries/pci.c +2 -0
index 7725825d887d..37a77e57893e 100644
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void)
 			if (!of_device_is_compatible(nvdn->parent,
 						"ibm,power9-npu"))
 				continue;
+#ifdef CONFIG_PPC_POWERNV
 			WARN_ON_ONCE(pnv_npu2_init(hose));
+#endif
 			break;
 		}
 	}
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jason A. Donenfeld

Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but did not conditionalize it inside of the PCI pSeries driver. This meant that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted in:

powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function `pSeries_final_fixup':
pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init'

Quoted 7 lines

This commit therefore wraps that line in an ifdef, so that PCI works without PowerNV.

Fixes 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
Cc Alexey Kardashevskiy <[email protected]>
Cc Michael Ellerman <[email protected]>
Quoted 19 lines
---
 arch/powerpc/platforms/pseries/pci.c | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/platforms/pseries/pci.c +2 -0
index 7725825d887d..37a77e57893e 100644
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void)
 			if (!of_device_is_compatible(nvdn->parent,
 						"ibm,power9-npu"))
 				continue;
+#ifdef CONFIG_PPC_POWERNV
 			WARN_ON_ONCE(pnv_npu2_init(hose));
+#endif
 			break;
 		}
 	}
Signature · 1 line
Alexey
#2 lore raw
In reply to Jason A. Donenfeld

Hi Jason,

Thanks for the patch.

Quoted 5 lines · Jason A. Donenfeld

Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but did not conditionalize it inside of the PCI pSeries driver. This meant that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted in:

Quoted 8 lines

powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function `pSeries_final_fixup':
pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init'

This commit therefore wraps that line in an ifdef, so that PCI works without PowerNV.

Fixes 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")

I think this should actually be:

Fixes 3be2df00e299 ("powerpc/pseries/npu: Enable platform support")

Because that's the commit that added the call to pnv_npu2_init() in the pseries code. Prior to that it was only called from powernv code.

I'll update the change log to reflect that, unless you disagree.

cheers

Quoted 16 lines
arch/powerpc/platforms/pseries/pci.c +2 -0
index 7725825d887d..37a77e57893e 100644
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void)
 			if (!of_device_is_compatible(nvdn->parent,
 						"ibm,power9-npu"))
 				continue;
+#ifdef CONFIG_PPC_POWERNV
 			WARN_ON_ONCE(pnv_npu2_init(hose));
+#endif
 			break;
 		}
 	}
Signature · 1 line
2.20.1
#3 lore raw
In reply to Jason A. Donenfeld
Quoted 8 lines · Jason A. Donenfeld

Commit 0e759bd75285 moved around the declaration of pnv_npu2_init, but did not conditionalize it inside of the PCI pSeries driver. This meant that CONFIG_PCI && CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV resulted in:

powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function `pSeries_final_fixup':
pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init'

Quoted 8 lines

This commit therefore wraps that line in an ifdef, so that PCI works without PowerNV.

Fixes 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
Cc Alexey Kardashevskiy <[email protected]>
Cc Michael Ellerman <[email protected]>

Applied to powerpc fixes, thanks.

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

cheers