powerpc: fix up PPC_FSL_BOOK3E build
PATCH 1/1 powerpc: fix up PPC_FSL_BOOK3E build
Commit
1c9df907da83 ("random: fix circular include dependency on arm64 after addition of percpu.h")
exposed a curcular include dependency:
asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which includes asm/mmu.h
So fix it by extracting the small part of asm/mmu.h that needs asm/percu.h into a new file and including that where necessary.
---
I have done powerpc test builds of allmodconfig, ppc64e_defconfig and corenet64_smp_defconfig.
arch/powerpc/include/asm/mmu.h | 5 ----- arch/powerpc/include/asm/mmu_fsl_e.h | 10 ++++++++++ arch/powerpc/kernel/smp.c | 1 + arch/powerpc/mm/mem.c | 1 + arch/powerpc/mm/nohash/book3e_hugetlbpage.c | 1 + arch/powerpc/mm/nohash/tlb.c | 1 + 6 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 arch/powerpc/include/asm/mmu_fsl_e.h
arch/powerpc/include/asm/mmu.h +0 -5
@@ -134,11 +134,6 @@typedef pte_t *pgtable_t ; -#ifdef CONFIG_PPC_FSL_BOOK3E -#include <asm/percpu.h> -DECLARE_PER_CPU (int, next_tlbcam_idx); -#endif -enum {MMU_FTRS_POSSIBLE = #ifdef CONFIG_PPC_BOOK3S
arch/powerpc/include/asm/mmu_fsl_e.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_POWERPC_MMU_FSL_E_H_ +#define _ASM_POWERPC_MMU_FSL_E_H_ + +#ifdef CONFIG_PPC_FSL_BOOK3E +#include <asm/percpu.h> +DECLARE_PER_CPU (int, next_tlbcam_idx); +#endif + +#endif
arch/powerpc/kernel/smp.c +1 -0
@@ -35,6 +35,7 @@#include <linux/stackprotector.h> #include <linux/pgtable.h> +#include <asm/mmu_fsl_e.h> #include <asm/ptrace.h> #include <linux/atomic.h> #include <asm/irq.h>
arch/powerpc/mm/mem.c +1 -0
@@ -37,6 +37,7 @@#include <asm/pgalloc.h> #include <asm/prom.h> #include <asm/io.h> +#include <asm/mmu_fsl_e.h> #include <asm/mmu_context.h> #include <asm/mmu.h> #include <asm/smp.h>
arch/powerpc/mm/nohash/book3e_hugetlbpage.c +1 -0
@@ -9,6 +9,7 @@#include <linux/mm.h> #include <linux/hugetlb.h> +#include <asm/mmu_fsl_e.h> #include <asm/mmu.h> #ifdef CONFIG_PPC64
arch/powerpc/mm/nohash/tlb.c +1 -0
@@ -171,6 +171,7 @@ int extlb_level_exc;#endif /* CONFIG_PPC64 */ #ifdef CONFIG_PPC_FSL_BOOK3E +#include <asm/mmu_fsl_e.h> /* next_tlbcam_idx is used to round-robin tlbcam entry assignment */ DEFINE_PER_CPU (int, next_tlbcam_idx);EXPORT_PER_CPU_SYMBOL (next_tlbcam_idx);
Signature · 5 lines
2.28.0 -- Cheers, Stephen Rothwell
Hi all,
Quoted 10 lines · On Mon, 3 Aug 2020 13:54:47 +1000 Stephen Rothwell <[email protected]> wrote:
Commit
1c9df907da83("random: fix circular include dependency on arm64 after addition ofpercpu.h")exposed a curcular include dependency:
asm/mmu.hincludesasm/percpu.h, which includesasm/paca.h, which includesasm/mmu.h
Quoted 6 lines
So fix it by extracting the small part of
asm/mmu.hthat needsasm/percu.hinto a new file and including that where necessary.Cc Willy Tarreau <[email protected]>Cc <[email protected]>Signed-off-by Stephen Rothwell <[email protected]>
I should have put:
Signature · 2 lines
Cheers, Stephen Rothwell