[IA64] Fix unexpected interrupt vector handling

Fix handling for spurious interrupts not being mapped to any IRQs.

Currently, spurious interrupts that are not mapped to any IRQs are
handled as IRQ 15 (== IA64_SPURIOUS_VECTOR). But it is not proper
because vector != irq. We need special handlings for such spurious
interrupts not being mapped to any IRQs.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by Kenji Kaneshige and committed by Tony Luck 17764d24 b07d68b5

+22 -6
+22 -6
arch/ia64/kernel/irq_ia64.c
··· 82 82 }; 83 83 84 84 DEFINE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq) = { 85 - [0 ... IA64_NUM_VECTORS - 1] = IA64_SPURIOUS_INT_VECTOR 85 + [0 ... IA64_NUM_VECTORS - 1] = -1 86 86 }; 87 87 88 88 static cpumask_t vector_table[IA64_NUM_VECTORS] = { ··· 179 179 domain = cfg->domain; 180 180 cpus_and(mask, cfg->domain, cpu_online_map); 181 181 for_each_cpu_mask(cpu, mask) 182 - per_cpu(vector_irq, cpu)[vector] = IA64_SPURIOUS_INT_VECTOR; 182 + per_cpu(vector_irq, cpu)[vector] = -1; 183 183 cfg->vector = IRQ_VECTOR_UNASSIGNED; 184 184 cfg->domain = CPU_MASK_NONE; 185 185 irq_status[irq] = IRQ_UNUSED; ··· 249 249 250 250 /* Clear vector_irq */ 251 251 for (vector = 0; vector < IA64_NUM_VECTORS; ++vector) 252 - per_cpu(vector_irq, cpu)[vector] = IA64_SPURIOUS_INT_VECTOR; 252 + per_cpu(vector_irq, cpu)[vector] = -1; 253 253 /* Mark the inuse vectors */ 254 254 for (irq = 0; irq < NR_IRQS; ++irq) { 255 255 if (!cpu_isset(cpu, irq_cfg[irq].domain)) ··· 432 432 } else if (unlikely(IS_RESCHEDULE(vector))) 433 433 kstat_this_cpu.irqs[vector]++; 434 434 else { 435 + int irq = local_vector_to_irq(vector); 436 + 435 437 ia64_setreg(_IA64_REG_CR_TPR, vector); 436 438 ia64_srlz_d(); 437 439 438 - generic_handle_irq(local_vector_to_irq(vector)); 440 + if (unlikely(irq < 0)) { 441 + printk(KERN_ERR "%s: Unexpected interrupt " 442 + "vector %d on CPU %d is not mapped " 443 + "to any IRQ!\n", __FUNCTION__, vector, 444 + smp_processor_id()); 445 + } else 446 + generic_handle_irq(irq); 439 447 440 448 /* 441 449 * Disable interrupts and send EOI: ··· 491 483 kstat_this_cpu.irqs[vector]++; 492 484 else { 493 485 struct pt_regs *old_regs = set_irq_regs(NULL); 486 + int irq = local_vector_to_irq(vector); 494 487 495 488 ia64_setreg(_IA64_REG_CR_TPR, vector); 496 489 ia64_srlz_d(); ··· 502 493 * it will work. I hope it works!. 503 494 * Probably could shared code. 504 495 */ 505 - vectors_in_migration[local_vector_to_irq(vector)]=0; 506 - generic_handle_irq(local_vector_to_irq(vector)); 496 + if (unlikely(irq < 0)) { 497 + printk(KERN_ERR "%s: Unexpected interrupt " 498 + "vector %d on CPU %d not being mapped " 499 + "to any IRQ!!\n", __FUNCTION__, vector, 500 + smp_processor_id()); 501 + } else { 502 + vectors_in_migration[irq]=0; 503 + generic_handle_irq(irq); 504 + } 507 505 set_irq_regs(old_regs); 508 506 509 507 /*