Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3281697iob; Mon, 16 May 2022 18:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCwrpiKCm5H9gqLz/7uyJrjWZEXDgZf7wHyL3j+cojdB+HVLiTffRzhMKScddz3mZ3awP0 X-Received: by 2002:aa7:c417:0:b0:42a:c3dd:4148 with SMTP id j23-20020aa7c417000000b0042ac3dd4148mr1662787edq.379.1652749387739; Mon, 16 May 2022 18:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652749387; cv=none; d=google.com; s=arc-20160816; b=t+pL5GVE/OylvE+8kgD1Ld9MwbjG8GinGN41wqunLIr/vgc5ENSQLFRbek9/wuc+MH JmBaCubL8A19sslTo7B/DBYbGP6A2dKgl+PPmyBt/ttR6dS9PD1Mh5RGby+/q+jLStgb Ygsc5LJ4YOlNhAixCvq5hRr1y82L705lMYIYa/I4q+18cbDfgBPR729iyOi8aWUIR/o1 DLLl12Phl2BEIJdoOBIfLnH+9uOYuOuUhX7GGp1mdnNq1Iq/tJTue91ZmEjQNjp6cgWs pAYPT+Ihf+1F/PA4aa0A02u5bF1UmGEt2So5l/+r7kyHnwP7kRGXckWh2Ao78sc4Y8Kp g3Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=J2Br0kGTz97gFRI4UoHpjTrAphLEpHX8G3A3EWdmkCo=; b=hIytxGn9QeGv1x0ZtSCQZbRzZW4RMvRxDj+k1xB1BE2eTrKMM/RPC0PZyiE3dr4YQ4 P/sS0YXgNzN+oS1MLdTiK0VwWqe0WfSeQlwc2Zi0hlzVR0bBpG8+7l+EXqVbOc91cq4u IAKngzrIHJTF9Wj0LRZiE7knhnUH9+8tyyb1/xB8gifR3s5oAWgPOG34BXQ+nac/9ReX 6eqFv3cJ5UP80GPh4eztwFpFOg4TvLmrjgpU6oy1eFY9WNKOeKS65vT+1lYZDCVQs12o CMuoCkZilHUoc44O0Ux9Bw+CV9Dc0FDk5R1J6DlS+03ZfAQeYheF8JV7+BpPvZ877qKa l2CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cil+zbCo; dkim=neutral (no key) header.i=@linutronix.de; 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 c3-20020a17090654c300b006e86856a2c0si933785ejp.704.2022.05.16.18.02.42; Mon, 16 May 2022 18:03:07 -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=cil+zbCo; dkim=neutral (no key) header.i=@linutronix.de; 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 S240274AbiEPG35 (ORCPT + 99 others); Mon, 16 May 2022 02:29:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232090AbiEPG3z (ORCPT ); Mon, 16 May 2022 02:29:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94F0F26AFE; Sun, 15 May 2022 23:29:54 -0700 (PDT) Date: Mon, 16 May 2022 08:29:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652682591; 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=J2Br0kGTz97gFRI4UoHpjTrAphLEpHX8G3A3EWdmkCo=; b=cil+zbCowMsn2/G+DxFU0NbmaeYTCghUfXe4n8ZAQNo4fW3GYLIaNYsUMp/eRH7tK6l9WH vEOt/i93dsLzwhNpl5F5TQXYXD8heNoAgrlQbJPDAAjM5DK/Uc+lKy3huZgajIMcJ3F5pv gXHqEt44ira47nMMMLsk1WVsUn8BLUo674UZBnsPZ19ZBWyixbexW14wZLpfe4wpUurCdh 2fD4wF1uds3iOPY5yhql9e4RK6OjBFkrbeuXG9CIK/ygxTC52mExQnCIQUUKJj0SzqKW9+ sJsq3QIhAXhOnuOY1hUBeTOel5rBnPBU1LlEC0TvW6P+FG448SFiTXwBt9CZag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652682591; 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=J2Br0kGTz97gFRI4UoHpjTrAphLEpHX8G3A3EWdmkCo=; b=h6Pg68+btj1eb0yWjhiNtumHNaV2y/bYZwna19lkebWnNIHB1My4fT5m4PtiVIBtfB/Byx b58Z8SaQXr+2pJCA== From: Sebastian Andrzej Siewior To: Lukas Wunner Cc: Thomas Gleixner , 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() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: 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 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. 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. 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 and sadly I missed dln2. Please let me know if you have more users similar to dln2. I will add those to my list once upstream buys that interface. Sebastian