diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-02-14 07:33:16 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-19 06:58:15 -0500 |
commit | 6f91a52d9bb28396177662f1da0f2e2cef9cf5d0 (patch) | |
tree | 0be983e2d1c1a622716cff61354f02e85ef3352e | |
parent | 7acdd53e5b2c55b6f7e3427e85e2f91fa814a4f9 (diff) |
genirq: Use modify_status for set_irq_nested_thread
No need for a separate function in the core code.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | include/linux/irq.h | 16 | ||||
-rw-r--r-- | kernel/irq/chip.c | 28 |
2 files changed, 13 insertions, 31 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index a900741b43ea..67b77cfb2a34 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -74,7 +74,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, | |||
74 | #define IRQF_MODIFY_MASK \ | 74 | #define IRQF_MODIFY_MASK \ |
75 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ | 75 | (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ |
76 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ | 76 | IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ |
77 | IRQ_PER_CPU) | 77 | IRQ_PER_CPU | IRQ_NESTED_THREAD) |
78 | 78 | ||
79 | #ifdef CONFIG_IRQ_PER_CPU | 79 | #ifdef CONFIG_IRQ_PER_CPU |
80 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 80 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
@@ -307,8 +307,6 @@ set_irq_chained_handler(unsigned int irq, irq_flow_handler_t handle) | |||
307 | __set_irq_handler(irq, handle, 1, NULL); | 307 | __set_irq_handler(irq, handle, 1, NULL); |
308 | } | 308 | } |
309 | 309 | ||
310 | extern void set_irq_nested_thread(unsigned int irq, int nest); | ||
311 | |||
312 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); | 310 | void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set); |
313 | 311 | ||
314 | static inline void irq_set_status_flags(unsigned int irq, unsigned long set) | 312 | static inline void irq_set_status_flags(unsigned int irq, unsigned long set) |
@@ -331,6 +329,14 @@ static inline void irq_set_probe(unsigned int irq) | |||
331 | irq_modify_status(irq, IRQ_NOPROBE, 0); | 329 | irq_modify_status(irq, IRQ_NOPROBE, 0); |
332 | } | 330 | } |
333 | 331 | ||
332 | static inline void irq_set_nested_thread(unsigned int irq, bool nest) | ||
333 | { | ||
334 | if (nest) | ||
335 | irq_set_status_flags(irq, IRQ_NESTED_THREAD); | ||
336 | else | ||
337 | irq_clear_status_flags(irq, IRQ_NESTED_THREAD); | ||
338 | } | ||
339 | |||
334 | /* Handle dynamic irq creation and destruction */ | 340 | /* Handle dynamic irq creation and destruction */ |
335 | extern unsigned int create_irq_nr(unsigned int irq_want, int node); | 341 | extern unsigned int create_irq_nr(unsigned int irq_want, int node); |
336 | extern int create_irq(void); | 342 | extern int create_irq(void); |
@@ -448,6 +454,10 @@ static inline void set_irq_probe(unsigned int irq) | |||
448 | { | 454 | { |
449 | irq_set_probe(irq); | 455 | irq_set_probe(irq); |
450 | } | 456 | } |
457 | static inline void set_irq_nested_thread(unsigned int irq, int nest) | ||
458 | { | ||
459 | irq_set_nested_thread(irq, nest); | ||
460 | } | ||
451 | #endif | 461 | #endif |
452 | 462 | ||
453 | int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); | 463 | int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 143eb2a9fa4e..bff21f233a02 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -164,34 +164,6 @@ struct irq_data *irq_get_irq_data(unsigned int irq) | |||
164 | } | 164 | } |
165 | EXPORT_SYMBOL_GPL(irq_get_irq_data); | 165 | EXPORT_SYMBOL_GPL(irq_get_irq_data); |
166 | 166 | ||
167 | /** | ||
168 | * set_irq_nested_thread - Set/Reset the IRQ_NESTED_THREAD flag of an irq | ||
169 | * | ||
170 | * @irq: Interrupt number | ||
171 | * @nest: 0 to clear / 1 to set the IRQ_NESTED_THREAD flag | ||
172 | * | ||
173 | * The IRQ_NESTED_THREAD flag indicates that on | ||
174 | * request_threaded_irq() no separate interrupt thread should be | ||
175 | * created for the irq as the handler are called nested in the | ||
176 | * context of a demultiplexing interrupt handler thread. | ||
177 | */ | ||
178 | void set_irq_nested_thread(unsigned int irq, int nest) | ||
179 | { | ||
180 | struct irq_desc *desc = irq_to_desc(irq); | ||
181 | unsigned long flags; | ||
182 | |||
183 | if (!desc) | ||
184 | return; | ||
185 | |||
186 | raw_spin_lock_irqsave(&desc->lock, flags); | ||
187 | if (nest) | ||
188 | desc->status |= IRQ_NESTED_THREAD; | ||
189 | else | ||
190 | desc->status &= ~IRQ_NESTED_THREAD; | ||
191 | raw_spin_unlock_irqrestore(&desc->lock, flags); | ||
192 | } | ||
193 | EXPORT_SYMBOL_GPL(set_irq_nested_thread); | ||
194 | |||
195 | int irq_startup(struct irq_desc *desc) | 167 | int irq_startup(struct irq_desc *desc) |
196 | { | 168 | { |
197 | desc->status &= ~IRQ_DISABLED; | 169 | desc->status &= ~IRQ_DISABLED; |