linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: PCI does not require PowerNV
@ 2019-01-15  0:47 Jason A. Donenfeld
  2019-01-15  4:43 ` Alexey Kardashevskiy
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2019-01-15  0:47 UTC (permalink / raw)
  To: benh, paulus, mpe, aik, linuxppc-dev, linux-kernel; +Cc: 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'

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

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Fixes: 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/platforms/pseries/pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 7725825d887d..37a77e57893e 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -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;
 		}
 	}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: PCI does not require PowerNV
  2019-01-15  0:47 [PATCH] powerpc: PCI does not require PowerNV Jason A. Donenfeld
@ 2019-01-15  4:43 ` Alexey Kardashevskiy
  2019-01-15 10:31 ` Michael Ellerman
  2019-01-17  0:27 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2019-01-15  4:43 UTC (permalink / raw)
  To: Jason A. Donenfeld, benh, paulus, mpe, linuxppc-dev, linux-kernel



On 15/01/2019 11:47, Jason A. Donenfeld wrote:
> 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.
> 
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Fixes: 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Cc: Michael Ellerman <mpe@ellerman.id.au>



Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>



> ---
>  arch/powerpc/platforms/pseries/pci.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
> index 7725825d887d..37a77e57893e 100644
> --- a/arch/powerpc/platforms/pseries/pci.c
> +++ b/arch/powerpc/platforms/pseries/pci.c
> @@ -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;
>  		}
>  	}
> 

-- 
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: PCI does not require PowerNV
  2019-01-15  0:47 [PATCH] powerpc: PCI does not require PowerNV Jason A. Donenfeld
  2019-01-15  4:43 ` Alexey Kardashevskiy
@ 2019-01-15 10:31 ` Michael Ellerman
  2019-01-17  0:27 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2019-01-15 10:31 UTC (permalink / raw)
  To: Jason A. Donenfeld, benh, paulus, aik, linuxppc-dev, linux-kernel
  Cc: Jason A. Donenfeld

Hi Jason,

Thanks for the patch.

"Jason A. Donenfeld" <Jason@zx2c4.com> writes:
> 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.
>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> 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

> diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
> index 7725825d887d..37a77e57893e 100644
> --- a/arch/powerpc/platforms/pseries/pci.c
> +++ b/arch/powerpc/platforms/pseries/pci.c
> @@ -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;
>  		}
>  	}
> -- 
> 2.20.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: powerpc: PCI does not require PowerNV
  2019-01-15  0:47 [PATCH] powerpc: PCI does not require PowerNV Jason A. Donenfeld
  2019-01-15  4:43 ` Alexey Kardashevskiy
  2019-01-15 10:31 ` Michael Ellerman
@ 2019-01-17  0:27 ` Michael Ellerman
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2019-01-17  0:27 UTC (permalink / raw)
  To: Jason A. Donenfeld, benh, paulus, aik, linuxppc-dev, linux-kernel
  Cc: Jason A. Donenfeld

On Tue, 2019-01-15 at 00:47:45 UTC, "Jason A. Donenfeld" wrote:
> 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.
> 
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> Fixes: 0e759bd75285 ("powerpc/powernv/npu: Move OPAL calls away from context manipulation")
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-17  0:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-15  0:47 [PATCH] powerpc: PCI does not require PowerNV Jason A. Donenfeld
2019-01-15  4:43 ` Alexey Kardashevskiy
2019-01-15 10:31 ` Michael Ellerman
2019-01-17  0:27 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).