mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
genirq: Expose irq_find_desc_at_or_after() in core code
... in preparation for a smarter iterator for /proc/interrupts. Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: Michael Kelley <mhklinux@outlook.com> Reviewed-by: Dmitry Ilvokhin <d@ilvokhin.com> Link: https://patch.msgid.link/20260517194932.005787611@kernel.org
This commit is contained in:
parent
1d9c4745bf
commit
7603e0575d
|
|
@ -155,6 +155,8 @@ void irq_proc_calc_prec(void);
|
|||
static inline void irq_proc_calc_prec(void) { }
|
||||
#endif
|
||||
|
||||
struct irq_desc *irq_find_desc_at_or_after(unsigned int offset);
|
||||
|
||||
extern bool irq_can_set_affinity_usr(unsigned int irq);
|
||||
|
||||
extern int irq_do_set_affinity(struct irq_data *data,
|
||||
|
|
|
|||
|
|
@ -181,15 +181,12 @@ static int irq_find_free_area(unsigned int from, unsigned int cnt)
|
|||
return mas.index;
|
||||
}
|
||||
|
||||
static unsigned int irq_find_at_or_after(unsigned int offset)
|
||||
struct irq_desc *irq_find_desc_at_or_after(unsigned int offset)
|
||||
{
|
||||
unsigned long index = offset;
|
||||
struct irq_desc *desc;
|
||||
|
||||
guard(rcu)();
|
||||
desc = mt_find(&sparse_irqs, &index, total_nr_irqs);
|
||||
|
||||
return desc ? irq_desc_get_irq(desc) : total_nr_irqs;
|
||||
lockdep_assert_in_rcu_read_lock();
|
||||
return mt_find(&sparse_irqs, &index, total_nr_irqs);
|
||||
}
|
||||
|
||||
static void irq_insert_desc(unsigned int irq, struct irq_desc *desc)
|
||||
|
|
@ -934,7 +931,11 @@ EXPORT_SYMBOL_GPL(__irq_alloc_descs);
|
|||
*/
|
||||
unsigned int irq_get_next_irq(unsigned int offset)
|
||||
{
|
||||
return irq_find_at_or_after(offset);
|
||||
struct irq_desc *desc;
|
||||
|
||||
guard(rcu)();
|
||||
desc = irq_find_desc_at_or_after(offset);
|
||||
return desc ? irq_desc_get_irq(desc) : total_nr_irqs;
|
||||
}
|
||||
|
||||
struct irq_desc *__irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user