diff options
Diffstat (limited to 'arch/x86_64/kernel/io_apic.c')
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 38a3ff30bde1..519cd4e6f9e7 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -836,14 +836,15 @@ u8 irq_vector[NR_IRQ_VECTORS] __read_mostly = { FIRST_DEVICE_VECTOR , 0 }; | |||
836 | int assign_irq_vector(int irq) | 836 | int assign_irq_vector(int irq) |
837 | { | 837 | { |
838 | static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; | 838 | static int current_vector = FIRST_DEVICE_VECTOR, offset = 0; |
839 | unsigned long flags; | ||
839 | int vector; | 840 | int vector; |
840 | 841 | ||
841 | BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS); | 842 | BUG_ON(irq != AUTO_ASSIGN && (unsigned)irq >= NR_IRQ_VECTORS); |
842 | 843 | ||
843 | spin_lock(&vector_lock); | 844 | spin_lock_irqsave(&vector_lock, flags); |
844 | 845 | ||
845 | if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0) { | 846 | if (irq != AUTO_ASSIGN && IO_APIC_VECTOR(irq) > 0) { |
846 | spin_unlock(&vector_lock); | 847 | spin_unlock_irqrestore(&vector_lock, flags); |
847 | return IO_APIC_VECTOR(irq); | 848 | return IO_APIC_VECTOR(irq); |
848 | } | 849 | } |
849 | next: | 850 | next: |
@@ -862,7 +863,7 @@ next: | |||
862 | if (irq != AUTO_ASSIGN) | 863 | if (irq != AUTO_ASSIGN) |
863 | IO_APIC_VECTOR(irq) = vector; | 864 | IO_APIC_VECTOR(irq) = vector; |
864 | 865 | ||
865 | spin_unlock(&vector_lock); | 866 | spin_unlock_irqrestore(&vector_lock, flags); |
866 | 867 | ||
867 | return vector; | 868 | return vector; |
868 | } | 869 | } |