Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp296660pxb; Thu, 27 Jan 2022 22:23:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFmY2UwQX4guB71ouJ8boci8gQUqd3m4PzoRhheFGmnHDMVe1xTXvbLOZohR06gzAAt5o8 X-Received: by 2002:a17:907:6da5:: with SMTP id sb37mr5469684ejc.768.1643351021035; Thu, 27 Jan 2022 22:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643351021; cv=none; d=google.com; s=arc-20160816; b=wDBfas1+rSF0dNt/EgbMqCsVgvk0lIJYNBfFASGyPuMoofLnOJq0x3K66DMlh4yQQq o8iMJ5SZ5cV71QzVImU8Swm7YWRxB/VKNeEiwsqKRGSUD1YmmvidXvoCPmTYIeoRIYx6 wi7c3JWF5FeGNFBoHMML88ZM0/O/jHWRRiDOdnluASJD1nfociPKO+ntNeklNNdFO1FI I/1IF0dwtFqbRH04hUHpL8bADL0nkNCqeBYfII73eLA2yg7i8H3UEOS1M0lRN1+JoaGt kwuFnwLJCCMIXApP98WLXWsafnYj3DaiyPpq37j3MFEhkoyFk9g8e752Ml6jB1VuXVBs FIvQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OkaYBUaQDMs19i4HXWrJsJm9o280IUe9ric8r65dz6o=; b=iYEDH3Xqf72SHf5A0XOjO5R+9C9V6gemtNYEP+fZzqJkXR0Gn6L2ZuyX4d7SwkxaEm H+XQB3Kd9xzZtgbQyr43ZztTaV3GHECjKj/nmUGBsxazd+SPMv3XBUOv97MpUdDap5Rb IwllxpbMC/3wChJisQHuxnAetckovghDfAGE2y/lSgjt5ZI6Dn1IAICZEuS7HuAvZ5hx bayrVTDEqZLi3ljZfZe3TiaU2GtibakSvrbRrVuoGsm7XnQcCKMXfzaUQoAPi4r4R2Ll orLtKQwIfR3xC0YJvOfgN2j7XFSvoJ6iuto7y/K/kKC/7MwbLKGem/IGdr39AGTKBaBI 46Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=b3G9grRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sh10si2465990ejc.10.2022.01.27.22.23.16; Thu, 27 Jan 2022 22:23:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=b3G9grRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242527AbiA0Oks (ORCPT + 99 others); Thu, 27 Jan 2022 09:40:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231443AbiA0Okr (ORCPT ); Thu, 27 Jan 2022 09:40:47 -0500 Received: from vulcan.natalenko.name (vulcan.natalenko.name [IPv6:2001:19f0:6c00:8846:5400:ff:fe0c:dfa0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE88C061714 for ; Thu, 27 Jan 2022 06:40:46 -0800 (PST) Received: from spock.localnet (unknown [83.148.33.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id 4BEBCD8B22F; Thu, 27 Jan 2022 15:40:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1643294441; 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=OkaYBUaQDMs19i4HXWrJsJm9o280IUe9ric8r65dz6o=; b=b3G9grRz8fhqkUesaxFiZYnVSzSaACXLpHjBzkwG+iE6FOB6Cmuw+Oy3MuAw6tkBb6NOsL wUO74jv79omeTLK4hbzu5aKyLqYQkvwFVJ1iC3lvAQGuk4t6AjRP5yPPjznvIcg+h89tMJ HGbRVAy8T9dtZ1WaUSRHpoK6niUcv1U= From: Oleksandr Natalenko To: greybus-dev@lists.linaro.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-usb@vger.kernel.org, netdev@vger.kernel.org, Sebastian Andrzej Siewior Cc: "David S. Miller" , Alex Elder , Arnd Bergmann , Greg Kroah-Hartman , Hans de Goede , Jakub Kicinski , Johan Hovold , Lee Jones , Rui Miguel Silva , Thomas Gleixner , UNGLinuxDriver@microchip.com, Wolfram Sang , Woojung Huh , Sebastian Andrzej Siewior Subject: Re: [PATCH 1/7] genirq: Provide generic_handle_irq_safe(). Date: Thu, 27 Jan 2022 15:40:39 +0100 Message-ID: <5753562.DvuYhMxLoT@natalenko.name> In-Reply-To: <20220127113303.3012207-2-bigeasy@linutronix.de> References: <20220127113303.3012207-1-bigeasy@linutronix.de> <20220127113303.3012207-2-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On =C4=8Dtvrtek 27. ledna 2022 12:32:57 CET Sebastian Andrzej Siewior wrote: > Provide generic_handle_irq_safe() which can be used can used from any > context. >=20 > Suggested-by: Thomas Gleixner > Signed-off-by: Sebastian Andrzej Siewior > --- > include/linux/irqdesc.h | 1 + > kernel/irq/irqdesc.c | 21 +++++++++++++++++++++ > 2 files changed, 22 insertions(+) >=20 > diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h > index 93d270ca0c567..a77584593f7d1 100644 > --- a/include/linux/irqdesc.h > +++ b/include/linux/irqdesc.h > @@ -160,6 +160,7 @@ static inline void generic_handle_irq_desc(struct irq= _desc *desc) > =20 > int handle_irq_desc(struct irq_desc *desc); > int generic_handle_irq(unsigned int irq); > +int generic_handle_irq_safe(unsigned int irq); > =20 > #ifdef CONFIG_IRQ_DOMAIN > /* > diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c > index 2267e6527db3c..97223df2f460e 100644 > --- a/kernel/irq/irqdesc.c > +++ b/kernel/irq/irqdesc.c > @@ -662,6 +662,27 @@ int generic_handle_irq(unsigned int irq) > } > EXPORT_SYMBOL_GPL(generic_handle_irq); > =20 > +/** > + * generic_handle_irq_safe - Invoke the handler for a particular irq > + * @irq: The irq number to handle > + * > + * Returns: 0 on success, or -EINVAL if conversion has failed > + * > + * This function must be called either from an IRQ context with irq regs > + * initialized or with care from any context. > + */ > +int generic_handle_irq_safe(unsigned int irq) > +{ > + unsigned long flags; > + int ret; > + > + local_irq_save(flags); > + ret =3D handle_irq_desc(irq_to_desc(irq)); > + local_irq_restore(flags); > + return ret; > +} > +EXPORT_SYMBOL_GPL(generic_handle_irq_safe); > + > #ifdef CONFIG_IRQ_DOMAIN > /** > * generic_handle_domain_irq - Invoke the handler for a HW irq belonging >=20 Reviewed-by: Oleksandr Natalenko Thank you. =2D-=20 Oleksandr Natalenko (post-factum)