lkml.org 
[lkml]   [2013]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] x86/io_apic: Do not unmask the masked-irq when migrating irq in ack_apic_level()
From
Date

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 <chuansheng.liu@intel.com>
---
arch/x86/kernel/apic/io_apic.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b739d39..5c0fe25 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -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
--
1.7.0.4




\
 
 \ /
  Last update: 2013-02-01 04:41    [W:0.184 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site