From patchwork Thu Apr 6 13:52:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96985 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp740917obc; Thu, 6 Apr 2017 06:52:46 -0700 (PDT) X-Received: by 10.84.168.69 with SMTP id e63mr43509397plb.124.1491486766380; Thu, 06 Apr 2017 06:52:46 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si1933861plk.173.2017.04.06.06.52.46; Thu, 06 Apr 2017 06:52:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934838AbdDFNwk (ORCPT + 6 others); Thu, 6 Apr 2017 09:52:40 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:35324 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934806AbdDFNwa (ORCPT ); Thu, 6 Apr 2017 09:52:30 -0400 Received: by mail-pg0-f47.google.com with SMTP id 81so37118165pgh.2 for ; Thu, 06 Apr 2017 06:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6yT+JYRa9QZ7UM+rLY8vnkaCFnyuMqFyDqEHLZkTyXE=; b=Bfn6Skq6rxSeTj2hAkZ1SHqwRiZYMfJv/EZzgmyIBgk/hHz16w5aCvhy4lUFPvoI8N BcIxZ7yol6WqiyQsJJLvEQ/KOcRfLs9MSThu8+BRdW9o5VX3G01xjdxEvH3In+rryWBa BUyfHTpeoBzv9GMxUiVfXaogGlZfxKavA5g+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6yT+JYRa9QZ7UM+rLY8vnkaCFnyuMqFyDqEHLZkTyXE=; b=BxcUa6sneuq+yKV/S3PRVAF+qEUVQhJRKhAr7JZvrdqu6IiRhxfWBpM6mM/OJFUhFe DY5ogML1k9XyGyNlZUR1vg7Z+dVqLXQ8dAwGd60QotvuEuCaKcTg+dmwAqhNgOoWqUZ1 mj/sN8gjWRIXtMLW1/7SagOvxw3nTriUj5j7mcc1Eus9N495paE/sutfthgxeEwq6c6i i/cedRiiimbrGWsIKDtqvpUMImRVhBOIJL6nSKGQpUMx3TuU911bVKipi4Ywd1eMBOND THCcTnmWsPiiKGngAWUDO32Va9OZIZSie8BI0tA7n+uOxjTzMMJqmTtwY0MEpzozW8w/ Ebrg== X-Gm-Message-State: AFeK/H1PguquplKwL+OK8cTJ8LQqEn8vPOhG1ixrjdT1gHMiyNopaikHVNzWPKNndrV2Oyn6 X-Received: by 10.84.174.129 with SMTP id r1mr43837891plb.173.1491486749120; Thu, 06 Apr 2017 06:52:29 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id v11sm4187210pfi.50.2017.04.06.06.52.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:52:28 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, james.hogan@imgtec.com, Matt Redfearn , Thomas Gleixner , Adam Buchbinder , "Maciej W . Rozycki" , Marcin Nowakowski , Chris Metcalf , Paul Burton , Jiri Slaby , Andrew Morton , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Ralf Baechle Subject: [PATCH for-4.10 2/6] MIPS: Stack unwinding while on IRQ stack Date: Thu, 6 Apr 2017 19:22:10 +0530 Message-Id: <1491486734-15668-3-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> References: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Matt Redfearn 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 Acked-by: Jason A. Donenfeld Cc: Thomas Gleixner Cc: Adam Buchbinder Cc: Maciej W. Rozycki Cc: Marcin Nowakowski Cc: Chris Metcalf Cc: James Hogan Cc: Paul Burton Cc: Jiri Slaby Cc: Andrew Morton Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14741/ Signed-off-by: Ralf Baechle (cherry picked from commit d42d8d106b0275b027c1e8992c42aecf933436ea) Signed-off-by: Amit Pundir --- arch/mips/kernel/process.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index 7d80447..efa1df5 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -556,7 +557,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 From patchwork Thu Apr 6 13:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96989 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp741062obc; Thu, 6 Apr 2017 06:53:08 -0700 (PDT) X-Received: by 10.84.238.9 with SMTP id u9mr43813451plk.174.1491486788419; Thu, 06 Apr 2017 06:53:08 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a96si1939554pli.151.2017.04.06.06.53.08; Thu, 06 Apr 2017 06:53:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934831AbdDFNxG (ORCPT + 6 others); Thu, 6 Apr 2017 09:53:06 -0400 Received: from mail-pg0-f52.google.com ([74.125.83.52]:35382 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753945AbdDFNwg (ORCPT ); Thu, 6 Apr 2017 09:52:36 -0400 Received: by mail-pg0-f52.google.com with SMTP id 81so37120774pgh.2 for ; Thu, 06 Apr 2017 06:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bqJHojYH4zH27VAYD/IIz6NoUGefaNIbta7z6UHc7+U=; b=Z2dLnJ6+CfMzzWIqTVfV04BF/8ZaXDmzXlfANvLdUSAAmAO2MhfWO4bjjqtRR5p51j fAiwt/w4rmDQVwYNcRkhrFEGiP4emRuIywitSgy49eKu/ob79nQPFRe+4OCKK2Yf14YY eQzSb0ZZ1QFc/FYf+VJp7lncBjrv1ql4M5uZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bqJHojYH4zH27VAYD/IIz6NoUGefaNIbta7z6UHc7+U=; b=ZSdGKxMj5LOGChUr1hFiFuLf/H3pW3ZW2jxjau/hmuOwcO/j98JaEneuQJ9rDDu9tz XGzKO2JdHHBXNJtK/DMCLuLic4PeFD6SmtZ52QT/BX/dj3SAEHia3dZT/yVuuwgj1q0s Sl/FGFDVbb/24kbRq7jT1tAlIY62MOiyfnzwAvLaMABAJ+1UdAqJSv2jYh7iBbc4EdCX ZHHYpnTw/qHd/Sm/KB5f/ahBJ+fgO1HCX2fyOLLqMz7A97bUCBgBsqWT92PMfChyaKUP lzmJsXDr+i1qOJAM2uxdRy/PccnDvLPpelatELsrGXw+bxNnyUJfuOq/BJhi7oiyZ6ws lq/w== X-Gm-Message-State: AFeK/H2sHseUpISqH6NjZnCalTq2GQi9jj+t8Wyx7m8aMWchB4jySY8EHJEFocSiKr6IYIiQ X-Received: by 10.98.49.129 with SMTP id x123mr14249822pfx.45.1491486755449; Thu, 06 Apr 2017 06:52:35 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id v11sm4187210pfi.50.2017.04.06.06.52.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:52:34 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, james.hogan@imgtec.com, Matt Redfearn , Thomas Gleixner , Paul Burton , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Ralf Baechle Subject: [PATCH for-4.10 4/6] MIPS: Switch to the irq_stack in interrupts Date: Thu, 6 Apr 2017 19:22:12 +0530 Message-Id: <1491486734-15668-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> References: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Matt Redfearn When enterring interrupt context via handle_int or except_vec_vi, switch to the irq_stack of the current CPU if it is not already in use. The current stack pointer is masked with the thread size and compared to the base or the irq stack. If it does not match then the stack pointer is set to the top of that stack, otherwise this is a nested irq being handled on the irq stack so the stack pointer should be left as it was. The in-use stack pointer is placed in the callee saved register s1. It will be saved to the stack when plat_irq_dispatch is invoked and can be restored once control returns here. Signed-off-by: Matt Redfearn Acked-by: Jason A. Donenfeld Cc: Thomas Gleixner Cc: James Hogan Cc: Paul Burton Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14743/ Signed-off-by: Ralf Baechle (cherry picked from commit dda45f701c9d7ad4ac0bb446e3a96f6df9a468d9) Signed-off-by: Amit Pundir --- arch/mips/kernel/genex.S | 81 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index dc0b296..0a7ba4b 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -187,9 +187,44 @@ NESTED(handle_int, PT_SIZE, sp) LONG_L s0, TI_REGS($28) LONG_S sp, TI_REGS($28) - PTR_LA ra, ret_from_irq - PTR_LA v0, plat_irq_dispatch - jr v0 + + /* + * SAVE_ALL ensures we are using a valid kernel stack for the thread. + * Check if we are already using the IRQ stack. + */ + move s1, sp # Preserve the sp + + /* Get IRQ stack for this CPU */ + ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG +#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) + lui k1, %hi(irq_stack) +#else + lui k1, %highest(irq_stack) + daddiu k1, %higher(irq_stack) + dsll k1, 16 + daddiu k1, %hi(irq_stack) + dsll k1, 16 +#endif + LONG_SRL k0, SMP_CPUID_PTRSHIFT + LONG_ADDU k1, k0 + LONG_L t0, %lo(irq_stack)(k1) + + # Check if already on IRQ stack + PTR_LI t1, ~(_THREAD_SIZE-1) + and t1, t1, sp + beq t0, t1, 2f + + /* Switch to IRQ stack */ + li t1, _IRQ_STACK_SIZE + PTR_ADD sp, t0, t1 + +2: + jal plat_irq_dispatch + + /* Restore sp */ + move sp, s1 + + j ret_from_irq #ifdef CONFIG_CPU_MICROMIPS nop #endif @@ -262,8 +297,44 @@ NESTED(except_vec_vi_handler, 0, sp) LONG_L s0, TI_REGS($28) LONG_S sp, TI_REGS($28) - PTR_LA ra, ret_from_irq - jr v0 + + /* + * SAVE_ALL ensures we are using a valid kernel stack for the thread. + * Check if we are already using the IRQ stack. + */ + move s1, sp # Preserve the sp + + /* Get IRQ stack for this CPU */ + ASM_CPUID_MFC0 k0, ASM_SMP_CPUID_REG +#if defined(CONFIG_32BIT) || defined(KBUILD_64BIT_SYM32) + lui k1, %hi(irq_stack) +#else + lui k1, %highest(irq_stack) + daddiu k1, %higher(irq_stack) + dsll k1, 16 + daddiu k1, %hi(irq_stack) + dsll k1, 16 +#endif + LONG_SRL k0, SMP_CPUID_PTRSHIFT + LONG_ADDU k1, k0 + LONG_L t0, %lo(irq_stack)(k1) + + # Check if already on IRQ stack + PTR_LI t1, ~(_THREAD_SIZE-1) + and t1, t1, sp + beq t0, t1, 2f + + /* Switch to IRQ stack */ + li t1, _IRQ_STACK_SIZE + PTR_ADD sp, t0, t1 + +2: + jal plat_irq_dispatch + + /* Restore sp */ + move sp, s1 + + j ret_from_irq END(except_vec_vi_handler) /* From patchwork Thu Apr 6 13:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96988 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp741056obc; Thu, 6 Apr 2017 06:53:07 -0700 (PDT) X-Received: by 10.99.51.200 with SMTP id z191mr36103421pgz.137.1491486787263; Thu, 06 Apr 2017 06:53:07 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a96si1939554pli.151.2017.04.06.06.53.07; Thu, 06 Apr 2017 06:53:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934825AbdDFNxF (ORCPT + 6 others); Thu, 6 Apr 2017 09:53:05 -0400 Received: from mail-pg0-f53.google.com ([74.125.83.53]:34480 "EHLO mail-pg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934831AbdDFNwj (ORCPT ); Thu, 6 Apr 2017 09:52:39 -0400 Received: by mail-pg0-f53.google.com with SMTP id 21so37155264pgg.1 for ; Thu, 06 Apr 2017 06:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zkEK7Hz/6Jx2FI/7DJ9OkhDFntzd88aX40uGZLyfgX4=; b=GeQ4hc6544uhC+TcFnGcbjvchdKTgrEp7mCZdU9z2kk9a1E8cga3XTXMroisDYiNnz WsoulwzA/ZcafUarQFvkWN4TbEExeWD4o0iBFOl5IkCY6XZeqCwBfm963Wc3C5CJfRWL FyUaHRbb3QT/EdGLqBL7kCyR27MhyscprOLNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zkEK7Hz/6Jx2FI/7DJ9OkhDFntzd88aX40uGZLyfgX4=; b=ogyR+kuM9qYJVp5xilSL50uJyaMD5JJmEZzqluS6wMbNF+XEGjqec1aQTTDyn9oAnB ogYubEDteSstyLe+u4GzqFAvpnR6oe8Lr/RYZOaMFyl9mp4SdZL+ObM/H0hYEsE61LiD TGd4u643K7nwy5FfrskyPoefduA5ZhsRTD4DqPnZHzyl8B4tZBWO6TZHlPiZ8fA1jfiP L3CEG/f0IhRDw/NUFjapb1jCqlv06ldmpKKa5DyuOR2bnIozNTNDSbbx4/Ok+R5l6B0d HM1imFrpNOQMsgMeFaUHgnZ/dK/oNigPJ5iS6pDiOFC3mxa3eqAi4he/8h5Lz/mCn66G pnWw== X-Gm-Message-State: AFeK/H3S52viFo9Wg7FjT67GKLzInWKPycPaG21ZPQwz5wG3yaKnskx5qvwMqL/n6w0rhmJ/ X-Received: by 10.84.253.15 with SMTP id z15mr43617839pll.142.1491486758263; Thu, 06 Apr 2017 06:52:38 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id v11sm4187210pfi.50.2017.04.06.06.52.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:52:37 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, james.hogan@imgtec.com, Matt Redfearn , Thomas Gleixner , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Ralf Baechle Subject: [PATCH for-4.10 5/6] MIPS: Select HAVE_IRQ_EXIT_ON_IRQ_STACK Date: Thu, 6 Apr 2017 19:22:13 +0530 Message-Id: <1491486734-15668-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> References: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Matt Redfearn Since do_IRQ is now invoked on a separate IRQ stack, we select HAVE_IRQ_EXIT_ON_IRQ_STACK so that softirq's may be invoked directly from irq_exit(), rather than requiring do_softirq_own_stack. Signed-off-by: Matt Redfearn Acked-by: Jason A. Donenfeld Cc: Thomas Gleixner Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14744/ Signed-off-by: Ralf Baechle (cherry picked from commit 3cc3434fd6307d06b53b98ce83e76bf9807689b9) Signed-off-by: Amit Pundir --- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index b3c5bde..80832aa 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -9,6 +9,7 @@ config MIPS select HAVE_CONTEXT_TRACKING select HAVE_GENERIC_DMA_COHERENT select HAVE_IDE + select HAVE_IRQ_EXIT_ON_IRQ_STACK select HAVE_OPROFILE select HAVE_PERF_EVENTS select PERF_USE_VMALLOC From patchwork Thu Apr 6 13:52:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96987 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp741051obc; Thu, 6 Apr 2017 06:53:06 -0700 (PDT) X-Received: by 10.99.53.195 with SMTP id c186mr36224146pga.182.1491486786643; Thu, 06 Apr 2017 06:53:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a96si1939554pli.151.2017.04.06.06.53.06; Thu, 06 Apr 2017 06:53:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934804AbdDFNxA (ORCPT + 6 others); Thu, 6 Apr 2017 09:53:00 -0400 Received: from mail-pg0-f41.google.com ([74.125.83.41]:34503 "EHLO mail-pg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934818AbdDFNwq (ORCPT ); Thu, 6 Apr 2017 09:52:46 -0400 Received: by mail-pg0-f41.google.com with SMTP id 21so37156272pgg.1 for ; Thu, 06 Apr 2017 06:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6iuvPjq2NXkmKqRP2BZ1DmT9HI2WCfJmxi+d3PpC3NE=; b=XEzY0JduJD9a5n9gvZQb4kMsqB6drzfIMu2lgFATUWrjwRoySAazAjSPgQFk8udPh6 Bd0BxKv6KGNFkhI1ZCHoqNyORO2yYfIyLqajzBic5a3ECxbMmYpTVgFY5BRWUWFlaJRB uRUVJo3jpxeYp1+LssGoZFFLh46fDW/eqaq+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6iuvPjq2NXkmKqRP2BZ1DmT9HI2WCfJmxi+d3PpC3NE=; b=SqhlcbodgKkVsnFzDci8nfFX/o7RjUINnXORPszXqt6vPohApypk+YpjuN6htdV0RM bplzgntCJLv6hdnDCGkfxOhXE6O3VwIlH/y+XbbQTEvhs/NvcKcwAQbAAhusWI3gw6r6 Qz3p8yG/ARQYqdAEGymingcsksyVqQsnqyXrchT/zjZFoZwLzipPgR1esxPI/1jZPuat dSFkaO7TogWSxAqFwerUxff6KyCjngJ0jX9ubVBPUAUOZxzuzRYF9ItC8Qn5ATfHPdE2 +0yexHSvuLoAbsH3nHKOIGOYoxObUoVkUp+6QdzkRbpTD7Ia5L6eMMSpWRadud5bZ+JU bt2A== X-Gm-Message-State: AFeK/H2Zw9e44TLCFRf2q4t3LQZlmyQ3eNr6cNOJfGDkTJZoCVOAStFCjtI8SQ7bYAofh0mn X-Received: by 10.99.217.17 with SMTP id r17mr37120850pgg.140.1491486760952; Thu, 06 Apr 2017 06:52:40 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id v11sm4187210pfi.50.2017.04.06.06.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Apr 2017 06:52:40 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, james.hogan@imgtec.com, Matt Redfearn , Ralf Baechle , Paul Burton , linux-mips@linux-mips.org Subject: [PATCH for-4.10 6/6] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch Date: Thu, 6 Apr 2017 19:22:14 +0530 Message-Id: <1491486734-15668-7-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> References: <1491486734-15668-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Matt Redfearn 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 (cherry picked from commit c25f8064c1d5731a2ce5664def890140dcdd3e5c) Signed-off-by: Amit Pundir --- arch/mips/kernel/genex.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 0a7ba4b..7ec9612 100644 --- 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