aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r--kernel/irq/chip.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 17c87865bfb..73b2e7e0093 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -176,6 +176,18 @@ static void irq_state_set_disabled(struct irq_desc *desc)
176 irq_compat_set_disabled(desc); 176 irq_compat_set_disabled(desc);
177} 177}
178 178
179static void irq_state_clr_masked(struct irq_desc *desc)
180{
181 desc->istate &= ~IRQS_MASKED;
182 irq_compat_clr_masked(desc);
183}
184
185static void irq_state_set_masked(struct irq_desc *desc)
186{
187 desc->istate |= IRQS_MASKED;
188 irq_compat_set_masked(desc);
189}
190
179int irq_startup(struct irq_desc *desc) 191int irq_startup(struct irq_desc *desc)
180{ 192{
181 irq_state_clr_disabled(desc); 193 irq_state_clr_disabled(desc);
@@ -183,7 +195,7 @@ int irq_startup(struct irq_desc *desc)
183 195
184 if (desc->irq_data.chip->irq_startup) { 196 if (desc->irq_data.chip->irq_startup) {
185 int ret = desc->irq_data.chip->irq_startup(&desc->irq_data); 197 int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
186 desc->status &= ~IRQ_MASKED; 198 irq_state_clr_masked(desc);
187 return ret; 199 return ret;
188 } 200 }
189 201
@@ -201,7 +213,7 @@ void irq_shutdown(struct irq_desc *desc)
201 desc->irq_data.chip->irq_disable(&desc->irq_data); 213 desc->irq_data.chip->irq_disable(&desc->irq_data);
202 else 214 else
203 desc->irq_data.chip->irq_mask(&desc->irq_data); 215 desc->irq_data.chip->irq_mask(&desc->irq_data);
204 desc->status |= IRQ_MASKED; 216 irq_state_set_masked(desc);
205} 217}
206 218
207void irq_enable(struct irq_desc *desc) 219void irq_enable(struct irq_desc *desc)
@@ -211,7 +223,7 @@ void irq_enable(struct irq_desc *desc)
211 desc->irq_data.chip->irq_enable(&desc->irq_data); 223 desc->irq_data.chip->irq_enable(&desc->irq_data);
212 else 224 else
213 desc->irq_data.chip->irq_unmask(&desc->irq_data); 225 desc->irq_data.chip->irq_unmask(&desc->irq_data);
214 desc->status &= ~IRQ_MASKED; 226 irq_state_clr_masked(desc);
215} 227}
216 228
217void irq_disable(struct irq_desc *desc) 229void irq_disable(struct irq_desc *desc)
@@ -219,8 +231,8 @@ void irq_disable(struct irq_desc *desc)
219 irq_state_set_disabled(desc); 231 irq_state_set_disabled(desc);
220 if (desc->irq_data.chip->irq_disable) { 232 if (desc->irq_data.chip->irq_disable) {
221 desc->irq_data.chip->irq_disable(&desc->irq_data); 233 desc->irq_data.chip->irq_disable(&desc->irq_data);
222 desc->status |= IRQ_MASKED;
223 } 234 }
235 irq_state_set_masked(desc);
224} 236}
225 237
226#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED 238#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
@@ -352,14 +364,14 @@ static inline void mask_ack_irq(struct irq_desc *desc)
352 if (desc->irq_data.chip->irq_ack) 364 if (desc->irq_data.chip->irq_ack)
353 desc->irq_data.chip->irq_ack(&desc->irq_data); 365 desc->irq_data.chip->irq_ack(&desc->irq_data);
354 } 366 }
355 desc->status |= IRQ_MASKED; 367 irq_state_set_masked(desc);
356} 368}
357 369
358static inline void mask_irq(struct irq_desc *desc) 370static inline void mask_irq(struct irq_desc *desc)
359{ 371{
360 if (desc->irq_data.chip->irq_mask) { 372 if (desc->irq_data.chip->irq_mask) {
361 desc->irq_data.chip->irq_mask(&desc->irq_data); 373 desc->irq_data.chip->irq_mask(&desc->irq_data);
362 desc->status |= IRQ_MASKED; 374 irq_state_set_masked(desc);
363 } 375 }
364} 376}
365 377
@@ -367,7 +379,7 @@ static inline void unmask_irq(struct irq_desc *desc)
367{ 379{
368 if (desc->irq_data.chip->irq_unmask) { 380 if (desc->irq_data.chip->irq_unmask) {
369 desc->irq_data.chip->irq_unmask(&desc->irq_data); 381 desc->irq_data.chip->irq_unmask(&desc->irq_data);
370 desc->status &= ~IRQ_MASKED; 382 irq_state_clr_masked(desc);
371 } 383 }
372} 384}
373 385
@@ -583,7 +595,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
583 */ 595 */
584 if (unlikely(desc->istate & IRQS_PENDING)) { 596 if (unlikely(desc->istate & IRQS_PENDING)) {
585 if (!(desc->istate & IRQS_DISABLED) && 597 if (!(desc->istate & IRQS_DISABLED) &&
586 (desc->status & IRQ_MASKED)) 598 (desc->istate & IRQS_MASKED))
587 unmask_irq(desc); 599 unmask_irq(desc);
588 } 600 }
589 601