From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E996BC433EF for ; Sun, 24 Oct 2021 15:39:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B291B60F21 for ; Sun, 24 Oct 2021 15:39:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B291B60F21 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=alpha.franken.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AVm1Kv8tiugnw2oVbEhCOxsuDnIdzTUW6VZNnXJW8RY=; b=Wevj877NNnr2G3 0D39D6BBKgx6TlyM5IxqlhUNisdVSErBW9rqjBNKUh8Kz8070qRHkYGamjJvUC+AjCLeq+6Jwig/P WT0fuNttDftvUj56yecfxh0wjRRkhNa1g49eqQ8KnFiTC7JXb74wYI2ruVwQ13IF8q9f1HwulqAri 0miRb9xwovAua3QL6d1C8pLtX1CdQup7WjKUIgJEJqu6i9A1Tlcku5GGpJEc1h8b4WaOJmR8bPFFt S686eWTyvEKN7REOXeUu86ZQdmJFp4zzRnC2Yiqan8lKgPtGOkXHRRWa4mAH/FIBJohNMe+lxz6XI /aMlmvaLUIYgbeXrrbfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mefZQ-00EBZW-42; Sun, 24 Oct 2021 15:38:00 +0000 Received: from elvis.franken.de ([193.175.24.41]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mefZ1-00EBRd-2j for linux-arm-kernel@lists.infradead.org; Sun, 24 Oct 2021 15:37:37 +0000 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1mefYq-0006bc-00; Sun, 24 Oct 2021 17:37:24 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 76899C265F; Sun, 24 Oct 2021 17:31:57 +0200 (CEST) Date: Sun, 24 Oct 2021 17:31:57 +0200 From: Thomas Bogendoerfer To: Mark Rutland Cc: linux-kernel@vger.kernel.org, aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, maz@kernel.org, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, vgupta@kernel.org, will@kernel.org Subject: Re: [PATCH 01/15] irq: mips: avoid nested irq_enter() Message-ID: <20211024153157.GH4721@alpha.franken.de> References: <20211021180236.37428-1-mark.rutland@arm.com> <20211021180236.37428-2-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211021180236.37428-2-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211024_083735_429351_3A979F4E X-CRM114-Status: GOOD ( 20.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Oct 21, 2021 at 07:02:22PM +0100, Mark Rutland wrote: > As bcm6345_l1_irq_handle() is a chained irqchip handler, it will be > invoked within the context of the root irqchip handler, which must have > entered IRQ context already. > > When bcm6345_l1_irq_handle() calls arch/mips's do_IRQ() , this will nest > another call to irq_enter(), and the resulting nested increment to > `rcu_data.dynticks_nmi_nesting` will cause rcu_is_cpu_rrupt_from_idle() > to fail to identify wakeups from idle, resulting in failure to preempt, > and RCU stalls. > > Chained irqchip handlers must invoke IRQ handlers by way of thee core > irqchip code, i.e. generic_handle_irq() or generic_handle_domain_irq() > and should not call do_IRQ(), which is intended only for root irqchip > handlers. > > Fix bcm6345_l1_irq_handle() by calling generic_handle_irq() directly. > > Fixes: c7c42ec2baa1de7a ("irqchips/bmips: Add bcm6345-l1 interrupt controller") > Signed-off-by: Mark Rutland > Cc: Marc Zyngier > Cc: Thomas Bogendoerfer > Cc: Thomas Gleixner > --- > drivers/irqchip/irq-bcm6345-l1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c > index e3483789f4df..1bd0621c4ce2 100644 > --- a/drivers/irqchip/irq-bcm6345-l1.c > +++ b/drivers/irqchip/irq-bcm6345-l1.c > @@ -140,7 +140,7 @@ static void bcm6345_l1_irq_handle(struct irq_desc *desc) > for_each_set_bit(hwirq, &pending, IRQS_PER_WORD) { > irq = irq_linear_revmap(intc->domain, base + hwirq); > if (irq) > - do_IRQ(irq); > + generic_handle_irq(irq); > else > spurious_interrupt(); > } > -- > 2.11.0 Acked-by: Thomas Bogendoerfer -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B11BC433EF for ; Sun, 24 Oct 2021 15:37:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77D9760FBF for ; Sun, 24 Oct 2021 15:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231985AbhJXPkE (ORCPT ); Sun, 24 Oct 2021 11:40:04 -0400 Received: from elvis.franken.de ([193.175.24.41]:37657 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231548AbhJXPjw (ORCPT ); Sun, 24 Oct 2021 11:39:52 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1mefYq-0006bc-00; Sun, 24 Oct 2021 17:37:24 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 76899C265F; Sun, 24 Oct 2021 17:31:57 +0200 (CEST) Date: Sun, 24 Oct 2021 17:31:57 +0200 From: Thomas Bogendoerfer To: Mark Rutland Cc: linux-kernel@vger.kernel.org, aou@eecs.berkeley.edu, catalin.marinas@arm.com, deanbo422@gmail.com, green.hu@gmail.com, guoren@kernel.org, jonas@southpole.se, kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, maz@kernel.org, nickhu@andestech.com, palmer@dabbelt.com, paulmck@kernel.org, paul.walmsley@sifive.com, peterz@infradead.org, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tglx@linutronix.de, torvalds@linux-foundation.org, vgupta@kernel.org, will@kernel.org Subject: Re: [PATCH 01/15] irq: mips: avoid nested irq_enter() Message-ID: <20211024153157.GH4721@alpha.franken.de> References: <20211021180236.37428-1-mark.rutland@arm.com> <20211021180236.37428-2-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021180236.37428-2-mark.rutland@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 07:02:22PM +0100, Mark Rutland wrote: > As bcm6345_l1_irq_handle() is a chained irqchip handler, it will be > invoked within the context of the root irqchip handler, which must have > entered IRQ context already. > > When bcm6345_l1_irq_handle() calls arch/mips's do_IRQ() , this will nest > another call to irq_enter(), and the resulting nested increment to > `rcu_data.dynticks_nmi_nesting` will cause rcu_is_cpu_rrupt_from_idle() > to fail to identify wakeups from idle, resulting in failure to preempt, > and RCU stalls. > > Chained irqchip handlers must invoke IRQ handlers by way of thee core > irqchip code, i.e. generic_handle_irq() or generic_handle_domain_irq() > and should not call do_IRQ(), which is intended only for root irqchip > handlers. > > Fix bcm6345_l1_irq_handle() by calling generic_handle_irq() directly. > > Fixes: c7c42ec2baa1de7a ("irqchips/bmips: Add bcm6345-l1 interrupt controller") > Signed-off-by: Mark Rutland > Cc: Marc Zyngier > Cc: Thomas Bogendoerfer > Cc: Thomas Gleixner > --- > drivers/irqchip/irq-bcm6345-l1.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c > index e3483789f4df..1bd0621c4ce2 100644 > --- a/drivers/irqchip/irq-bcm6345-l1.c > +++ b/drivers/irqchip/irq-bcm6345-l1.c > @@ -140,7 +140,7 @@ static void bcm6345_l1_irq_handle(struct irq_desc *desc) > for_each_set_bit(hwirq, &pending, IRQS_PER_WORD) { > irq = irq_linear_revmap(intc->domain, base + hwirq); > if (irq) > - do_IRQ(irq); > + generic_handle_irq(irq); > else > spurious_interrupt(); > } > -- > 2.11.0 Acked-by: Thomas Bogendoerfer -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]