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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CF756C433F5 for ; Tue, 10 May 2022 22:53:40 +0000 (UTC) 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bqG7hni/s3KB92X73AkLa/+yYMhCJS/FD24eL5+G+b8=; b=FquIAkBPSrFrFC ZRhgI9Jcvy/LHWtGzR8RIBFTWHyH0yRyU/LIoqLn7htQyek8fQm9z0ux2dO8Oq262oW/03N+DuksE 92WoXWDVdIvVixEjT90ti+uMD13e/JQrLCTRPCaKN3uOpvriNJQh7wyd4Ocfbd3zireiTMoFhzzD8 xhXbIGuTNlW6sj/pCrvPfMZXs4besBuUiNunDi7uJ+AMzrDE0MbL5K6uG4TWl/4uMDT0+qdok9Uuo DaJWjXnWa8yA6A1fxa9KIlhefP0X7pbGMepYkEHnkgwlrXxiPRyU1p4QJND5MpzWe7k/2V68+MhJu Onu3RfYPxYbcgJ6y3SVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1noYic-004Gj5-Uh; Tue, 10 May 2022 22:52:39 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1noYiZ-004Ghf-Df for linux-arm-kernel@lists.infradead.org; Tue, 10 May 2022 22:52:36 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652223150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+CPl63MxUB8As/sCAVAdki8lgIaTJAnVQkLOzHxlZHU=; b=OtTG3bimjU3ypaFSXKGYA2Rd4mOJHtF1421UA6JbS4AsEqb1jZKIxBcUzKQ9VFhEczScnm gj01eBFp2osh4xiljdeLAxprI0dft7DEIcormLtGT715kDvUV/oqBZB4qBLhnv0mH7N+w+ zAUA+EIx5GNvx+kEt9exhrmZ2h+DdVG2oAdeB/dW6c1Nr9DfgNFlRENXTzIAGcZh509MQy d8fg7MWh6X9md1k4EY2p+jQadHb8+45HZPDxMgk/bGM/+OaRXnPI27lMWdSgD6SSd9CiJH wmBUtEq/WgrOSnLyCBrW0iNedraF+PpPntPI1Flxp1WAYX/cThzINIoBjUi+xA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652223150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+CPl63MxUB8As/sCAVAdki8lgIaTJAnVQkLOzHxlZHU=; b=POXfdVFu8B2YYSKQXyeP2b43jsvPdfGgoeJRZpIsWXdysOTazFYDC6HuksbnhKvRW0SWFV RAkUhVtsovE38PCg== To: Mark Rutland , Lukas Wunner Cc: maz@kernel.org, Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, Octavian Purdila , 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, nickhu@andestech.com, palmer@dabbelt.com, paul.walmsley@sifive.com, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tsbogend@alpha.franken.de, vgupta@kernel.org, vladimir.murzin@arm.com, will@kernel.org, Peter Zijlstra Subject: Re: [PATCH v2 17/17] irq: remove handle_domain_{irq,nmi}() In-Reply-To: References: <20211026092504.27071-1-mark.rutland@arm.com> <20211026092504.27071-18-mark.rutland@arm.com> <20220506203242.GA1855@wunner.de> <20220510121320.GA3020@wunner.de> Date: Wed, 11 May 2022 00:52:29 +0200 Message-ID: <87a6bpov9u.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220510_155235_644530_960C07D1 X-CRM114-Status: GOOD ( 11.74 ) 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 Tue, May 10 2022 at 15:15, Mark Rutland wrote: > On Tue, May 10, 2022 at 02:13:20PM +0200, Lukas Wunner wrote: >> For gpio-dln2.c, I believe it from inspection. >> >> For smsc95xx.c, I'm actually seeing it go wrong in practice, >> unedited dmesg splat is included below FWIW. > > Thanks; having the trace makes this much easier to analyse. which confirmes what I talked about before: >> WARNING: CPU: 3 PID: 75 at kernel/irq/irqdesc.c:702 generic_handle_domain_irq+0x88/0x94 >> generic_handle_domain_irq from smsc95xx_status+0x54/0xb0 >> smsc95xx_status from intr_complete+0x80/0x84 >> intr_complete from __usb_hcd_giveback_urb+0xa4/0x12c >> __usb_hcd_giveback_urb from usb_hcd_giveback_urb+0x118/0x11c >> usb_hcd_giveback_urb from completion_tasklet_func+0x7c/0xc8 >> completion_tasklet_func from tasklet_callback+0x20/0x24 >> tasklet_callback from tasklet_action_common.constprop.0+0x148/0x220 >> tasklet_action_common.constprop.0 from tasklet_hi_action+0x28/0x30 >> tasklet_hi_action from __do_softirq+0x154/0x3e8 >> __do_softirq from __local_bh_enable_ip+0x12c/0x1a8 >> __local_bh_enable_ip from irq_forced_thread_fn+0x7c/0xac >> irq_forced_thread_fn from irq_thread+0x16c/0x228 >> irq_thread from kthread+0x100/0x140 So what happens here: interrupt -> wakeup threaded handler threaded handler runs local_bh_disable(); .... schedules tasklet ... local_bh_enable() do_softirq() run_tasklet() urb_completion() smsc95xx_status() generic_handle_domain_irq() That interrupt in question is an interrupt, which is not handled by the primary CPU interrupt chips. It's a synthetic interrupt which is generated from the received USB packet. + /* USB interrupts are received in softirq (tasklet) context. + * Switch to hardirq context to make genirq code happy. + */ + local_irq_save(flags); + __irq_enter_raw(); + if (intdata & INT_ENP_PHY_INT_) - ; + generic_handle_domain_irq(pdata->irqdomain, PHY_HWIRQ); This __irq_enter_raw() is really wrong. This is _not_ running in hard interrupt context. Pretending so creates more problems than it solves. It breaks context tracking, confuses lockdep ... We also have demultiplexed interrupts which are nested in a threaded interrupt handler and share the thread context. No, we are not going to pretend that they run in hard interrupt context either. So we need a clear distinction between interrupts which really happen in hard interrupt context and those which are synthetic and can be invoked from pretty much any context. Anything else is just a recipe for disaster and endless supply of half baken hacks. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel