Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3092055iob; Mon, 16 May 2022 12:54:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCiA4uZE24UT4Rs0/ucj7+z6gMF5SWoExxFRUQremk8DxQdW/xWue2/phw7FUBWpyM2Rn9 X-Received: by 2002:a50:fe83:0:b0:42a:b5f4:8a52 with SMTP id d3-20020a50fe83000000b0042ab5f48a52mr5239352edt.105.1652730871589; Mon, 16 May 2022 12:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652730871; cv=none; d=google.com; s=arc-20160816; b=obH7ULoHrTnz6j2nk2AaqQJ3NAykA1kwwhmuUirJnraPq7ToE2WcJZZCh9/2KhMMRG KLKeIQgQroJC8mXFl6RfHGA9B/lhNagiR3BiQJFTAwPRDiJstNPpIuhSrYx6VuLYceCo lnMMSJ7PnzOEv3jJykISo8pj8jBRG3lvKkEx1rOl9pY67XBNMCcdwowQeQXZzznMiDXB 9JQRUg7G748YWno0RMhggKWitrI3YQfuEGqF9/vkNI5W86vVp8FmzzH1GDWGhCPjieTX uWooEOIREz5cklIl6Y39wHupXGFrC01rrWVYe/Ufo+fJUs1+tRuRGhpjNrswpQznxZGs w03A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=cyYJ2WHlWTrl9zB33+sqWxQ7FgI0MyBHjDAy808aYx8=; b=NKUZcXxCMDVCiDXatxGRHmW55zH9nXX9OtU9W+F+Xva1uMDUZqEUyoiDnljlbMCBRY 86iThZkpU0dGaHCiQIgFOcbwlKMjevSWCoTTAC9+Q31N+3OU/q6pU9vSYpyAfAWT1+kA 4Yq3dQajmPCj3s170oSHX93z/f20CeB45SNYszWZOG0hxg+JBHqRECsrA4ATOEf0Xjb0 JoAabBZv6EUA6Y8qrTDVEDNakiRvVlDKDKw9Ogn+4Cd3y0sZol2JqtJrqmbxNR2EKofK srOsCoTEzPaYYjjaVGK1ElPsv45wsrtM4AvK+BLZk5KUwqtsLZypWVQxsUgsptq3qHMG 6xig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VTJBnR9i; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn8-20020a17090794c800b006df76385cf8si299600ejc.408.2022.05.16.12.54.05; Mon, 16 May 2022 12:54:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VTJBnR9i; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240509AbiEPGxg (ORCPT + 99 others); Mon, 16 May 2022 02:53:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240499AbiEPGxc (ORCPT ); Mon, 16 May 2022 02:53:32 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA73F3668F; Sun, 15 May 2022 23:53:31 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652684010; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cyYJ2WHlWTrl9zB33+sqWxQ7FgI0MyBHjDAy808aYx8=; b=VTJBnR9iJS2UcJSlk6vOxJB5Z+F1wXmL2BSt3bi+/m/fTunsd0N2musDc+wyIw7iEtIc6S Kkt605axNOMj6SoBBCi73glx0dktXc4wrr/ZpdBuPmrkjDdKgbSRn9c39Lzs3YOlGTIr4m 0YkEprbzBLIqZP1Isca4jQ2Vbj4CNovb+K/lxA5upQ59svtO4PhHZL19qMU8g4YN3stAJ4 TDz25KDHPNEw0bTEenbtblaVhtlXXf7rfZGlz6bAsZZ49LE2/sM/jJ/JKtFAYGGrsmV6me 7Ygj/bc8Ov+uMHfr8Gj0M12IA441dXgMfciE8Aeb8+oqsxCsaj5dSEZ6Q7YOdA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652684010; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cyYJ2WHlWTrl9zB33+sqWxQ7FgI0MyBHjDAy808aYx8=; b=QGKny6r7vUJkTs0dbB1OhnBXWVoMca0t7FKqSIteEyXJZQqpjd4Ibew8D6KO8YK231kcJW oF+f95CUYPwVDeDA== To: Sebastian Andrzej Siewior , Lukas Wunner Cc: Marc Zyngier , Mark Rutland , Jakub Kicinski , Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, Octavian Purdila , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] genirq: Deduplicate WARN_ON_ONCE() in generic_handle_domain_irq() In-Reply-To: References: Date: Mon, 16 May 2022 08:53:29 +0200 Message-ID: <87ilq6q87q.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 16 2022 at 08:29, Sebastian Andrzej Siewior wrote: > On 2022-05-10 09:56:05 [+0200], Lukas Wunner wrote: >> An example for irqchips where the warning is false positive are >> USB-attached GPIO controllers such as drivers/gpio/gpio-dln2.c: > > They are not false positives because=E2=80=A6 > >> USB gadgets are incapable of directly signaling an interrupt because >> they cannot initiate a bus transaction by themselves. All communication >> on the bus is initiated by the host controller, which polls a gadget's >> Interrupt Endpoint in regular intervals. If an interrupt is pending, >> that information is passed up the stack in softirq context, from which >> a hardirq is synthesized via generic_handle_domain_irq(). > > they tell you that the context is wrong. Why? These handlers can be called from any context, really. Yes. They need to be called with interrupts disabled, but that's it. The warning is checking hard interrupt context unconditionally. > From looking at gpio-dln2 this is called from USB URB's callback which > is softirq. In the end dln2_gpio_event() is invoked while > dln2_dev::event_cb_lock is acquired. That lock is acquired by > disabling interrupts which is what gets the locking right for > generic_handle_domain_irq(). If that lock lifted to spin_lock_bh() > (because it is always in urb's calback context and all HCDs complete > in one context unlike now) then this breaks. Yes, but that's a different problem. > And PREEMPT_RT is broken already. Therefore, last week, I've been > promoting generic_handle_domain_irq_safe() > https://lkml.kernel.org/r/YnkfWFzvusFFktSt@linutronix.de Well, that's just a wrapper which adds the local_irq_save(), so it's not any different from having the local_irq_save() at the callsite, unless I'm missing something. Thanks, tglx