diff options
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r-- | kernel/irq/chip.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 9283d3300ea9..e00bdc56269f 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -140,27 +140,25 @@ EXPORT_SYMBOL_GPL(irq_get_irq_data); | |||
140 | 140 | ||
141 | static void irq_state_clr_disabled(struct irq_desc *desc) | 141 | static void irq_state_clr_disabled(struct irq_desc *desc) |
142 | { | 142 | { |
143 | desc->istate &= ~IRQS_DISABLED; | ||
144 | irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED); | 143 | irqd_clear(&desc->irq_data, IRQD_IRQ_DISABLED); |
145 | irq_compat_clr_disabled(desc); | 144 | irq_compat_clr_disabled(desc); |
146 | } | 145 | } |
147 | 146 | ||
148 | static void irq_state_set_disabled(struct irq_desc *desc) | 147 | static void irq_state_set_disabled(struct irq_desc *desc) |
149 | { | 148 | { |
150 | desc->istate |= IRQS_DISABLED; | ||
151 | irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED); | 149 | irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED); |
152 | irq_compat_set_disabled(desc); | 150 | irq_compat_set_disabled(desc); |
153 | } | 151 | } |
154 | 152 | ||
155 | static void irq_state_clr_masked(struct irq_desc *desc) | 153 | static void irq_state_clr_masked(struct irq_desc *desc) |
156 | { | 154 | { |
157 | desc->istate &= ~IRQS_MASKED; | 155 | irqd_clear(&desc->irq_data, IRQD_IRQ_MASKED); |
158 | irq_compat_clr_masked(desc); | 156 | irq_compat_clr_masked(desc); |
159 | } | 157 | } |
160 | 158 | ||
161 | static void irq_state_set_masked(struct irq_desc *desc) | 159 | static void irq_state_set_masked(struct irq_desc *desc) |
162 | { | 160 | { |
163 | desc->istate |= IRQS_MASKED; | 161 | irqd_set(&desc->irq_data, IRQD_IRQ_MASKED); |
164 | irq_compat_set_masked(desc); | 162 | irq_compat_set_masked(desc); |
165 | } | 163 | } |
166 | 164 | ||
@@ -380,11 +378,11 @@ void handle_nested_irq(unsigned int irq) | |||
380 | kstat_incr_irqs_this_cpu(irq, desc); | 378 | kstat_incr_irqs_this_cpu(irq, desc); |
381 | 379 | ||
382 | action = desc->action; | 380 | action = desc->action; |
383 | if (unlikely(!action || (desc->istate & IRQS_DISABLED))) | 381 | if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) |
384 | goto out_unlock; | 382 | goto out_unlock; |
385 | 383 | ||
386 | irq_compat_set_progress(desc); | 384 | irq_compat_set_progress(desc); |
387 | desc->istate |= IRQS_INPROGRESS; | 385 | irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); |
388 | raw_spin_unlock_irq(&desc->lock); | 386 | raw_spin_unlock_irq(&desc->lock); |
389 | 387 | ||
390 | action_ret = action->thread_fn(action->irq, action->dev_id); | 388 | action_ret = action->thread_fn(action->irq, action->dev_id); |
@@ -392,7 +390,7 @@ void handle_nested_irq(unsigned int irq) | |||
392 | note_interrupt(irq, desc, action_ret); | 390 | note_interrupt(irq, desc, action_ret); |
393 | 391 | ||
394 | raw_spin_lock_irq(&desc->lock); | 392 | raw_spin_lock_irq(&desc->lock); |
395 | desc->istate &= ~IRQS_INPROGRESS; | 393 | irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS); |
396 | irq_compat_clr_progress(desc); | 394 | irq_compat_clr_progress(desc); |
397 | 395 | ||
398 | out_unlock: | 396 | out_unlock: |
@@ -424,14 +422,14 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc) | |||
424 | { | 422 | { |
425 | raw_spin_lock(&desc->lock); | 423 | raw_spin_lock(&desc->lock); |
426 | 424 | ||
427 | if (unlikely(desc->istate & IRQS_INPROGRESS)) | 425 | if (unlikely(irqd_irq_inprogress(&desc->irq_data))) |
428 | if (!irq_check_poll(desc)) | 426 | if (!irq_check_poll(desc)) |
429 | goto out_unlock; | 427 | goto out_unlock; |
430 | 428 | ||
431 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); | 429 | desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); |
432 | kstat_incr_irqs_this_cpu(irq, desc); | 430 | kstat_incr_irqs_this_cpu(irq, desc); |
433 | 431 | ||
434 | if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) | 432 | if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) |
435 | goto out_unlock; | 433 | goto out_unlock; |
436 | 434 | ||
437 | handle_irq_event(desc); | 435 | handle_irq_event(desc); |
@@ -456,7 +454,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc) | |||
456 | raw_spin_lock(&desc->lock); | 454 | raw_spin_lock(&desc->lock); |
457 | mask_ack_irq(desc); | 455 | mask_ack_irq(desc); |
458 | 456 | ||
459 | if (unlikely(desc->istate & IRQS_INPROGRESS)) | 457 | if (unlikely(irqd_irq_inprogress(&desc->irq_data))) |
460 | if (!irq_check_poll(desc)) | 458 | if (!irq_check_poll(desc)) |
461 | goto out_unlock; | 459 | goto out_unlock; |
462 | 460 | ||
@@ -467,12 +465,12 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc) | |||
467 | * If its disabled or no action available | 465 | * If its disabled or no action available |
468 | * keep it masked and get out of here | 466 | * keep it masked and get out of here |
469 | */ | 467 | */ |
470 | if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) | 468 | if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) |
471 | goto out_unlock; | 469 | goto out_unlock; |
472 | 470 | ||
473 | handle_irq_event(desc); | 471 | handle_irq_event(desc); |
474 | 472 | ||
475 | if (!(desc->istate & (IRQS_DISABLED | IRQS_ONESHOT))) | 473 | if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT)) |
476 | unmask_irq(desc); | 474 | unmask_irq(desc); |
477 | out_unlock: | 475 | out_unlock: |
478 | raw_spin_unlock(&desc->lock); | 476 | raw_spin_unlock(&desc->lock); |
@@ -504,7 +502,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | |||
504 | { | 502 | { |
505 | raw_spin_lock(&desc->lock); | 503 | raw_spin_lock(&desc->lock); |
506 | 504 | ||
507 | if (unlikely(desc->istate & IRQS_INPROGRESS)) | 505 | if (unlikely(irqd_irq_inprogress(&desc->irq_data))) |
508 | if (!irq_check_poll(desc)) | 506 | if (!irq_check_poll(desc)) |
509 | goto out; | 507 | goto out; |
510 | 508 | ||
@@ -515,7 +513,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | |||
515 | * If its disabled or no action available | 513 | * If its disabled or no action available |
516 | * then mask it and get out of here: | 514 | * then mask it and get out of here: |
517 | */ | 515 | */ |
518 | if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) { | 516 | if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { |
519 | irq_compat_set_pending(desc); | 517 | irq_compat_set_pending(desc); |
520 | desc->istate |= IRQS_PENDING; | 518 | desc->istate |= IRQS_PENDING; |
521 | mask_irq(desc); | 519 | mask_irq(desc); |
@@ -566,8 +564,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
566 | * we shouldn't process the IRQ. Mark it pending, handle | 564 | * we shouldn't process the IRQ. Mark it pending, handle |
567 | * the necessary masking and go out | 565 | * the necessary masking and go out |
568 | */ | 566 | */ |
569 | if (unlikely((desc->istate & (IRQS_DISABLED | IRQS_INPROGRESS) || | 567 | if (unlikely(irqd_irq_disabled(&desc->irq_data) || |
570 | !desc->action))) { | 568 | irqd_irq_inprogress(&desc->irq_data) || !desc->action)) { |
571 | if (!irq_check_poll(desc)) { | 569 | if (!irq_check_poll(desc)) { |
572 | irq_compat_set_pending(desc); | 570 | irq_compat_set_pending(desc); |
573 | desc->istate |= IRQS_PENDING; | 571 | desc->istate |= IRQS_PENDING; |
@@ -592,15 +590,15 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
592 | * Renable it, if it was not disabled in meantime. | 590 | * Renable it, if it was not disabled in meantime. |
593 | */ | 591 | */ |
594 | if (unlikely(desc->istate & IRQS_PENDING)) { | 592 | if (unlikely(desc->istate & IRQS_PENDING)) { |
595 | if (!(desc->istate & IRQS_DISABLED) && | 593 | if (!irqd_irq_disabled(&desc->irq_data) && |
596 | (desc->istate & IRQS_MASKED)) | 594 | irqd_irq_masked(&desc->irq_data)) |
597 | unmask_irq(desc); | 595 | unmask_irq(desc); |
598 | } | 596 | } |
599 | 597 | ||
600 | handle_irq_event(desc); | 598 | handle_irq_event(desc); |
601 | 599 | ||
602 | } while ((desc->istate & IRQS_PENDING) && | 600 | } while ((desc->istate & IRQS_PENDING) && |
603 | !(desc->istate & IRQS_DISABLED)); | 601 | !irqd_irq_disabled(&desc->irq_data)); |
604 | 602 | ||
605 | out_unlock: | 603 | out_unlock: |
606 | raw_spin_unlock(&desc->lock); | 604 | raw_spin_unlock(&desc->lock); |
@@ -720,7 +718,7 @@ void irq_cpu_online(void) | |||
720 | chip = irq_data_get_irq_chip(&desc->irq_data); | 718 | chip = irq_data_get_irq_chip(&desc->irq_data); |
721 | if (chip && chip->irq_cpu_online && | 719 | if (chip && chip->irq_cpu_online && |
722 | (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || | 720 | (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || |
723 | !(desc->istate & IRQS_DISABLED))) | 721 | !irqd_irq_disabled(&desc->irq_data))) |
724 | chip->irq_cpu_online(&desc->irq_data); | 722 | chip->irq_cpu_online(&desc->irq_data); |
725 | 723 | ||
726 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 724 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
@@ -750,7 +748,7 @@ void irq_cpu_offline(void) | |||
750 | chip = irq_data_get_irq_chip(&desc->irq_data); | 748 | chip = irq_data_get_irq_chip(&desc->irq_data); |
751 | if (chip && chip->irq_cpu_offline && | 749 | if (chip && chip->irq_cpu_offline && |
752 | (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || | 750 | (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) || |
753 | !(desc->istate & IRQS_DISABLED))) | 751 | !irqd_irq_disabled(&desc->irq_data))) |
754 | chip->irq_cpu_offline(&desc->irq_data); | 752 | chip->irq_cpu_offline(&desc->irq_data); |
755 | 753 | ||
756 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 754 | raw_spin_unlock_irqrestore(&desc->lock, flags); |