aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-10-12 05:05:28 -0400
committerThomas Gleixner <tglx@linutronix.de>2017-10-12 06:58:15 -0400
commit02edee152d6ea325c88898f3a702f5db2d78de7a (patch)
treeb11aad3c4af3d1519fec6a23a94b5993e3753736
parent331b57d14829c49d75076779cdc54d7e4537bbf0 (diff)
x86/apic/vector: Ignore set_affinity call for inactive interrupts
The core interrupt code can call the affinity setter for inactive interrupts under certain circumstances. For inactive intererupts which use managed or reservation mode this is a pointless exercise as the activation will assign a vector which fits the destination mask. Check for this and return w/o going through the vector assignment. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--arch/x86/kernel/apic/vector.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 6789e286def9..573538e0981e 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -726,8 +726,21 @@ void lapic_offline(void)
726static int apic_set_affinity(struct irq_data *irqd, 726static int apic_set_affinity(struct irq_data *irqd,
727 const struct cpumask *dest, bool force) 727 const struct cpumask *dest, bool force)
728{ 728{
729 struct apic_chip_data *apicd = apic_chip_data(irqd);
729 int err; 730 int err;
730 731
732 /*
733 * Core code can call here for inactive interrupts. For inactive
734 * interrupts which use managed or reservation mode there is no
735 * point in going through the vector assignment right now as the
736 * activation will assign a vector which fits the destination
737 * cpumask. Let the core code store the destination mask and be
738 * done with it.
739 */
740 if (!irqd_is_activated(irqd) &&
741 (apicd->is_managed || apicd->can_reserve))
742 return IRQ_SET_MASK_OK;
743
731 raw_spin_lock(&vector_lock); 744 raw_spin_lock(&vector_lock);
732 cpumask_and(vector_searchmask, dest, cpu_online_mask); 745 cpumask_and(vector_searchmask, dest, cpu_online_mask);
733 if (irqd_affinity_is_managed(irqd)) 746 if (irqd_affinity_is_managed(irqd))