All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Sebastian Andrzej Siewior" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Hans de Goede <hdegoede@redhat.com>,
	Oleksandr Natalenko <oleksandr@natalenko.name>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org, maz@kernel.org
Subject: [tip: irq/core] genirq: Provide generic_handle_irq_safe()
Date: Mon, 21 Feb 2022 11:19:44 -0000	[thread overview]
Message-ID: <164544238423.16921.14685093775166733539.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20220211181500.1856198-2-bigeasy@linutronix.de>

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     509853f9e1e7b1490dc79f735a5dbafc9298f40d
Gitweb:        https://git.kernel.org/tip/509853f9e1e7b1490dc79f735a5dbafc9298f40d
Author:        Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate:    Fri, 11 Feb 2022 19:14:54 +01:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 21 Feb 2022 11:31:06 +01:00

genirq: Provide generic_handle_irq_safe()

Provide generic_handle_irq_safe() which can used from any context.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220211181500.1856198-2-bigeasy@linutronix.de
---
 include/linux/irqdesc.h |  1 +
 kernel/irq/irqdesc.c    | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 93d270c..a775845 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 2267e65..346d283 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -662,6 +662,29 @@ int generic_handle_irq(unsigned int irq)
 }
 EXPORT_SYMBOL_GPL(generic_handle_irq);
 
+/**
+ * generic_handle_irq_safe - Invoke the handler for a particular irq from any
+ *			     context.
+ * @irq:	The irq number to handle
+ *
+ * Returns:	0 on success, a negative value on error.
+ *
+ * This function can be called from any context (IRQ or process context). It
+ * will report an error if not invoked from IRQ context and the irq has been
+ * marked to enforce IRQ-context only.
+ */
+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

  reply	other threads:[~2022-02-21 11:25 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 18:14 [PATCH v4 0/7] Provide and use generic_handle_irq_safe() where appropriate Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 1/7] genirq: Provide generic_handle_irq_safe() Sebastian Andrzej Siewior
2022-02-21 11:19   ` tip-bot2 for Sebastian Andrzej Siewior [this message]
2022-02-11 18:14 ` [PATCH v4 2/7] i2c: core: Use generic_handle_irq_safe() in i2c_handle_smbus_host_notify() Sebastian Andrzej Siewior
2022-02-23 13:21   ` Wolfram Sang
2022-02-25 22:26     ` Sebastian Andrzej Siewior
2022-03-01 15:06       ` Wolfram Sang
2022-02-11 18:14 ` [PATCH v4 3/7] i2c: cht-wc: Use generic_handle_irq_safe() Sebastian Andrzej Siewior
2022-02-23 13:21   ` Wolfram Sang
2022-02-11 18:14 ` [PATCH v4 4/7] misc: hi6421-spmi-pmic: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 5/7] mfd: ezx-pcap: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:14 ` [PATCH v4 6/7] net: usb: lan78xx: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-11 18:15 ` [PATCH v4 7/7] staging: greybus: gpio: " Sebastian Andrzej Siewior
2022-03-02 21:35   ` [tip: irq/core] " tip-bot2 for Sebastian Andrzej Siewior
2022-02-15 14:36 ` [PATCH v4 0/7] Provide and use generic_handle_irq_safe() where appropriate Lee Jones
2022-02-15 14:50   ` Sebastian Andrzej Siewior
2022-02-15 15:16     ` Lee Jones
2022-02-15 15:33       ` Sebastian Andrzej Siewior
2022-02-15 15:42         ` Lee Jones
2022-02-15 15:46           ` Sebastian Andrzej Siewior
2022-02-21  9:57           ` Thomas Gleixner
2022-02-21 11:33             ` Thomas Gleixner
2022-02-21 12:38               ` Lee Jones
2022-02-23 13:19               ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164544238423.16921.14685093775166733539.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oleksandr@natalenko.name \
    --cc=tglx@linutronix.de \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.