Skip to content

Commit 6f91a52

Browse files
committed
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>
1 parent 7acdd53 commit 6f91a52

2 files changed

Lines changed: 13 additions & 31 deletions

File tree

‎include/linux/irq.h‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
7474
#define IRQF_MODIFY_MASK \
7575
(IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
7676
IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
77-
IRQ_PER_CPU)
77+
IRQ_PER_CPU | IRQ_NESTED_THREAD)
7878

7979
#ifdef CONFIG_IRQ_PER_CPU
8080
# 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)
307307
__set_irq_handler(irq, handle, 1, NULL);
308308
}
309309

310-
extern void set_irq_nested_thread(unsigned int irq, int nest);
311-
312310
void irq_modify_status(unsigned int irq, unsigned long clr, unsigned long set);
313311

314312
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)
331329
irq_modify_status(irq, IRQ_NOPROBE, 0);
332330
}
333331

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+
334340
/* Handle dynamic irq creation and destruction */
335341
extern unsigned int create_irq_nr(unsigned int irq_want, int node);
336342
extern int create_irq(void);
@@ -448,6 +454,10 @@ static inline void set_irq_probe(unsigned int irq)
448454
{
449455
irq_set_probe(irq);
450456
}
457+
static inline void set_irq_nested_thread(unsigned int irq, int nest)
458+
{
459+
irq_set_nested_thread(irq, nest);
460+
}
451461
#endif
452462

453463
int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node);

‎kernel/irq/chip.c‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -164,34 +164,6 @@ struct irq_data *irq_get_irq_data(unsigned int irq)
164164
}
165165
EXPORT_SYMBOL_GPL(irq_get_irq_data);
166166

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-
195167
int irq_startup(struct irq_desc *desc)
196168
{
197169
desc->status &= ~IRQ_DISABLED;

0 commit comments

Comments
 (0)