[PATCH] x86/vector: Replace the raw_spin_lock() with raw_spin_lock_irqsave()

From: Dou Liyang
Date: Thu Dec 28 2017 - 03:20:48 EST


Signed-off-by: Dou Liyang <douly.fnst@xxxxxxxxxxxxxx>
---
arch/x86/kernel/apic/vector.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 750449152b04..a43ca26d5dfd 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -726,6 +726,7 @@ static int apic_set_affinity(struct irq_data *irqd,
const struct cpumask *dest, bool force)
{
struct apic_chip_data *apicd = apic_chip_data(irqd);
+ unsigned long flags;
int err;

/*
@@ -740,13 +741,13 @@ static int apic_set_affinity(struct irq_data *irqd,
(apicd->is_managed || apicd->can_reserve))
return IRQ_SET_MASK_OK;

- raw_spin_lock(&vector_lock);
+ raw_spin_lock_irqsave(&vector_lock, flags);
cpumask_and(vector_searchmask, dest, cpu_online_mask);
if (irqd_affinity_is_managed(irqd))
err = assign_managed_vector(irqd, vector_searchmask);
else
err = assign_vector_locked(irqd, vector_searchmask);
- raw_spin_unlock(&vector_lock);
+ raw_spin_unlock_irqrestore(&vector_lock, flags);
return err ? err : IRQ_SET_MASK_OK;
}

--
2.14.3


--------------BFAF4E4E7F82FA873D423A56--