aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-03-27 10:05:36 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-03-27 11:45:58 -0400
commitb3d422329f2e061d66af4f933ef316e50e5edcac (patch)
tree530100dd1733e24a017f4b3df4959c667369d236
parent0fdb4b259ed3e91b687ac26848202f5e7c217e62 (diff)
genirq: Add chip flag for restricting cpu_on/offline calls
Add a flag which indicates that the on/offline callback should only be called on enabled interrupts. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/irq.h3
-rw-r--r--kernel/irq/chip.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h
index c2a0c1929690..76e948fa88f8 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -348,11 +348,14 @@ struct irq_chip {
348 * IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type() 348 * IRQCHIP_SET_TYPE_MASKED: Mask before calling chip.irq_set_type()
349 * IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled 349 * IRQCHIP_EOI_IF_HANDLED: Only issue irq_eoi() when irq was handled
350 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path 350 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
351 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks
352 * when irq enabled
351 */ 353 */
352enum { 354enum {
353 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 355 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
354 IRQCHIP_EOI_IF_HANDLED = (1 << 1), 356 IRQCHIP_EOI_IF_HANDLED = (1 << 1),
355 IRQCHIP_MASK_ON_SUSPEND = (1 << 2), 357 IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
358 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
356}; 359};
357 360
358/* This include will go away once we isolated irq_desc usage to core code */ 361/* This include will go away once we isolated irq_desc usage to core code */
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 44b16a1ecd9a..9283d3300ea9 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -718,8 +718,9 @@ void irq_cpu_online(void)
718 raw_spin_lock_irqsave(&desc->lock, flags); 718 raw_spin_lock_irqsave(&desc->lock, flags);
719 719
720 chip = irq_data_get_irq_chip(&desc->irq_data); 720 chip = irq_data_get_irq_chip(&desc->irq_data);
721 721 if (chip && chip->irq_cpu_online &&
722 if (chip && chip->irq_cpu_online) 722 (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) ||
723 !(desc->istate & IRQS_DISABLED)))
723 chip->irq_cpu_online(&desc->irq_data); 724 chip->irq_cpu_online(&desc->irq_data);
724 725
725 raw_spin_unlock_irqrestore(&desc->lock, flags); 726 raw_spin_unlock_irqrestore(&desc->lock, flags);
@@ -747,8 +748,9 @@ void irq_cpu_offline(void)
747 raw_spin_lock_irqsave(&desc->lock, flags); 748 raw_spin_lock_irqsave(&desc->lock, flags);
748 749
749 chip = irq_data_get_irq_chip(&desc->irq_data); 750 chip = irq_data_get_irq_chip(&desc->irq_data);
750 751 if (chip && chip->irq_cpu_offline &&
751 if (chip && chip->irq_cpu_offline) 752 (!(chip->flags & IRQCHIP_ONOFFLINE_ENABLED) ||
753 !(desc->istate & IRQS_DISABLED)))
752 chip->irq_cpu_offline(&desc->irq_data); 754 chip->irq_cpu_offline(&desc->irq_data);
753 755
754 raw_spin_unlock_irqrestore(&desc->lock, flags); 756 raw_spin_unlock_irqrestore(&desc->lock, flags);