x86/io_apic: Do not unmask the masked-irq when migrating irq in ack_apic_level()
PATCH 1/1 x86/io_apic: Do not unmask the masked-irq when migrating irq in ack_apic_level()
In ack_apic_level(), when there is pending affinity setting for current irq, ioapic_irqd_mask()/ioapic_irqd_unmask() will try to mask the irq and do the irq affinity setting.
But at this time, it is possibility that the irq has been masked, in this case, we should not unmask it directly in ioapic_irqd_unmask().
One real case is one threaded interrupt with ONE_SHOT, the irq has been masked in handle_fasteoi_irq().
Signed-off-by liu chuansheng <[email protected]>
--- arch/x86/kernel/apic/io_apic.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
arch/x86/kernel/apic/io_apic.c +9 -2
@@ -2429,7 +2429,8 @@ static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) {/* If we are moving the irq we need to mask it */ if (unlikely (irqd_is_setaffinity_pending (data))) { -mask_ioapic (cfg); +if (!irqd_irq_masked (data)) +mask_ioapic (cfg);return true; }return false;
@@ -2467,7 +2468,13 @@ static inline void ioapic_irqd_unmask(struct irq_data *data,*/ if (!io_apic_level_ack_pending (cfg))irq_move_masked_irq (data); - unmask_ioapic(cfg); +/* +* For the threaded interrupt with ONE_SHOT flag, +* the irq has been masked in handle_fasteoi_irq(). +* We should be careful not to unmask it here. +*/ +if (!irqd_irq_masked (data)) + unmask_ioapic(cfg); } }#else
Signature · 1 line
1.7.0.4