diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 23:03:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-12 23:03:47 -0400 |
commit | 71998d1be4ae70e7d320cdd21595c1a02a29c61e (patch) | |
tree | ae386748d50db8b116d0eeaee2106f0f5f9b1c07 /arch/x86 | |
parent | b2e09f633a3994ee97fa6bc734b533d9c8e6ea0f (diff) | |
parent | fb24da805729ee4a83efa34015948f7d64da4b28 (diff) |
Merge branch 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 irq fixes from Ingo Molnar:
"Two changes: a cpu-hotplug/irq race fix, plus a HyperV related fix"
* 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/irq: Fix fixup_irqs() error handling
x86, irq, pic: Probe for legacy PIC and set legacy_pic appropriately
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mshyperv.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/i8259.c | 20 | ||||
-rw-r--r-- | arch/x86/kernel/irq.c | 13 |
4 files changed, 46 insertions, 24 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 9d0a9795a0f8..81e08eff05ee 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2297,7 +2297,7 @@ int __ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
2297 | int err; | 2297 | int err; |
2298 | 2298 | ||
2299 | if (!config_enabled(CONFIG_SMP)) | 2299 | if (!config_enabled(CONFIG_SMP)) |
2300 | return -1; | 2300 | return -EPERM; |
2301 | 2301 | ||
2302 | if (!cpumask_intersects(mask, cpu_online_mask)) | 2302 | if (!cpumask_intersects(mask, cpu_online_mask)) |
2303 | return -EINVAL; | 2303 | return -EINVAL; |
@@ -2328,7 +2328,7 @@ int native_ioapic_set_affinity(struct irq_data *data, | |||
2328 | int ret; | 2328 | int ret; |
2329 | 2329 | ||
2330 | if (!config_enabled(CONFIG_SMP)) | 2330 | if (!config_enabled(CONFIG_SMP)) |
2331 | return -1; | 2331 | return -EPERM; |
2332 | 2332 | ||
2333 | raw_spin_lock_irqsave(&ioapic_lock, flags); | 2333 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
2334 | ret = __ioapic_set_affinity(data, mask, &dest); | 2334 | ret = __ioapic_set_affinity(data, mask, &dest); |
@@ -3001,9 +3001,11 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) | |||
3001 | struct irq_cfg *cfg = data->chip_data; | 3001 | struct irq_cfg *cfg = data->chip_data; |
3002 | struct msi_msg msg; | 3002 | struct msi_msg msg; |
3003 | unsigned int dest; | 3003 | unsigned int dest; |
3004 | int ret; | ||
3004 | 3005 | ||
3005 | if (__ioapic_set_affinity(data, mask, &dest)) | 3006 | ret = __ioapic_set_affinity(data, mask, &dest); |
3006 | return -1; | 3007 | if (ret) |
3008 | return ret; | ||
3007 | 3009 | ||
3008 | __get_cached_msi_msg(data->msi_desc, &msg); | 3010 | __get_cached_msi_msg(data->msi_desc, &msg); |
3009 | 3011 | ||
@@ -3100,9 +3102,11 @@ dmar_msi_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
3100 | struct irq_cfg *cfg = data->chip_data; | 3102 | struct irq_cfg *cfg = data->chip_data; |
3101 | unsigned int dest, irq = data->irq; | 3103 | unsigned int dest, irq = data->irq; |
3102 | struct msi_msg msg; | 3104 | struct msi_msg msg; |
3105 | int ret; | ||
3103 | 3106 | ||
3104 | if (__ioapic_set_affinity(data, mask, &dest)) | 3107 | ret = __ioapic_set_affinity(data, mask, &dest); |
3105 | return -1; | 3108 | if (ret) |
3109 | return ret; | ||
3106 | 3110 | ||
3107 | dmar_msi_read(irq, &msg); | 3111 | dmar_msi_read(irq, &msg); |
3108 | 3112 | ||
@@ -3149,9 +3153,11 @@ static int hpet_msi_set_affinity(struct irq_data *data, | |||
3149 | struct irq_cfg *cfg = data->chip_data; | 3153 | struct irq_cfg *cfg = data->chip_data; |
3150 | struct msi_msg msg; | 3154 | struct msi_msg msg; |
3151 | unsigned int dest; | 3155 | unsigned int dest; |
3156 | int ret; | ||
3152 | 3157 | ||
3153 | if (__ioapic_set_affinity(data, mask, &dest)) | 3158 | ret = __ioapic_set_affinity(data, mask, &dest); |
3154 | return -1; | 3159 | if (ret) |
3160 | return ret; | ||
3155 | 3161 | ||
3156 | hpet_msi_read(data->handler_data, &msg); | 3162 | hpet_msi_read(data->handler_data, &msg); |
3157 | 3163 | ||
@@ -3218,9 +3224,11 @@ ht_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force) | |||
3218 | { | 3224 | { |
3219 | struct irq_cfg *cfg = data->chip_data; | 3225 | struct irq_cfg *cfg = data->chip_data; |
3220 | unsigned int dest; | 3226 | unsigned int dest; |
3227 | int ret; | ||
3221 | 3228 | ||
3222 | if (__ioapic_set_affinity(data, mask, &dest)) | 3229 | ret = __ioapic_set_affinity(data, mask, &dest); |
3223 | return -1; | 3230 | if (ret) |
3231 | return ret; | ||
3224 | 3232 | ||
3225 | target_ht_irq(data->irq, dest, cfg->vector); | 3233 | target_ht_irq(data->irq, dest, cfg->vector); |
3226 | return IRQ_SET_MASK_OK_NOCOPY; | 3234 | return IRQ_SET_MASK_OK_NOCOPY; |
diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 76f98fe5b35c..a450373e8e91 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c | |||
@@ -132,15 +132,6 @@ static void __init ms_hyperv_init_platform(void) | |||
132 | lapic_timer_frequency = hv_lapic_frequency; | 132 | lapic_timer_frequency = hv_lapic_frequency; |
133 | printk(KERN_INFO "HyperV: LAPIC Timer Frequency: %#x\n", | 133 | printk(KERN_INFO "HyperV: LAPIC Timer Frequency: %#x\n", |
134 | lapic_timer_frequency); | 134 | lapic_timer_frequency); |
135 | |||
136 | /* | ||
137 | * On Hyper-V, when we are booting off an EFI firmware stack, | ||
138 | * we do not have many legacy devices including PIC, PIT etc. | ||
139 | */ | ||
140 | if (efi_enabled(EFI_BOOT)) { | ||
141 | printk(KERN_INFO "HyperV: Using null_legacy_pic\n"); | ||
142 | legacy_pic = &null_legacy_pic; | ||
143 | } | ||
144 | } | 135 | } |
145 | #endif | 136 | #endif |
146 | 137 | ||
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c index 2e977b5d61dd..8af817105e29 100644 --- a/arch/x86/kernel/i8259.c +++ b/arch/x86/kernel/i8259.c | |||
@@ -299,13 +299,31 @@ static void unmask_8259A(void) | |||
299 | static void init_8259A(int auto_eoi) | 299 | static void init_8259A(int auto_eoi) |
300 | { | 300 | { |
301 | unsigned long flags; | 301 | unsigned long flags; |
302 | unsigned char probe_val = ~(1 << PIC_CASCADE_IR); | ||
303 | unsigned char new_val; | ||
302 | 304 | ||
303 | i8259A_auto_eoi = auto_eoi; | 305 | i8259A_auto_eoi = auto_eoi; |
304 | 306 | ||
305 | raw_spin_lock_irqsave(&i8259A_lock, flags); | 307 | raw_spin_lock_irqsave(&i8259A_lock, flags); |
306 | 308 | ||
307 | outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ | 309 | /* |
310 | * Check to see if we have a PIC. | ||
311 | * Mask all except the cascade and read | ||
312 | * back the value we just wrote. If we don't | ||
313 | * have a PIC, we will read 0xff as opposed to the | ||
314 | * value we wrote. | ||
315 | */ | ||
308 | outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ | 316 | outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ |
317 | outb(probe_val, PIC_MASTER_IMR); | ||
318 | new_val = inb(PIC_MASTER_IMR); | ||
319 | if (new_val != probe_val) { | ||
320 | printk(KERN_INFO "Using NULL legacy PIC\n"); | ||
321 | legacy_pic = &null_legacy_pic; | ||
322 | raw_spin_unlock_irqrestore(&i8259A_lock, flags); | ||
323 | return; | ||
324 | } | ||
325 | |||
326 | outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ | ||
309 | 327 | ||
310 | /* | 328 | /* |
311 | * outb_pic - this has to work on a wide range of PC hardware. | 329 | * outb_pic - this has to work on a wide range of PC hardware. |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 11ccfb0a63e7..922d28581024 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -365,6 +365,7 @@ void fixup_irqs(void) | |||
365 | struct irq_desc *desc; | 365 | struct irq_desc *desc; |
366 | struct irq_data *data; | 366 | struct irq_data *data; |
367 | struct irq_chip *chip; | 367 | struct irq_chip *chip; |
368 | int ret; | ||
368 | 369 | ||
369 | for_each_irq_desc(irq, desc) { | 370 | for_each_irq_desc(irq, desc) { |
370 | int break_affinity = 0; | 371 | int break_affinity = 0; |
@@ -403,10 +404,14 @@ void fixup_irqs(void) | |||
403 | if (!irqd_can_move_in_process_context(data) && chip->irq_mask) | 404 | if (!irqd_can_move_in_process_context(data) && chip->irq_mask) |
404 | chip->irq_mask(data); | 405 | chip->irq_mask(data); |
405 | 406 | ||
406 | if (chip->irq_set_affinity) | 407 | if (chip->irq_set_affinity) { |
407 | chip->irq_set_affinity(data, affinity, true); | 408 | ret = chip->irq_set_affinity(data, affinity, true); |
408 | else if (!(warned++)) | 409 | if (ret == -ENOSPC) |
409 | set_affinity = 0; | 410 | pr_crit("IRQ %d set affinity failed because there are no available vectors. The device assigned to this IRQ is unstable.\n", irq); |
411 | } else { | ||
412 | if (!(warned++)) | ||
413 | set_affinity = 0; | ||
414 | } | ||
410 | 415 | ||
411 | /* | 416 | /* |
412 | * We unmask if the irq was not marked masked by the | 417 | * We unmask if the irq was not marked masked by the |