2007-12-11 23:05:36

by Kevin Hilman

[permalink] [raw]
Subject: [PATCH] Generic IRQ: Add unlocked version of set_irq_handler()

Add unlocked version for use by irq_chip.set_type handlers which may
wish to change handler to level or edge handler when IRQ type is
changed.

The normal set_irq_handler() call cannot be used because it tries to
take irq_desc.lock which is already held when the irq_chip.set_type
hook is called.

Signed-off-by: Kevin Hilman <[email protected]>
---
include/linux/irq.h | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index efc8853..4669be0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -339,6 +339,13 @@ extern void
__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
const char *name);

+/* caller has locked the irq_desc and both params are valid */
+static inline void __set_irq_handler_unlocked(int irq,
+ irq_flow_handler_t handler)
+{
+ irq_desc[irq].handle_irq = handler;
+}
+
/*
* Set a highlevel flow handler for a given IRQ:
*/
--
1.5.3.7


2007-12-12 10:25:11

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] Generic IRQ: Add unlocked version of set_irq_handler()


* Kevin Hilman <[email protected]> wrote:

> Add unlocked version for use by irq_chip.set_type handlers which may
> wish to change handler to level or edge handler when IRQ type is
> changed.
>
> The normal set_irq_handler() call cannot be used because it tries to
> take irq_desc.lock which is already held when the irq_chip.set_type
> hook is called.

looks fine to me. Thomas?

Ingo

2007-12-12 15:15:59

by Thomas Gleixner

[permalink] [raw]
Subject: Re: [PATCH] Generic IRQ: Add unlocked version of set_irq_handler()

On Wed, 12 Dec 2007, Ingo Molnar wrote:

>
> * Kevin Hilman <[email protected]> wrote:
>
> > Add unlocked version for use by irq_chip.set_type handlers which may
> > wish to change handler to level or edge handler when IRQ type is
> > changed.
> >
> > The normal set_irq_handler() call cannot be used because it tries to
> > take irq_desc.lock which is already held when the irq_chip.set_type
> > hook is called.
>
> looks fine to me. Thomas?

Acked-by: Thomas Gleixner <[email protected]>