aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/sys_rawhide.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/alpha/kernel/sys_rawhide.c')
-rw-r--r--arch/alpha/kernel/sys_rawhide.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/alpha/kernel/sys_rawhide.c b/arch/alpha/kernel/sys_rawhide.c
index 581d08c70b92..672cb2df53df 100644
--- a/arch/alpha/kernel/sys_rawhide.c
+++ b/arch/alpha/kernel/sys_rawhide.c
@@ -52,6 +52,9 @@ rawhide_update_irq_hw(int hose, int mask)
52 *(vuip)MCPCIA_INT_MASK0(MCPCIA_HOSE2MID(hose)); 52 *(vuip)MCPCIA_INT_MASK0(MCPCIA_HOSE2MID(hose));
53} 53}
54 54
55#define hose_exists(h) \
56 (((h) < MCPCIA_MAX_HOSES) && (cached_irq_masks[(h)] != 0))
57
55static inline void 58static inline void
56rawhide_enable_irq(unsigned int irq) 59rawhide_enable_irq(unsigned int irq)
57{ 60{
@@ -59,6 +62,9 @@ rawhide_enable_irq(unsigned int irq)
59 62
60 irq -= 16; 63 irq -= 16;
61 hose = irq / 24; 64 hose = irq / 24;
65 if (!hose_exists(hose)) /* if hose non-existent, exit */
66 return;
67
62 irq -= hose * 24; 68 irq -= hose * 24;
63 mask = 1 << irq; 69 mask = 1 << irq;
64 70
@@ -76,6 +82,9 @@ rawhide_disable_irq(unsigned int irq)
76 82
77 irq -= 16; 83 irq -= 16;
78 hose = irq / 24; 84 hose = irq / 24;
85 if (!hose_exists(hose)) /* if hose non-existent, exit */
86 return;
87
79 irq -= hose * 24; 88 irq -= hose * 24;
80 mask = ~(1 << irq) | hose_irq_masks[hose]; 89 mask = ~(1 << irq) | hose_irq_masks[hose];
81 90
@@ -93,6 +102,9 @@ rawhide_mask_and_ack_irq(unsigned int irq)
93 102
94 irq -= 16; 103 irq -= 16;
95 hose = irq / 24; 104 hose = irq / 24;
105 if (!hose_exists(hose)) /* if hose non-existent, exit */
106 return;
107
96 irq -= hose * 24; 108 irq -= hose * 24;
97 mask1 = 1 << irq; 109 mask1 = 1 << irq;
98 mask = ~mask1 | hose_irq_masks[hose]; 110 mask = ~mask1 | hose_irq_masks[hose];
@@ -169,6 +181,9 @@ rawhide_init_irq(void)
169 181
170 mcpcia_init_hoses(); 182 mcpcia_init_hoses();
171 183
184 /* Clear them all; only hoses that exist will be non-zero. */
185 for (i = 0; i < MCPCIA_MAX_HOSES; i++) cached_irq_masks[i] = 0;
186
172 for (hose = hose_head; hose; hose = hose->next) { 187 for (hose = hose_head; hose; hose = hose->next) {
173 unsigned int h = hose->index; 188 unsigned int h = hose->index;
174 unsigned int mask = hose_irq_masks[h]; 189 unsigned int mask = hose_irq_masks[h];