summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-02-03 12:27:44 +0100
committerThomas Gleixner <tglx@linutronix.de>2011-02-19 12:58:10 +0100
commit87923470c712dff00b101ffb6b6fbc27bd7a6df5 (patch)
tree35dc1a0adec4d00bbc872ce096c481cf0d69314a /kernel/irq
parent4699923861513671d3f6ade8efb4e56a9a7ecadf (diff)
downloadop-kernel-dev-87923470c712dff00b101ffb6b6fbc27bd7a6df5.zip
op-kernel-dev-87923470c712dff00b101ffb6b6fbc27bd7a6df5.tar.gz
genirq: Consolidate disable/enable
Create irq_disable/enable and use them to keep the flags consistent. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/chip.c12
-rw-r--r--kernel/irq/internals.h2
-rw-r--r--kernel/irq/manage.c2
-rw-r--r--kernel/irq/resend.c10
-rw-r--r--kernel/irq/spurious.c2
5 files changed, 20 insertions, 8 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 988fe7a..86c8e42 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -200,7 +200,7 @@ int irq_startup(struct irq_desc *desc)
if (desc->irq_data.chip->irq_startup)
return desc->irq_data.chip->irq_startup(&desc->irq_data);
- desc->irq_data.chip->irq_enable(&desc->irq_data);
+ irq_enable(desc);
return 0;
}
@@ -211,6 +211,16 @@ void irq_shutdown(struct irq_desc *desc)
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
}
+void irq_enable(struct irq_desc *desc)
+{
+ desc->irq_data.chip->irq_enable(&desc->irq_data);
+}
+
+void irq_disable(struct irq_desc *desc)
+{
+ desc->irq_data.chip->irq_disable(&desc->irq_data);
+}
+
/*
* default enable function
*/
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index 5cbfc93..c71fc4de0 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -40,6 +40,8 @@ extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
extern int irq_startup(struct irq_desc *desc);
extern void irq_shutdown(struct irq_desc *desc);
+extern void irq_enable(struct irq_desc *desc);
+extern void irq_disable(struct irq_desc *desc);
extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 9c56247..0078023 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -331,7 +331,7 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
if (!desc->depth++) {
desc->status |= IRQ_DISABLED;
- desc->irq_data.chip->irq_disable(&desc->irq_data);
+ irq_disable(desc);
}
}
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index dc49358..4bfe268 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -55,20 +55,20 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);
*/
void check_irq_resend(struct irq_desc *desc, unsigned int irq)
{
- unsigned int status = desc->status;
-
/*
* Make sure the interrupt is enabled, before resending it:
*/
- desc->irq_data.chip->irq_enable(&desc->irq_data);
+ irq_enable(desc);
/*
* We do not resend level type interrupts. Level type
* interrupts are resent by hardware when they are still
* active.
*/
- if ((status & (IRQ_LEVEL | IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
- desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY;
+ if (desc->status & IRQ_LEVEL)
+ return;
+ if ((desc->status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
+ desc->status = (desc->status & ~IRQ_PENDING) | IRQ_REPLAY;
if (!desc->irq_data.chip->irq_retrigger ||
!desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index f749d29..c300b8f 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -303,7 +303,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED;
desc->depth++;
- desc->irq_data.chip->irq_disable(&desc->irq_data);
+ irq_disable(desc);
mod_timer(&poll_spurious_irq_timer,
jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
OpenPOWER on IntegriCloud