[PATCH v1 1/4] max3100: added raise_threaded_irq

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Christian Pellegrin
Date: Tuesday, March 23, 2010 - 3:28 am

raise_threaded_irq schedules the execution of an interrupt thread

Signed-off-by: Christian Pellegrin <chripell@fsfe.org>
---
 include/linux/interrupt.h |    3 +++
 kernel/irq/manage.c       |   27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 75f3f00..14c0c13 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -144,6 +144,9 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler,
 static inline void exit_irq_thread(void) { }
 #endif
 
+extern int raise_threaded_irq(unsigned int irq);
+
+
 extern void free_irq(unsigned int, void *);
 
 struct device;
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index eb6078c..a7d21e0 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1088,3 +1088,30 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
 	return retval;
 }
 EXPORT_SYMBOL(request_threaded_irq);
+
+/**
+ *	raise_threaded_irq - triggers a threded interrupt
+ *	@irq: Interrupt line to trigger
+ */
+int raise_threaded_irq(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+	struct irqaction *action;
+
+	if (!desc)
+		return -ENOENT;
+	action = desc->action;
+	if (!action)
+		return -ENOENT;
+	if (unlikely(!action->thread_fn))
+		return -EINVAL;
+	if (likely(!test_bit(IRQTF_DIED,
+			     &action->thread_flags))) {
+		set_bit(IRQTF_RUNTHREAD, &action->thread_flags);
+		wake_up_process(action->thread);
+	} else {
+		return -ECHILD;
+	}
+	return 0;
+}
+EXPORT_SYMBOL(raise_threaded_irq);
-- 
1.5.6.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v1 1/4] max3100: added raise_threaded_irq, Christian Pellegrin, (Tue Mar 23, 3:28 am)
[PATCH v1 2/4] max3100: moved to threaded interrupt, Christian Pellegrin, (Tue Mar 23, 3:29 am)
[PATCH v1 3/4] max3100: adds console support for MAX3100, Christian Pellegrin, (Tue Mar 23, 3:29 am)
[PATCH v1 0/3] max3100: improvements, christian pellegrin, (Tue Mar 23, 3:29 am)
[PATCH v1 4/4] max3100: introduced to_max3100_port, small ..., Christian Pellegrin, (Tue Mar 23, 3:29 am)
Re: [PATCH v1 3/4] max3100: adds console support for MAX3100, christian pellegrin, (Sun Mar 28, 11:11 pm)
Re: [PATCH v1 3/4] max3100: adds console support for MAX3100, christian pellegrin, (Mon Mar 29, 5:55 am)
Re: [PATCH v1 3/4] max3100: adds console support for MAX3100, christian pellegrin, (Thu Apr 8, 2:31 am)
Re: [PATCH v1 3/4] max3100: adds console support for MAX3100, christian pellegrin, (Thu Apr 8, 2:43 am)
Re: [PATCH v1 1/4] max3100: added raise_threaded_irq, Thomas Gleixner, (Thu Apr 15, 4:22 pm)
Re: [PATCH v1 1/4] max3100: added raise_threaded_irq, christian pellegrin, (Fri Apr 16, 9:18 am)
Re: [PATCH v1 1/4] max3100: added raise_threaded_irq, Thomas Gleixner, (Fri Apr 16, 3:06 pm)
Re: [PATCH v1 1/4] max3100: added raise_threaded_irq, christian pellegrin, (Sat Apr 17, 9:25 am)