From b1c2506a76a02549c9f283ed4cd5dc01068b5ab9 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 12 Feb 2017 01:40:16 +0100 Subject: [PATCH] kernel: MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch This backports the following fix to our mips IRQ stack patches: https://patchwork.linux-mips.org/patch/15110/ Signed-off-by: Hauke Mehrtens --- ...ix-erroneous-jal-to-plat_irq_dispatc.patch | 35 +++++++++++++++++++ ...ix-erroneous-jal-to-plat_irq_dispatc.patch | 35 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch create mode 100644 target/linux/generic/patches-4.9/040-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch diff --git a/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch b/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch new file mode 100644 index 0000000000..26cf5c44d9 --- /dev/null +++ b/target/linux/generic/patches-4.4/062-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch @@ -0,0 +1,35 @@ +From de856416e7143e32afc4849625616554aa060f7a Mon Sep 17 00:00:00 2001 +From: Matt Redfearn +Date: Wed, 25 Jan 2017 17:00:25 +0000 +Subject: [PATCH] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch + +Commit dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +changed both the normal and vectored interrupt handlers. Unfortunately +the vectored version, "except_vec_vi_handler", was incorrectly modified +to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to +the vectored handler that has been set up. This is ok for many platforms +which set the vectored handler to plat_irq_dispatch anyway, but will +cause problems with platforms that use other handlers. + +Fixes: dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +Signed-off-by: Matt Redfearn +Cc: Ralf Baechle +Cc: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/15110/ +Signed-off-by: James Hogan +--- + arch/mips/kernel/genex.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/kernel/genex.S ++++ b/arch/mips/kernel/genex.S +@@ -330,7 +330,7 @@ NESTED(except_vec_vi_handler, 0, sp) + PTR_ADD sp, t0, t1 + + 2: +- jal plat_irq_dispatch ++ jalr v0 + + /* Restore sp */ + move sp, s1 diff --git a/target/linux/generic/patches-4.9/040-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch b/target/linux/generic/patches-4.9/040-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch new file mode 100644 index 0000000000..bb16bb14ab --- /dev/null +++ b/target/linux/generic/patches-4.9/040-06-MIPS-IRQ-Stack-Fix-erroneous-jal-to-plat_irq_dispatc.patch @@ -0,0 +1,35 @@ +From de856416e7143e32afc4849625616554aa060f7a Mon Sep 17 00:00:00 2001 +From: Matt Redfearn +Date: Wed, 25 Jan 2017 17:00:25 +0000 +Subject: [PATCH] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch + +Commit dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +changed both the normal and vectored interrupt handlers. Unfortunately +the vectored version, "except_vec_vi_handler", was incorrectly modified +to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to +the vectored handler that has been set up. This is ok for many platforms +which set the vectored handler to plat_irq_dispatch anyway, but will +cause problems with platforms that use other handlers. + +Fixes: dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts") +Signed-off-by: Matt Redfearn +Cc: Ralf Baechle +Cc: Paul Burton +Cc: linux-mips@linux-mips.org +Patchwork: https://patchwork.linux-mips.org/patch/15110/ +Signed-off-by: James Hogan +--- + arch/mips/kernel/genex.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/kernel/genex.S ++++ b/arch/mips/kernel/genex.S +@@ -329,7 +329,7 @@ NESTED(except_vec_vi_handler, 0, sp) + PTR_ADD sp, t0, t1 + + 2: +- jal plat_irq_dispatch ++ jalr v0 + + /* Restore sp */ + move sp, s1 -- 2.30.2