Skip to content

Commit e54b1b5

Browse files
avpatelKAGA-KOKO
authored andcommitted
genirq: Introduce irq_can_move_in_process_context()
Interrupt controller drivers which enable CONFIG_GENERIC_PENDING_IRQ require to know whether an interrupt can be moved in process context or not to decide whether they need to invoke the work around for non-atomic MSI updates or not. This information can be retrieved via irq_can_move_pcntxt(). That helper requires access to the top-most interrupt domain data, but the driver which requires this is usually further down in the hierarchy. Introduce irq_can_move_in_process_context() which retrieves that information from the top-most interrupt domain data. [ tglx: Massaged change log ] Signed-off-by: Anup Patel <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 751dc83 commit e54b1b5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/linux/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ extern int irq_affinity_online_cpu(unsigned int cpu);
615615
#endif
616616

617617
#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
618+
bool irq_can_move_in_process_context(struct irq_data *data);
618619
void __irq_move_irq(struct irq_data *data);
619620
static inline void irq_move_irq(struct irq_data *data)
620621
{
@@ -623,6 +624,7 @@ static inline void irq_move_irq(struct irq_data *data)
623624
}
624625
void irq_move_masked_irq(struct irq_data *data);
625626
#else
627+
static inline bool irq_can_move_in_process_context(struct irq_data *data) { return true; }
626628
static inline void irq_move_irq(struct irq_data *data) { }
627629
static inline void irq_move_masked_irq(struct irq_data *data) { }
628630
#endif

kernel/irq/migration.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,13 @@ void __irq_move_irq(struct irq_data *idata)
127127
if (!masked)
128128
idata->chip->irq_unmask(idata);
129129
}
130+
131+
bool irq_can_move_in_process_context(struct irq_data *data)
132+
{
133+
/*
134+
* Get the top level irq_data in the hierarchy, which is optimized
135+
* away when CONFIG_IRQ_DOMAIN_HIERARCHY is disabled.
136+
*/
137+
data = irq_desc_get_irq_data(irq_data_to_desc(data));
138+
return irq_can_move_pcntxt(data);
139+
}

0 commit comments

Comments
 (0)