Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2811209iob; Mon, 16 May 2022 06:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybj13B5QAH0Gc6OljDxhaIsNYwv37MH7L32GKaEs3cjUldN+5BFDPZf33oqCN5ynAHYiLn X-Received: by 2002:a17:907:3e28:b0:6f4:3ba3:504e with SMTP id hp40-20020a1709073e2800b006f43ba3504emr15442595ejc.632.1652708945947; Mon, 16 May 2022 06:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652708945; cv=none; d=google.com; s=arc-20160816; b=NhWCRXqaXjkBquv7o0A+VLerF1PK7A4uOBwvwodsuDahb/gMnJa0PyMoXG1JUfHzu0 HA3JVsXdvG6EyDfx3n1YUMrxu8xRG0e2hRvbK9+YiDSOhwQdIhs5LmdTMhtAZvm6BcAC g300RhRZBMTnBFY+rROjhVblSpBcMg1fjJrTYH0XxxOKSnwImdddBBnKP1q8EHjGhCm7 YNyvQsX86rwWONHEBm5SQyVQpTbEX3aV+61w4ucCezeFKD7HQqK667laT4GzVnc763Nz 0xPI3IBm8xK/9nzOro2O+gDMlHjpxPdU23qOb9dzmyNvMfhSmSJL3TsClu1UYTfZBYqt RHmw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=S5NxAJPVWcMi6gSub2SnJmtVeydspv2dOKKX4Sgbo2E=; b=MFVtpaThitwLwtQQCkk1fOksVlMWrMZVakaFpC1VCr5lEhv2Jf3jR4OR3HGJpq9llp AUbHxhlDVrUCcVHLiF0kfQRrtRZ6ipMyr3BYNwE1VWI2MTJrkcmVO2FvB7EXFBvxpPGT xNhLa55uu2M/Sf6yqLXWNnYIKqH1ok/e40RWT3bteygIPy71kR8uZsdcrqIxwO/caS2k bX/3Hq7dOgLyl+8M/Sf0kBFd1EzvowpgDrOYT29iDJ3rTspg1Pxc+81EBBU8U6O3taaR +NmbDwIM5K6lhLf5eNqLjZbhsP31NvIUVvKjkHl8GSR4YaP8eWDHprOyA3/irx/iFnEU AUKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="lJ/ua/xT"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 n14-20020a50934e000000b00427d0e5c909si9219288eda.414.2022.05.16.06.48.43; Mon, 16 May 2022 06:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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="lJ/ua/xT"; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S233909AbiEPLXx (ORCPT + 70 others); Mon, 16 May 2022 07:23:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243099AbiEPLXw (ORCPT ); Mon, 16 May 2022 07:23:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94DBF387A2; Mon, 16 May 2022 04:23:49 -0700 (PDT) Date: Mon, 16 May 2022 13:23:46 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1652700228; 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=S5NxAJPVWcMi6gSub2SnJmtVeydspv2dOKKX4Sgbo2E=; b=lJ/ua/xT36CFkqAG2YmuUJzsMegjfmmNTNqFT+fjWUS0gy0CFATLEgN6pymWdJzZRXx+c2 +2tnuSQnhzScgw8CD400ykPzDIZ34DTelPol+ky2h5ZdINhBstvnNH2N6Xwral/bK94Srw GcE97KmJQRokY9lLjkxkE0MajKpJCpKkpsFmmNGZLC0M4eGr2JrDlIkWq+IUovdVExg15j ngczzWRkxsTGvHYwzULb4NfvLr1Zvc1S1egZzwo3HBfWnvIZhMwtnLjGw44Udvu5b7unJQ 2rRFDnGD6COThS/URwcxwBvcZchfuCohtpzk9klqe6WeAdWfuiCwwSPp0C+O9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1652700228; 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=S5NxAJPVWcMi6gSub2SnJmtVeydspv2dOKKX4Sgbo2E=; b=54/Hu5OcF7w+aG2PdqmJIRu09tvXTti1VbEvmiab9M9zPRjw3PZQbf8xF5NEXBPzJfk2jw 5Mtg5wpN0Ua/JmBg== From: Sebastian Andrzej Siewior To: Lukas Wunner Cc: linux-kernel@vger.kernel.org, Thomas Gleixner , Bartosz Golaszewski , Basavaraj Natikar , Hans de Goede , Linus Walleij , Mark Gross , Michael Buesch , Rafa?? Mi??ecki , Shyam Sundar S K , linux-gpio@vger.kernel.org, linux-wireless@vger.kernel.org, platform-driver-x86@vger.kernel.org Subject: Re: [RFC PATCH] genirq: Provide generic_handle_domain_irq_safe(). Message-ID: References: <20220516101814.GA18490@wunner.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220516101814.GA18490@wunner.de> 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-wireless@vger.kernel.org On 2022-05-16 12:18:14 [+0200], Lukas Wunner wrote: > On Mon, May 09, 2022 at 04:04:08PM +0200, Sebastian Andrzej Siewior wrote: > > The problem with generic_handle_domain_irq() is that with `threadirqs' > > it will trigger "WARN_ON_ONCE(!in_hardirq())". > > Now silenced by: > https://git.kernel.org/linus/792ea6a074ae > > > > +int generic_handle_domain_irq_safe(struct irq_domain *domain, unsigned int hwirq) > > +{ > > + unsigned long flags; > > + int ret; > > + > > + local_irq_save(flags); > > + ret = handle_irq_desc(irq_resolve_mapping(domain, hwirq)); > > + local_irq_restore(flags); > > + return ret; > > +} > > +EXPORT_SYMBOL_GPL(generic_handle_domain_irq_safe); > > AFAICS you don't need to disable hardirqs at least for the "threadirqs" > case because irq_forced_thread_fn() already does that. PREEMPT_RT does not disable interrupts. Also completions in softirq won't disable interrupts. > > > drivers/bcma/driver_gpio.c | 2 +- > > drivers/gpio/gpio-mlxbf2.c | 6 ++---- > > drivers/pinctrl/pinctrl-amd.c | 2 +- > > drivers/platform/x86/intel/int0002_vgpio.c | 3 +-- > > drivers/ssb/driver_gpio.c | 6 ++++-- > > From a quick look, the proper solution for all of those drivers is > probably to just add IRQF_NO_THREAD and be done with it. I think I mentioned that part in the commit description: IRQF_NO_THREAD must be specified by all handlers of a shared interrupt. It is an option for the handler that owns an interrupt exclusive. > Thanks, > > Lukas Sebastian