Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6360115pxb; Thu, 27 Jan 2022 12:05:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjRYvlObdrPRxDTeNtqjZFAtbW+W8VcZs5IpGYEgqXYj16a3unJkVIFrvKS/bdOZdYCTRr X-Received: by 2002:a17:902:a40d:: with SMTP id p13mr5141638plq.128.1643313914584; Thu, 27 Jan 2022 12:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643313914; cv=none; d=google.com; s=arc-20160816; b=Gs/9kkLdoGxnA7wsNPwaSTfOjEHY/RBdVaztvMYkuCq5VLMf5Mv9rqAxcptDV5B+1G WvxvytQyMx83tDVgaBalMGNKLBv54nK5ignDkbiiQnbYuPKsQvq2ss0tjo1TySe0EX0q yXyynY5L3MabWV+OG32tFNv2erpKUyFvDnyUEdsqlTsb3tZN27sXAe3+eOw3zkCunBNS Jt0DUob1EHUZo8pc7HCfg1czrVIT5O4Al+Y+btqhl1otClUeY81nqW8T4MABiYw8Yn5v LF4cI8kINmUF4xhDZuZ5GaASJDATMvOJNXdxYfyg/3Jrv9f80nuAUjX/mfpPevxNGWcI h2qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=HGE7gxF/PrZOO5rcFzZ+w+MYUdoGMxbWWIjy9mknwZE=; b=iMWIMQsonlhqxAVfd28kUsh37uo2zBOG4V7ghZAZlcTIr6qYeFzvauADIeRu6+irnj WSrx7G8grWL4D8ZnKPKwffH5NBDkWMMYVJ4TiWWEArHlJKu53pbzRcI0vaFujGcQ8T4l N1mYE7BDUCfYZt0lXe51J2R8XJuIJqhusHa1yuddvCF8vVnG/YEh7Ex3o7SZC8ScgNcM JFvyF9rEsINFblvFziTt1Y7RtIE/qRogEs1wnkOO6pCKOjtTooq69FLECL7CiFu3nKQd gwp8ae+X7J5MTNgmndMfuncSu602Z7+vW4OcQd2SfP7uwpE4Jkr4Un2/BU9V3BRDuqMH Tdhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i7jHfFD6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l2si3326782pls.150.2022.01.27.12.05.01; Thu, 27 Jan 2022 12:05:14 -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=@redhat.com header.s=mimecast20190719 header.b=i7jHfFD6; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240839AbiA0LsH (ORCPT + 99 others); Thu, 27 Jan 2022 06:48:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34300 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240196AbiA0LsG (ORCPT ); Thu, 27 Jan 2022 06:48:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643284085; 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=HGE7gxF/PrZOO5rcFzZ+w+MYUdoGMxbWWIjy9mknwZE=; b=i7jHfFD6GHIUq+GaqQH75gIOYuVAhNEoGoxpf4XsVhrkQuNpyQe9a3P55Q9djwgZjCYJIU bv2VhUniS2H/Yx2v3W+EeGjrZbs5/r6pguZyWk+7spWldVDBhjmubI0RvNCdz7bM6gb1IP WfhPjqd6oesvHid94oGYAVlfVboYxzs= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-aP4E7iLJPpaCQ1lyessATA-1; Thu, 27 Jan 2022 06:48:03 -0500 X-MC-Unique: aP4E7iLJPpaCQ1lyessATA-1 Received: by mail-ed1-f70.google.com with SMTP id a18-20020aa7d752000000b00403d18712beso1284726eds.17 for ; Thu, 27 Jan 2022 03:48:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=HGE7gxF/PrZOO5rcFzZ+w+MYUdoGMxbWWIjy9mknwZE=; b=4pIBIjTembUz0N1bV4zldQbbJTJMFEZLJeFtt2Pn0qJlXyY5hJWb+DNQvjoBWXuuIA Zm9QF86OxIJDUuVfOf1UJLl9iiXyaVPOvj0myNyP+lbxFPjfnQkaDd3stzgB6y5dwXrb qYIYJw2hy2bXjWkpX/slnRltEYCvH6bpY7NWe04Is5gx96EVyarYb6lsJ66azuMdponl nRS2fTx9de+NK6+cdweQI6NIAJppNLZ4qwcJZzjGzlDjun49ivyHKo11mF4N8dRa3bm+ Rh9ATM3Qe0UkQZp6EAaam80R2VKd0+5cdpdJPlPDyrh/o1/IARYSZmfsq6K3KjDU9Vhb rVQg== X-Gm-Message-State: AOAM533A2zUvK25zhE9/wE7Ti1nrESRA0bxhxHbRr9uRyvHqhJpTR2Lh qzmSwYcFGVWKjqYXLVQwuZ7YRuFZc4pzWnHU51XQOxO4VZOlZn4bXRJZcfIcyLTJPHqhnC76l8P 3H4wt7I/iesl/OZmQgmQnDZ2t X-Received: by 2002:a17:907:7241:: with SMTP id ds1mr2705643ejc.199.1643284082707; Thu, 27 Jan 2022 03:48:02 -0800 (PST) X-Received: by 2002:a17:907:7241:: with SMTP id ds1mr2705630ejc.199.1643284082537; Thu, 27 Jan 2022 03:48:02 -0800 (PST) Received: from ?IPV6:2001:1c00:c1e:bf00:1db8:22d3:1bc9:8ca1? (2001-1c00-0c1e-bf00-1db8-22d3-1bc9-8ca1.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1db8:22d3:1bc9:8ca1]) by smtp.gmail.com with ESMTPSA id cf13sm8735609ejb.141.2022.01.27.03.48.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Jan 2022 03:48:02 -0800 (PST) Message-ID: Date: Thu, 27 Jan 2022 12:48:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 1/7] genirq: Provide generic_handle_irq_safe(). Content-Language: en-US To: Sebastian Andrzej Siewior , 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 Cc: "David S. Miller" , Alex Elder , Arnd Bergmann , Greg Kroah-Hartman , Jakub Kicinski , Johan Hovold , Lee Jones , Rui Miguel Silva , Thomas Gleixner , UNGLinuxDriver@microchip.com, Wolfram Sang , Woojung Huh References: <20220127113303.3012207-1-bigeasy@linutronix.de> <20220127113303.3012207-2-bigeasy@linutronix.de> From: Hans de Goede In-Reply-To: <20220127113303.3012207-2-bigeasy@linutronix.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 1/27/22 12:32, Sebastian Andrzej Siewior wrote: > Provide generic_handle_irq_safe() which can be used can used from any > context. > > Suggested-by: Thomas Gleixner > Signed-off-by: Sebastian Andrzej Siewior Thanks, patch looks good to me: Reviewed-by: Hans de Goede Regards, Hans > --- > include/linux/irqdesc.h | 1 + > kernel/irq/irqdesc.c | 21 +++++++++++++++++++++ > 2 files changed, 22 insertions(+) > > 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) > > int handle_irq_desc(struct irq_desc *desc); > int generic_handle_irq(unsigned int irq); > +int generic_handle_irq_safe(unsigned int irq); > > #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); > > +/** > + * 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 = 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 >