mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/io_apic: Do not unmask the masked-irq when migrating irq in ack_apic_level()
@ 2013-02-01 12:05 Chuansheng Liu
  0 siblings, 0 replies; only message in thread
From: Chuansheng Liu @ 2013-02-01 12:05 UTC (permalink / raw)
  To: agordeev, yinghai, joerg.roedel, suresh.b.siddha, tglx, mingo, hpa
  Cc: x86, linux-kernel, chuansheng.liu


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-02-01  2:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-01 12:05 [PATCH] x86/io_apic: Do not unmask the masked-irq when migrating irq in ack_apic_level() Chuansheng Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®