aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss Anderson <rja@sgi.com>2007-08-03 15:32:37 -0400
committerTony Luck <tony.luck@intel.com>2007-08-13 16:22:45 -0400
commita1287476e86568374ed6aadbb4123d9eff6f7b09 (patch)
tree744faa378bd099f303c320336e10c20771955282
parent0b0517a475c2fd601d01acb4a585644eda9c9395 (diff)
[IA64] Clean up CPE handler registration
Use local_vector_to_irq() instead of looping through all NR_IRQS. This avoids registering the CPE handler on multiple irqs. Only register if the irq is valid. If no valid irq is found, print an error message and set up polling. Signed-off-by: Russ Anderson <rja@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r--arch/ia64/kernel/mca.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index ff28620cb992..63b73f3d4c9f 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -2018,22 +2018,26 @@ ia64_mca_late_init(void)
2018 2018
2019 if (cpe_vector >= 0) { 2019 if (cpe_vector >= 0) {
2020 /* If platform supports CPEI, enable the irq. */ 2020 /* If platform supports CPEI, enable the irq. */
2021 cpe_poll_enabled = 0; 2021 irq = local_vector_to_irq(cpe_vector);
2022 for (irq = 0; irq < NR_IRQS; ++irq) 2022 if (irq > 0) {
2023 if (irq_to_vector(irq) == cpe_vector) { 2023 cpe_poll_enabled = 0;
2024 desc = irq_desc + irq; 2024 desc = irq_desc + irq;
2025 desc->status |= IRQ_PER_CPU; 2025 desc->status |= IRQ_PER_CPU;
2026 setup_irq(irq, &mca_cpe_irqaction); 2026 setup_irq(irq, &mca_cpe_irqaction);
2027 ia64_cpe_irq = irq; 2027 ia64_cpe_irq = irq;
2028 } 2028 ia64_mca_register_cpev(cpe_vector);
2029 ia64_mca_register_cpev(cpe_vector); 2029 IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n",
2030 IA64_MCA_DEBUG("%s: CPEI/P setup and enabled.\n", __FUNCTION__); 2030 __FUNCTION__);
2031 } else { 2031 return 0;
2032 /* If platform doesn't support CPEI, get the timer going. */
2033 if (cpe_poll_enabled) {
2034 ia64_mca_cpe_poll(0UL);
2035 IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __FUNCTION__);
2036 } 2032 }
2033 printk(KERN_ERR "%s: Failed to find irq for CPE "
2034 "interrupt handler, vector %d\n",
2035 __FUNCTION__, cpe_vector);
2036 }
2037 /* If platform doesn't support CPEI, get the timer going. */
2038 if (cpe_poll_enabled) {
2039 ia64_mca_cpe_poll(0UL);
2040 IA64_MCA_DEBUG("%s: CPEP setup and enabled.\n", __FUNCTION__);
2037 } 2041 }
2038 } 2042 }
2039#endif 2043#endif