diff mbox series

powerpc/64e: drop stale call to smp_processor_id() which hangs SMP startup

Message ID bef479514f4c08329fa649f67735df8918bc0976.1565268248.git.christophe.leroy@c-s.fr (mailing list archive)
State Accepted
Commit b9ee5e04fd77898208c51b1395fa0b5e8536f9b6
Headers show
Series powerpc/64e: drop stale call to smp_processor_id() which hangs SMP startup | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch next (f3365d1a959d5c6527efe3d38276acc9b58e3f3f)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked

Commit Message

Christophe Leroy Aug. 8, 2019, 12:48 p.m. UTC
Santa commit ebb9d30a6a74 ("powerpc/mm: any thread in one core can be
the first to setup TLB1") removed the need to know the cpu_id in
early_init_this_mmu(), but the call to smp_processor_id() which was
marked __maybe_used remained.

Since commit ed1cd6deb013 ("powerpc: Activate
CONFIG_THREAD_INFO_IN_TASK") thread_info cannot be reached before mmu
is properly set up.

Drop this stale call to smp_processor_id() which make SMP hang
when CONFIG_PREEMPT is set.

Reported-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
Fixes: ebb9d30a6a74 ("powerpc/mm: any thread in one core can be the first to setup TLB1")
Link: https://github.com/linuxppc/issues/issues/264
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: stable@vger.kernel.org
---
 arch/powerpc/mm/nohash/tlb.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Chris Packham Aug. 8, 2019, 9:12 p.m. UTC | #1
Hi Christophe,

On Thu, 2019-08-08 at 12:48 +0000, Christophe Leroy wrote:
> Santa commit ebb9d30a6a74 ("powerpc/mm: any thread in one core can be
> the first to setup TLB1") removed the need to know the cpu_id in
> early_init_this_mmu(), but the call to smp_processor_id() which was
> marked __maybe_used remained.
> 
> Since commit ed1cd6deb013 ("powerpc: Activate
> CONFIG_THREAD_INFO_IN_TASK") thread_info cannot be reached before mmu
> is properly set up.
> 
> Drop this stale call to smp_processor_id() which make SMP hang
> when CONFIG_PREEMPT is set.
> 
> Reported-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
> Fixes: ebb9d30a6a74 ("powerpc/mm: any thread in one core can be the
> first to setup TLB1")
> Link: https://github.com/linuxppc/issues/issues/264
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Cc: stable@vger.kernel.org

Many thanks for your help.

Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

> ---
>  arch/powerpc/mm/nohash/tlb.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/powerpc/mm/nohash/tlb.c
> b/arch/powerpc/mm/nohash/tlb.c
> index d4acf6fa0596..bf60983a58c7 100644
> --- a/arch/powerpc/mm/nohash/tlb.c
> +++ b/arch/powerpc/mm/nohash/tlb.c
> @@ -630,7 +630,6 @@ static void early_init_this_mmu(void)
>  #ifdef CONFIG_PPC_FSL_BOOK3E
>  	if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) {
>  		unsigned int num_cams;
> -		int __maybe_unused cpu = smp_processor_id();
>  		bool map = true;
>  
>  		/* use a quarter of the TLBCAM for bolted linear map
> */
Michael Ellerman Aug. 12, 2019, 1:15 p.m. UTC | #2
On Thu, 2019-08-08 at 12:48:26 UTC, Christophe Leroy wrote:
> Santa commit ebb9d30a6a74 ("powerpc/mm: any thread in one core can be
> the first to setup TLB1") removed the need to know the cpu_id in
> early_init_this_mmu(), but the call to smp_processor_id() which was
> marked __maybe_used remained.
> 
> Since commit ed1cd6deb013 ("powerpc: Activate
> CONFIG_THREAD_INFO_IN_TASK") thread_info cannot be reached before mmu
> is properly set up.
> 
> Drop this stale call to smp_processor_id() which make SMP hang
> when CONFIG_PREEMPT is set.
> 
> Reported-by: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
> Fixes: ebb9d30a6a74 ("powerpc/mm: any thread in one core can be the first to setup TLB1")
> Link: https://github.com/linuxppc/issues/issues/264
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Cc: stable@vger.kernel.org

Applied to powerpc fixes, thanks.

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

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/mm/nohash/tlb.c b/arch/powerpc/mm/nohash/tlb.c
index d4acf6fa0596..bf60983a58c7 100644
--- a/arch/powerpc/mm/nohash/tlb.c
+++ b/arch/powerpc/mm/nohash/tlb.c
@@ -630,7 +630,6 @@  static void early_init_this_mmu(void)
 #ifdef CONFIG_PPC_FSL_BOOK3E
 	if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) {
 		unsigned int num_cams;
-		int __maybe_unused cpu = smp_processor_id();
 		bool map = true;
 
 		/* use a quarter of the TLBCAM for bolted linear map */