From f791fb4af45032a653ba7c850f4564923871cb16 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 27 Jan 2017 14:32:10 +0100 Subject: kernel: add linux 4.9 support Signed-off-by: Felix Fietkau Signed-off-by: Tim Harvey [fixes] --- ...2-MIPS-Stack-unwinding-while-on-IRQ-stack.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 target/linux/generic/patches-4.9/040-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch (limited to 'target/linux/generic/patches-4.9/040-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch') diff --git a/target/linux/generic/patches-4.9/040-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch b/target/linux/generic/patches-4.9/040-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch new file mode 100644 index 0000000000..3f078c434c --- /dev/null +++ b/target/linux/generic/patches-4.9/040-02-MIPS-Stack-unwinding-while-on-IRQ-stack.patch @@ -0,0 +1,42 @@ +From: Matt Redfearn +Date: Mon, 19 Dec 2016 14:20:57 +0000 +Subject: [PATCH] MIPS: Stack unwinding while on IRQ stack + +Within unwind stack, check if the stack pointer being unwound is within +the CPU's irq_stack and if so use that page rather than the task's stack +page. + +Signed-off-by: Matt Redfearn +--- + +--- a/arch/mips/kernel/process.c ++++ b/arch/mips/kernel/process.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -511,7 +512,19 @@ EXPORT_SYMBOL(unwind_stack_by_address); + unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, + unsigned long pc, unsigned long *ra) + { +- unsigned long stack_page = (unsigned long)task_stack_page(task); ++ unsigned long stack_page = 0; ++ int cpu; ++ ++ for_each_possible_cpu(cpu) { ++ if (on_irq_stack(cpu, *sp)) { ++ stack_page = (unsigned long)irq_stack[cpu]; ++ break; ++ } ++ } ++ ++ if (!stack_page) ++ stack_page = (unsigned long)task_stack_page(task); ++ + return unwind_stack_by_address(stack_page, sp, pc, ra); + } + #endif -- cgit v1.2.3