Skip to content

Commit 0c83b27

Browse files
committed
powerpc: Fix circular dependency between percpu.h and mmu.h
Recently random.h started including percpu.h (see commit f227e3e ("random32: update the net random state on interrupt and activity")), which broke corenet64_smp_defconfig: In file included from /linux/arch/powerpc/include/asm/paca.h:18, from /linux/arch/powerpc/include/asm/percpu.h:13, from /linux/include/linux/random.h:14, from /linux/lib/uuid.c:14: /linux/arch/powerpc/include/asm/mmu.h:139:22: error: unknown type name 'next_tlbcam_idx' 139 | DECLARE_PER_CPU(int, next_tlbcam_idx); This is due to a circular header dependency: asm/mmu.h includes asm/percpu.h, which includes asm/paca.h, which includes asm/mmu.h Which means DECLARE_PER_CPU() isn't defined when mmu.h needs it. We can fix it by moving the include of paca.h below the include of asm-generic/percpu.h. This moves the include of paca.h out of the #ifdef __powerpc64__, but that is OK because paca.h is almost entirely inside #ifdef CONFIG_PPC64 anyway. It also moves the include of paca.h out of the #ifdef CONFIG_SMP, which could possibly break something, but seems to have no ill effects. Fixes: f227e3e ("random32: update the net random state on interrupt and activity") Cc: [email protected] # v5.8 Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2075ec9 commit 0c83b27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/powerpc/include/asm/percpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
#ifdef CONFIG_SMP
1212

13-
#include <asm/paca.h>
14-
1513
#define __my_cpu_offset local_paca->data_offset
1614

1715
#endif /* CONFIG_SMP */
1816
#endif /* __powerpc64__ */
1917

2018
#include <asm-generic/percpu.h>
2119

20+
#include <asm/paca.h>
21+
2222
#endif /* _ASM_POWERPC_PERCPU_H_ */

0 commit comments

Comments
 (0)