提交 87923470 编写于 作者: T Thomas Gleixner

genirq: Consolidate disable/enable

Create irq_disable/enable and use them to keep the flags consistent.
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 46999238
...@@ -200,7 +200,7 @@ int irq_startup(struct irq_desc *desc) ...@@ -200,7 +200,7 @@ int irq_startup(struct irq_desc *desc)
if (desc->irq_data.chip->irq_startup) if (desc->irq_data.chip->irq_startup)
return desc->irq_data.chip->irq_startup(&desc->irq_data); return desc->irq_data.chip->irq_startup(&desc->irq_data);
desc->irq_data.chip->irq_enable(&desc->irq_data); irq_enable(desc);
return 0; return 0;
} }
...@@ -211,6 +211,16 @@ void irq_shutdown(struct irq_desc *desc) ...@@ -211,6 +211,16 @@ void irq_shutdown(struct irq_desc *desc)
desc->irq_data.chip->irq_shutdown(&desc->irq_data); 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 * default enable function
*/ */
......
...@@ -40,6 +40,8 @@ extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume); ...@@ -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 int irq_startup(struct irq_desc *desc);
extern void irq_shutdown(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); extern void init_kstat_irqs(struct irq_desc *desc, int node, int nr);
......
...@@ -331,7 +331,7 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend) ...@@ -331,7 +331,7 @@ void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
if (!desc->depth++) { if (!desc->depth++) {
desc->status |= IRQ_DISABLED; desc->status |= IRQ_DISABLED;
desc->irq_data.chip->irq_disable(&desc->irq_data); irq_disable(desc);
} }
} }
......
...@@ -55,20 +55,20 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0); ...@@ -55,20 +55,20 @@ static DECLARE_TASKLET(resend_tasklet, resend_irqs, 0);
*/ */
void check_irq_resend(struct irq_desc *desc, unsigned int irq) 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: * 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 * We do not resend level type interrupts. Level type
* interrupts are resent by hardware when they are still * interrupts are resent by hardware when they are still
* active. * active.
*/ */
if ((status & (IRQ_LEVEL | IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) { if (desc->status & IRQ_LEVEL)
desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY; 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 || if (!desc->irq_data.chip->irq_retrigger ||
!desc->irq_data.chip->irq_retrigger(&desc->irq_data)) { !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
......
...@@ -303,7 +303,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc, ...@@ -303,7 +303,7 @@ void note_interrupt(unsigned int irq, struct irq_desc *desc,
printk(KERN_EMERG "Disabling IRQ #%d\n", irq); printk(KERN_EMERG "Disabling IRQ #%d\n", irq);
desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED; desc->status |= IRQ_DISABLED | IRQ_SPURIOUS_DISABLED;
desc->depth++; desc->depth++;
desc->irq_data.chip->irq_disable(&desc->irq_data); irq_disable(desc);
mod_timer(&poll_spurious_irq_timer, mod_timer(&poll_spurious_irq_timer,
jiffies + POLL_SPURIOUS_IRQ_INTERVAL); jiffies + POLL_SPURIOUS_IRQ_INTERVAL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册