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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D58B0C433F5 for ; Mon, 16 May 2022 10:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233684AbiEPKSS (ORCPT ); Mon, 16 May 2022 06:18:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233302AbiEPKSQ (ORCPT ); Mon, 16 May 2022 06:18:16 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434E0DE97; Mon, 16 May 2022 03:18:16 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id EB3D4300002A8; Mon, 16 May 2022 12:18:14 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id DF4F129FE74; Mon, 16 May 2022 12:18:14 +0200 (CEST) Date: Mon, 16 May 2022 12:18:14 +0200 From: Lukas Wunner To: Sebastian Andrzej Siewior 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: <20220516101814.GA18490@wunner.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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. > 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. Thanks, Lukas