From ffe6f74246658233f132e530e2d73a23aafd0be1 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 Aug 2020 13:51:50 +0200 Subject: [PATCH] 4.4-stable patches added patches: powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch --- ...ependency-between-percpu.h-and-mmu.h.patch | 66 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 67 insertions(+) create mode 100644 queue-4.4/powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch diff --git a/queue-4.4/powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch b/queue-4.4/powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch new file mode 100644 index 00000000000..2c260bcdcb2 --- /dev/null +++ b/queue-4.4/powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch @@ -0,0 +1,66 @@ +From 0c83b277ada72b585e6a3e52b067669df15bcedb Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Tue, 4 Aug 2020 22:44:06 +1000 +Subject: powerpc: Fix circular dependency between percpu.h and mmu.h + +From: Michael Ellerman + +commit 0c83b277ada72b585e6a3e52b067669df15bcedb upstream. + +Recently random.h started including percpu.h (see commit +f227e3ec3b5c ("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: f227e3ec3b5c ("random32: update the net random state on interrupt and activity") +Cc: stable@vger.kernel.org # v5.8 +Reported-by: Stephen Rothwell +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200804130558.292328-1-mpe@ellerman.id.au +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/include/asm/percpu.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/include/asm/percpu.h ++++ b/arch/powerpc/include/asm/percpu.h +@@ -9,8 +9,6 @@ + + #ifdef CONFIG_SMP + +-#include +- + #define __my_cpu_offset local_paca->data_offset + + #endif /* CONFIG_SMP */ +@@ -18,4 +16,6 @@ + + #include + ++#include ++ + #endif /* _ASM_POWERPC_PERCPU_H_ */ diff --git a/queue-4.4/series b/queue-4.4/series index ddaa52c0797..10f54003e24 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -120,3 +120,4 @@ xen-balloon-make-the-balloon-wait-interruptible.patch pci-hotplug-acpi-fix-context-refcounting-in-acpiphp_grab_context.patch btrfs-only-search-for-left_info-if-there-is-no-right_info-in-try_merge_free_space.patch btrfs-fix-memory-leaks-after-failure-to-lookup-checksums-during-inode-logging.patch +powerpc-fix-circular-dependency-between-percpu.h-and-mmu.h.patch -- 2.47.3