]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Thu, 16 Jan 2020 23:05:16 +0000 (18:05 -0500)
committerSasha Levin <sashal@kernel.org>
Thu, 16 Jan 2020 23:08:17 +0000 (18:08 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/gpio-mpc8xxx-add-platform-device-to-gpiochip-parent.patch [new file with mode: 0644]
queue-4.9/hexagon-parenthesize-registers-in-asm-predicates.patch [new file with mode: 0644]
queue-4.9/hexagon-work-around-compiler-crash.patch [new file with mode: 0644]
queue-4.9/ioat-ioat_alloc_ring-failure-handling.patch [new file with mode: 0644]
queue-4.9/mips-prevent-link-failure-with-kcov-instrumentation.patch [new file with mode: 0644]
queue-4.9/ocfs2-call-journal-flush-to-mark-journal-as-empty-af.patch [new file with mode: 0644]
queue-4.9/rseq-selftests-turn-off-timeout-setting.patch [new file with mode: 0644]
queue-4.9/scsi-libcxgbi-fix-null-pointer-dereference-in-cxgbi_.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/gpio-mpc8xxx-add-platform-device-to-gpiochip-parent.patch b/queue-4.9/gpio-mpc8xxx-add-platform-device-to-gpiochip-parent.patch
new file mode 100644 (file)
index 0000000..ca398e9
--- /dev/null
@@ -0,0 +1,42 @@
+From 716e33f52720d34ea89b0d690398f10b2aeef509 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 26 Nov 2019 06:51:11 +0000
+Subject: gpio: mpc8xxx: Add platform device to gpiochip->parent
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Johnson CH Chen (陳昭勳) <JohnsonCH.Chen@moxa.com>
+
+[ Upstream commit 322f6a3182d42df18059a89c53b09d33919f755e ]
+
+Dear Linus Walleij,
+
+In old kernels, some APIs still try to use parent->of_node from struct gpio_chip,
+and it could be resulted in kernel panic because parent is NULL. Adding platform
+device to gpiochip->parent can fix this problem.
+
+Signed-off-by: Johnson Chen <johnsonch.chen@moxa.com>
+Link: https://patchwork.kernel.org/patch/11234609
+Link: https://lore.kernel.org/r/HK0PR01MB3521489269F76467DFD7843FFA450@HK0PR01MB3521.apcprd01.prod.exchangelabs.com
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpio/gpio-mpc8xxx.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
+index bd777687233b..b67f61d31e25 100644
+--- a/drivers/gpio/gpio-mpc8xxx.c
++++ b/drivers/gpio/gpio-mpc8xxx.c
+@@ -306,6 +306,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
+               return -ENOMEM;
+       gc = &mpc8xxx_gc->gc;
++      gc->parent = &pdev->dev;
+       if (of_property_read_bool(np, "little-endian")) {
+               ret = bgpio_init(gc, &pdev->dev, 4,
+-- 
+2.20.1
+
diff --git a/queue-4.9/hexagon-parenthesize-registers-in-asm-predicates.patch b/queue-4.9/hexagon-parenthesize-registers-in-asm-predicates.patch
new file mode 100644 (file)
index 0000000..9a60cb0
--- /dev/null
@@ -0,0 +1,254 @@
+From 383e07f5ea7359cc28f8848a5dc0168d8b11ca99 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 4 Jan 2020 12:59:59 -0800
+Subject: hexagon: parenthesize registers in asm predicates
+
+From: Nick Desaulniers <ndesaulniers@google.com>
+
+[ Upstream commit 780a0cfda9006a9a22d6473c2d4c527f5c68eb2e ]
+
+Hexagon requires that register predicates in assembly be parenthesized.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/754
+Link: http://lkml.kernel.org/r/20191209222956.239798-3-ndesaulniers@google.com
+Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
+Suggested-by: Sid Manning <sidneym@codeaurora.org>
+Acked-by: Brian Cain <bcain@codeaurora.org>
+Cc: Lee Jones <lee.jones@linaro.org>
+Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Cc: Tuowen Zhao <ztuowen@gmail.com>
+Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
+Cc: Luis Chamberlain <mcgrof@kernel.org>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Alexios Zavras <alexios.zavras@intel.com>
+Cc: Allison Randal <allison@lohutok.net>
+Cc: Will Deacon <will@kernel.org>
+Cc: Richard Fontana <rfontana@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Boqun Feng <boqun.feng@gmail.com>
+Cc: Ingo Molnar <mingo@redhat.com>
+Cc: Geert Uytterhoeven <geert@linux-m68k.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/hexagon/include/asm/atomic.h   |  8 ++++----
+ arch/hexagon/include/asm/bitops.h   |  8 ++++----
+ arch/hexagon/include/asm/cmpxchg.h  |  2 +-
+ arch/hexagon/include/asm/futex.h    |  6 +++---
+ arch/hexagon/include/asm/spinlock.h | 20 ++++++++++----------
+ arch/hexagon/kernel/vm_entry.S      |  2 +-
+ 6 files changed, 23 insertions(+), 23 deletions(-)
+
+diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h
+index a62ba368b27d..1ae06190b68f 100644
+--- a/arch/hexagon/include/asm/atomic.h
++++ b/arch/hexagon/include/asm/atomic.h
+@@ -103,7 +103,7 @@ static inline void atomic_##op(int i, atomic_t *v)                 \
+               "1:     %0 = memw_locked(%1);\n"                        \
+               "       %0 = "#op "(%0,%2);\n"                          \
+               "       memw_locked(%1,P3)=%0;\n"                       \
+-              "       if !P3 jump 1b;\n"                              \
++              "       if (!P3) jump 1b;\n"                            \
+               : "=&r" (output)                                        \
+               : "r" (&v->counter), "r" (i)                            \
+               : "memory", "p3"                                        \
+@@ -119,7 +119,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v)         \
+               "1:     %0 = memw_locked(%1);\n"                        \
+               "       %0 = "#op "(%0,%2);\n"                          \
+               "       memw_locked(%1,P3)=%0;\n"                       \
+-              "       if !P3 jump 1b;\n"                              \
++              "       if (!P3) jump 1b;\n"                            \
+               : "=&r" (output)                                        \
+               : "r" (&v->counter), "r" (i)                            \
+               : "memory", "p3"                                        \
+@@ -136,7 +136,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v)                    \
+               "1:     %0 = memw_locked(%2);\n"                        \
+               "       %1 = "#op "(%0,%3);\n"                          \
+               "       memw_locked(%2,P3)=%1;\n"                       \
+-              "       if !P3 jump 1b;\n"                              \
++              "       if (!P3) jump 1b;\n"                            \
+               : "=&r" (output), "=&r" (val)                           \
+               : "r" (&v->counter), "r" (i)                            \
+               : "memory", "p3"                                        \
+@@ -185,7 +185,7 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u)
+               "       }"
+               "       memw_locked(%2, p3) = %1;"
+               "       {"
+-              "               if !p3 jump 1b;"
++              "               if (!p3) jump 1b;"
+               "       }"
+               "2:"
+               : "=&r" (__oldval), "=&r" (tmp)
+diff --git a/arch/hexagon/include/asm/bitops.h b/arch/hexagon/include/asm/bitops.h
+index 2691a1857d20..634306cda006 100644
+--- a/arch/hexagon/include/asm/bitops.h
++++ b/arch/hexagon/include/asm/bitops.h
+@@ -52,7 +52,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)
+       "1:     R12 = memw_locked(R10);\n"
+       "       { P0 = tstbit(R12,R11); R12 = clrbit(R12,R11); }\n"
+       "       memw_locked(R10,P1) = R12;\n"
+-      "       {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n"
++      "       {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n"
+       : "=&r" (oldval)
+       : "r" (addr), "r" (nr)
+       : "r10", "r11", "r12", "p0", "p1", "memory"
+@@ -76,7 +76,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)
+       "1:     R12 = memw_locked(R10);\n"
+       "       { P0 = tstbit(R12,R11); R12 = setbit(R12,R11); }\n"
+       "       memw_locked(R10,P1) = R12;\n"
+-      "       {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n"
++      "       {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n"
+       : "=&r" (oldval)
+       : "r" (addr), "r" (nr)
+       : "r10", "r11", "r12", "p0", "p1", "memory"
+@@ -102,7 +102,7 @@ static inline int test_and_change_bit(int nr, volatile void *addr)
+       "1:     R12 = memw_locked(R10);\n"
+       "       { P0 = tstbit(R12,R11); R12 = togglebit(R12,R11); }\n"
+       "       memw_locked(R10,P1) = R12;\n"
+-      "       {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n"
++      "       {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n"
+       : "=&r" (oldval)
+       : "r" (addr), "r" (nr)
+       : "r10", "r11", "r12", "p0", "p1", "memory"
+@@ -237,7 +237,7 @@ static inline int ffs(int x)
+       int r;
+       asm("{ P0 = cmp.eq(%1,#0); %0 = ct0(%1);}\n"
+-              "{ if P0 %0 = #0; if !P0 %0 = add(%0,#1);}\n"
++              "{ if (P0) %0 = #0; if (!P0) %0 = add(%0,#1);}\n"
+               : "=&r" (r)
+               : "r" (x)
+               : "p0");
+diff --git a/arch/hexagon/include/asm/cmpxchg.h b/arch/hexagon/include/asm/cmpxchg.h
+index a6e34e2acbba..db258424059f 100644
+--- a/arch/hexagon/include/asm/cmpxchg.h
++++ b/arch/hexagon/include/asm/cmpxchg.h
+@@ -44,7 +44,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
+       __asm__ __volatile__ (
+       "1:     %0 = memw_locked(%1);\n"    /*  load into retval */
+       "       memw_locked(%1,P0) = %2;\n" /*  store into memory */
+-      "       if !P0 jump 1b;\n"
++      "       if (!P0) jump 1b;\n"
+       : "=&r" (retval)
+       : "r" (ptr), "r" (x)
+       : "memory", "p0"
+diff --git a/arch/hexagon/include/asm/futex.h b/arch/hexagon/include/asm/futex.h
+index c607b77c8215..12bd92f3ea41 100644
+--- a/arch/hexagon/include/asm/futex.h
++++ b/arch/hexagon/include/asm/futex.h
+@@ -15,7 +15,7 @@
+           /* For example: %1 = %4 */ \
+           insn \
+       "2: memw_locked(%3,p2) = %1;\n" \
+-      "   if !p2 jump 1b;\n" \
++      "   if (!p2) jump 1b;\n" \
+       "   %1 = #0;\n" \
+       "3:\n" \
+       ".section .fixup,\"ax\"\n" \
+@@ -83,10 +83,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval,
+       "1: %1 = memw_locked(%3)\n"
+       "   {\n"
+       "      p2 = cmp.eq(%1,%4)\n"
+-      "      if !p2.new jump:NT 3f\n"
++      "      if (!p2.new) jump:NT 3f\n"
+       "   }\n"
+       "2: memw_locked(%3,p2) = %5\n"
+-      "   if !p2 jump 1b\n"
++      "   if (!p2) jump 1b\n"
+       "3:\n"
+       ".section .fixup,\"ax\"\n"
+       "4: %0 = #%6\n"
+diff --git a/arch/hexagon/include/asm/spinlock.h b/arch/hexagon/include/asm/spinlock.h
+index a1c55788c5d6..f61bb3185305 100644
+--- a/arch/hexagon/include/asm/spinlock.h
++++ b/arch/hexagon/include/asm/spinlock.h
+@@ -44,9 +44,9 @@ static inline void arch_read_lock(arch_rwlock_t *lock)
+       __asm__ __volatile__(
+               "1:     R6 = memw_locked(%0);\n"
+               "       { P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n"
+-              "       { if !P3 jump 1b; }\n"
++              "       { if (!P3) jump 1b; }\n"
+               "       memw_locked(%0,P3) = R6;\n"
+-              "       { if !P3 jump 1b; }\n"
++              "       { if (!P3) jump 1b; }\n"
+               :
+               : "r" (&lock->lock)
+               : "memory", "r6", "p3"
+@@ -60,7 +60,7 @@ static inline void arch_read_unlock(arch_rwlock_t *lock)
+               "1:     R6 = memw_locked(%0);\n"
+               "       R6 = add(R6,#-1);\n"
+               "       memw_locked(%0,P3) = R6\n"
+-              "       if !P3 jump 1b;\n"
++              "       if (!P3) jump 1b;\n"
+               :
+               : "r" (&lock->lock)
+               : "memory", "r6", "p3"
+@@ -75,7 +75,7 @@ static inline int arch_read_trylock(arch_rwlock_t *lock)
+       __asm__ __volatile__(
+               "       R6 = memw_locked(%1);\n"
+               "       { %0 = #0; P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n"
+-              "       { if !P3 jump 1f; }\n"
++              "       { if (!P3) jump 1f; }\n"
+               "       memw_locked(%1,P3) = R6;\n"
+               "       { %0 = P3 }\n"
+               "1:\n"
+@@ -102,9 +102,9 @@ static inline void arch_write_lock(arch_rwlock_t *lock)
+       __asm__ __volatile__(
+               "1:     R6 = memw_locked(%0)\n"
+               "       { P3 = cmp.eq(R6,#0);  R6 = #-1;}\n"
+-              "       { if !P3 jump 1b; }\n"
++              "       { if (!P3) jump 1b; }\n"
+               "       memw_locked(%0,P3) = R6;\n"
+-              "       { if !P3 jump 1b; }\n"
++              "       { if (!P3) jump 1b; }\n"
+               :
+               : "r" (&lock->lock)
+               : "memory", "r6", "p3"
+@@ -118,7 +118,7 @@ static inline int arch_write_trylock(arch_rwlock_t *lock)
+       __asm__ __volatile__(
+               "       R6 = memw_locked(%1)\n"
+               "       { %0 = #0; P3 = cmp.eq(R6,#0);  R6 = #-1;}\n"
+-              "       { if !P3 jump 1f; }\n"
++              "       { if (!P3) jump 1f; }\n"
+               "       memw_locked(%1,P3) = R6;\n"
+               "       %0 = P3;\n"
+               "1:\n"
+@@ -141,9 +141,9 @@ static inline void arch_spin_lock(arch_spinlock_t *lock)
+       __asm__ __volatile__(
+               "1:     R6 = memw_locked(%0);\n"
+               "       P3 = cmp.eq(R6,#0);\n"
+-              "       { if !P3 jump 1b; R6 = #1; }\n"
++              "       { if (!P3) jump 1b; R6 = #1; }\n"
+               "       memw_locked(%0,P3) = R6;\n"
+-              "       { if !P3 jump 1b; }\n"
++              "       { if (!P3) jump 1b; }\n"
+               :
+               : "r" (&lock->lock)
+               : "memory", "r6", "p3"
+@@ -163,7 +163,7 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock)
+       __asm__ __volatile__(
+               "       R6 = memw_locked(%1);\n"
+               "       P3 = cmp.eq(R6,#0);\n"
+-              "       { if !P3 jump 1f; R6 = #1; %0 = #0; }\n"
++              "       { if (!P3) jump 1f; R6 = #1; %0 = #0; }\n"
+               "       memw_locked(%1,P3) = R6;\n"
+               "       %0 = P3;\n"
+               "1:\n"
+diff --git a/arch/hexagon/kernel/vm_entry.S b/arch/hexagon/kernel/vm_entry.S
+index 67c6ccc14770..9f4a73ff7203 100644
+--- a/arch/hexagon/kernel/vm_entry.S
++++ b/arch/hexagon/kernel/vm_entry.S
+@@ -382,7 +382,7 @@ ret_from_fork:
+               R26.L = #LO(do_work_pending);
+               R0 = #VM_INT_DISABLE;
+       }
+-      if P0 jump check_work_pending
++      if (P0) jump check_work_pending
+       {
+               R0 = R25;
+               callr R24
+-- 
+2.20.1
+
diff --git a/queue-4.9/hexagon-work-around-compiler-crash.patch b/queue-4.9/hexagon-work-around-compiler-crash.patch
new file mode 100644 (file)
index 0000000..bded36c
--- /dev/null
@@ -0,0 +1,52 @@
+From 6cb1b6460a08bd7df0de23211079e3ef462f691e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 4 Jan 2020 13:00:02 -0800
+Subject: hexagon: work around compiler crash
+
+From: Nick Desaulniers <ndesaulniers@google.com>
+
+[ Upstream commit 63e80314ab7cf4783526d2e44ee57a90514911c9 ]
+
+Clang cannot translate the string "r30" into a valid register yet.
+
+Link: https://github.com/ClangBuiltLinux/linux/issues/755
+Link: http://lkml.kernel.org/r/20191028155722.23419-1-ndesaulniers@google.com
+Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
+Suggested-by: Sid Manning <sidneym@quicinc.com>
+Reviewed-by: Brian Cain <bcain@codeaurora.org>
+Cc: Allison Randal <allison@lohutok.net>
+Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Cc: Richard Fontana <rfontana@redhat.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/hexagon/kernel/stacktrace.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/arch/hexagon/kernel/stacktrace.c b/arch/hexagon/kernel/stacktrace.c
+index f94918b449a8..03a0e10ecdcc 100644
+--- a/arch/hexagon/kernel/stacktrace.c
++++ b/arch/hexagon/kernel/stacktrace.c
+@@ -23,8 +23,6 @@
+ #include <linux/thread_info.h>
+ #include <linux/module.h>
+-register unsigned long current_frame_pointer asm("r30");
+-
+ struct stackframe {
+       unsigned long fp;
+       unsigned long rets;
+@@ -42,7 +40,7 @@ void save_stack_trace(struct stack_trace *trace)
+       low = (unsigned long)task_stack_page(current);
+       high = low + THREAD_SIZE;
+-      fp = current_frame_pointer;
++      fp = (unsigned long)__builtin_frame_address(0);
+       while (fp >= low && fp <= (high - sizeof(*frame))) {
+               frame = (struct stackframe *)fp;
+-- 
+2.20.1
+
diff --git a/queue-4.9/ioat-ioat_alloc_ring-failure-handling.patch b/queue-4.9/ioat-ioat_alloc_ring-failure-handling.patch
new file mode 100644 (file)
index 0000000..5145126
--- /dev/null
@@ -0,0 +1,45 @@
+From 45e457f68cdf70c5520ffeebe79c1af15ae08fc0 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 25 Dec 2019 17:55:30 +0000
+Subject: ioat: ioat_alloc_ring() failure handling.
+
+From: Alexander.Barabash@dell.com <Alexander.Barabash@dell.com>
+
+[ Upstream commit b0b5ce1010ffc50015eaec72b0028aaae3f526bb ]
+
+If dma_alloc_coherent() returns NULL in ioat_alloc_ring(), ring
+allocation must not proceed.
+
+Until now, if the first call to dma_alloc_coherent() in
+ioat_alloc_ring() returned NULL, the processing could proceed, failing
+with NULL-pointer dereferencing further down the line.
+
+Signed-off-by: Alexander Barabash <alexander.barabash@dell.com>
+Acked-by: Dave Jiang <dave.jiang@intel.com>
+Link: https://lore.kernel.org/r/75e9c0e84c3345d693c606c64f8b9ab5@x13pwhopdag1307.AMER.DELL.COM
+Signed-off-by: Vinod Koul <vkoul@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/dma/ioat/dma.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
+index 49386ce04bf5..1389f0582e29 100644
+--- a/drivers/dma/ioat/dma.c
++++ b/drivers/dma/ioat/dma.c
+@@ -394,10 +394,11 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags)
+               descs->virt = dma_alloc_coherent(to_dev(ioat_chan),
+                                                SZ_2M, &descs->hw, flags);
+-              if (!descs->virt && (i > 0)) {
++              if (!descs->virt) {
+                       int idx;
+                       for (idx = 0; idx < i; idx++) {
++                              descs = &ioat_chan->descs[idx];
+                               dma_free_coherent(to_dev(ioat_chan), SZ_2M,
+                                                 descs->virt, descs->hw);
+                               descs->virt = NULL;
+-- 
+2.20.1
+
diff --git a/queue-4.9/mips-prevent-link-failure-with-kcov-instrumentation.patch b/queue-4.9/mips-prevent-link-failure-with-kcov-instrumentation.patch
new file mode 100644 (file)
index 0000000..b7f4aec
--- /dev/null
@@ -0,0 +1,39 @@
+From acd93b60191370ce21d66373f86130ad4284dee5 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 9 Dec 2019 14:37:07 +0200
+Subject: MIPS: Prevent link failure with kcov instrumentation
+
+From: Jouni Hogander <jouni.hogander@unikie.com>
+
+[ Upstream commit a4a3893114a41e365274d5fab5d9ff5acc235ff0 ]
+
+__sanitizer_cov_trace_pc() is not linked in and causing link
+failure if KCOV_INSTRUMENT is enabled. Fix this by disabling
+instrumentation for compressed image.
+
+Signed-off-by: Jouni Hogander <jouni.hogander@unikie.com>
+Signed-off-by: Paul Burton <paulburton@kernel.org>
+Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
+Cc: linux-mips@vger.kernel.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/mips/boot/compressed/Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/mips/boot/compressed/Makefile b/arch/mips/boot/compressed/Makefile
+index ad31c76c7a29..2f77e250b91d 100644
+--- a/arch/mips/boot/compressed/Makefile
++++ b/arch/mips/boot/compressed/Makefile
+@@ -29,6 +29,9 @@ KBUILD_AFLAGS := $(LINUXINCLUDE) $(KBUILD_AFLAGS) -D__ASSEMBLY__ \
+       -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \
+       -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS)
++# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
++KCOV_INSTRUMENT               := n
++
+ # decompressor objects (linked with vmlinuz)
+ vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
+-- 
+2.20.1
+
diff --git a/queue-4.9/ocfs2-call-journal-flush-to-mark-journal-as-empty-af.patch b/queue-4.9/ocfs2-call-journal-flush-to-mark-journal-as-empty-af.patch
new file mode 100644 (file)
index 0000000..835b27e
--- /dev/null
@@ -0,0 +1,138 @@
+From 8ab0e1c69b0f3ddd8d0ddb9a011c05ff11a5ac54 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 4 Jan 2020 13:00:18 -0800
+Subject: ocfs2: call journal flush to mark journal as empty after journal
+ recovery when mount
+
+From: Kai Li <li.kai4@h3c.com>
+
+[ Upstream commit 397eac17f86f404f5ba31d8c3e39ec3124b39fd3 ]
+
+If journal is dirty when mount, it will be replayed but jbd2 sb log tail
+cannot be updated to mark a new start because journal->j_flag has
+already been set with JBD2_ABORT first in journal_init_common.
+
+When a new transaction is committed, it will be recored in block 1
+first(journal->j_tail is set to 1 in journal_reset).  If emergency
+restart happens again before journal super block is updated
+unfortunately, the new recorded trans will not be replayed in the next
+mount.
+
+The following steps describe this procedure in detail.
+1. mount and touch some files
+2. these transactions are committed to journal area but not checkpointed
+3. emergency restart
+4. mount again and its journals are replayed
+5. journal super block's first s_start is 1, but its s_seq is not updated
+6. touch a new file and its trans is committed but not checkpointed
+7. emergency restart again
+8. mount and journal is dirty, but trans committed in 6 will not be
+replayed.
+
+This exception happens easily when this lun is used by only one node.
+If it is used by multi-nodes, other node will replay its journal and its
+journal super block will be updated after recovery like what this patch
+does.
+
+ocfs2_recover_node->ocfs2_replay_journal.
+
+The following jbd2 journal can be generated by touching a new file after
+journal is replayed, and seq 15 is the first valid commit, but first seq
+is 13 in journal super block.
+
+logdump:
+  Block 0: Journal Superblock
+  Seq: 0   Type: 4 (JBD2_SUPERBLOCK_V2)
+  Blocksize: 4096   Total Blocks: 32768   First Block: 1
+  First Commit ID: 13   Start Log Blknum: 1
+  Error: 0
+  Feature Compat: 0
+  Feature Incompat: 2 block64
+  Feature RO compat: 0
+  Journal UUID: 4ED3822C54294467A4F8E87D2BA4BC36
+  FS Share Cnt: 1   Dynamic Superblk Blknum: 0
+  Per Txn Block Limit    Journal: 0    Data: 0
+
+  Block 1: Journal Commit Block
+  Seq: 14   Type: 2 (JBD2_COMMIT_BLOCK)
+
+  Block 2: Journal Descriptor
+  Seq: 15   Type: 1 (JBD2_DESCRIPTOR_BLOCK)
+  No. Blocknum        Flags
+   0. 587             none
+  UUID: 00000000000000000000000000000000
+   1. 8257792         JBD2_FLAG_SAME_UUID
+   2. 619             JBD2_FLAG_SAME_UUID
+   3. 24772864        JBD2_FLAG_SAME_UUID
+   4. 8257802         JBD2_FLAG_SAME_UUID
+   5. 513             JBD2_FLAG_SAME_UUID JBD2_FLAG_LAST_TAG
+  ...
+  Block 7: Inode
+  Inode: 8257802   Mode: 0640   Generation: 57157641 (0x3682809)
+  FS Generation: 2839773110 (0xa9437fb6)
+  CRC32: 00000000   ECC: 0000
+  Type: Regular   Attr: 0x0   Flags: Valid
+  Dynamic Features: (0x1) InlineData
+  User: 0 (root)   Group: 0 (root)   Size: 7
+  Links: 1   Clusters: 0
+  ctime: 0x5de5d870 0x11104c61 -- Tue Dec  3 11:37:20.286280801 2019
+  atime: 0x5de5d870 0x113181a1 -- Tue Dec  3 11:37:20.288457121 2019
+  mtime: 0x5de5d870 0x11104c61 -- Tue Dec  3 11:37:20.286280801 2019
+  dtime: 0x0 -- Thu Jan  1 08:00:00 1970
+  ...
+  Block 9: Journal Commit Block
+  Seq: 15   Type: 2 (JBD2_COMMIT_BLOCK)
+
+The following is journal recovery log when recovering the upper jbd2
+journal when mount again.
+
+syslog:
+  ocfs2: File system on device (252,1) was not unmounted cleanly, recovering it.
+  fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 0
+  fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 1
+  fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 2
+  fs/jbd2/recovery.c:(jbd2_journal_recover, 278): JBD2: recovery, exit status 0, recovered transactions 13 to 13
+
+Due to first commit seq 13 recorded in journal super is not consistent
+with the value recorded in block 1(seq is 14), journal recovery will be
+terminated before seq 15 even though it is an unbroken commit, inode
+8257802 is a new file and it will be lost.
+
+Link: http://lkml.kernel.org/r/20191217020140.2197-1-li.kai4@h3c.com
+Signed-off-by: Kai Li <li.kai4@h3c.com>
+Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
+Reviewed-by: Changwei Ge <gechangwei@live.cn>
+Cc: Mark Fasheh <mark@fasheh.com>
+Cc: Joel Becker <jlbec@evilplan.org>
+Cc: Junxiao Bi <junxiao.bi@oracle.com>
+Cc: Gang He <ghe@suse.com>
+Cc: Jun Piao <piaojun@huawei.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ fs/ocfs2/journal.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
+index 13cf69aa4cae..733c05135305 100644
+--- a/fs/ocfs2/journal.c
++++ b/fs/ocfs2/journal.c
+@@ -1080,6 +1080,14 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)
+       ocfs2_clear_journal_error(osb->sb, journal->j_journal, osb->slot_num);
++      if (replayed) {
++              jbd2_journal_lock_updates(journal->j_journal);
++              status = jbd2_journal_flush(journal->j_journal);
++              jbd2_journal_unlock_updates(journal->j_journal);
++              if (status < 0)
++                      mlog_errno(status);
++      }
++
+       status = ocfs2_journal_toggle_dirty(osb, 1, replayed);
+       if (status < 0) {
+               mlog_errno(status);
+-- 
+2.20.1
+
diff --git a/queue-4.9/rseq-selftests-turn-off-timeout-setting.patch b/queue-4.9/rseq-selftests-turn-off-timeout-setting.patch
new file mode 100644 (file)
index 0000000..d3c66ab
--- /dev/null
@@ -0,0 +1,38 @@
+From 2b71ec934c3f74b0b270076e3745bf2662533696 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 11 Dec 2019 11:28:57 -0500
+Subject: rseq/selftests: Turn off timeout setting
+
+From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+
+[ Upstream commit af9cb29c5488381083b0b5ccdfb3cd931063384a ]
+
+As the rseq selftests can run for a long period of time, disable the
+timeout that the general selftests have.
+
+Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+Cc: Shuah Khan <skhan@linuxfoundation.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
+Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
+Cc: Boqun Feng <boqun.feng@gmail.com>
+Cc: "H . Peter Anvin" <hpa@zytor.com>
+Cc: Paul Turner <pjt@google.com>
+Cc: Dmitry Vyukov <dvyukov@google.com>
+Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ tools/testing/selftests/rseq/settings | 1 +
+ 1 file changed, 1 insertion(+)
+ create mode 100644 tools/testing/selftests/rseq/settings
+
+diff --git a/tools/testing/selftests/rseq/settings b/tools/testing/selftests/rseq/settings
+new file mode 100644
+index 000000000000..e7b9417537fb
+--- /dev/null
++++ b/tools/testing/selftests/rseq/settings
+@@ -0,0 +1 @@
++timeout=0
+-- 
+2.20.1
+
diff --git a/queue-4.9/scsi-libcxgbi-fix-null-pointer-dereference-in-cxgbi_.patch b/queue-4.9/scsi-libcxgbi-fix-null-pointer-dereference-in-cxgbi_.patch
new file mode 100644 (file)
index 0000000..55b8861
--- /dev/null
@@ -0,0 +1,38 @@
+From 37d390d91b894b5ef0658edaa2ccdac46f93fba6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 18 Dec 2019 19:15:31 +0530
+Subject: scsi: libcxgbi: fix NULL pointer dereference in
+ cxgbi_device_destroy()
+
+From: Varun Prakash <varun@chelsio.com>
+
+[ Upstream commit 71482fde704efdd8c3abe0faf34d922c61e8d76b ]
+
+If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check
+for NULL pointer before dereferencing it.
+
+Link: https://lore.kernel.org/r/1576676731-3068-1-git-send-email-varun@chelsio.com
+Signed-off-by: Varun Prakash <varun@chelsio.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/cxgbi/libcxgbi.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
+index e974106f2bb5..3d6e653f5147 100644
+--- a/drivers/scsi/cxgbi/libcxgbi.c
++++ b/drivers/scsi/cxgbi/libcxgbi.c
+@@ -121,7 +121,8 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev)
+               "cdev 0x%p, p# %u.\n", cdev, cdev->nports);
+       cxgbi_hbas_remove(cdev);
+       cxgbi_device_portmap_cleanup(cdev);
+-      cxgbi_ppm_release(cdev->cdev2ppm(cdev));
++      if (cdev->cdev2ppm)
++              cxgbi_ppm_release(cdev->cdev2ppm(cdev));
+       if (cdev->pmap.max_connect)
+               cxgbi_free_big_mem(cdev->pmap.port_csk);
+       kfree(cdev);
+-- 
+2.20.1
+
index 303ed63c890932f3718f9d233f9327229a2058cb..e0b7af439f1ed75b615d0b53ba0b2a4fed6012db 100644 (file)
@@ -40,3 +40,11 @@ spi-atmel-fix-handling-of-cs_change-set-on-non-last-xfer.patch
 rtlwifi-remove-unnecessary-null-check-in-rtl_regd_init.patch
 f2fs-fix-potential-overflow.patch
 rtc-msm6242-fix-reading-of-10-hour-digit.patch
+gpio-mpc8xxx-add-platform-device-to-gpiochip-parent.patch
+scsi-libcxgbi-fix-null-pointer-dereference-in-cxgbi_.patch
+rseq-selftests-turn-off-timeout-setting.patch
+mips-prevent-link-failure-with-kcov-instrumentation.patch
+ioat-ioat_alloc_ring-failure-handling.patch
+hexagon-parenthesize-registers-in-asm-predicates.patch
+hexagon-work-around-compiler-crash.patch
+ocfs2-call-journal-flush-to-mark-journal-as-empty-af.patch