int irq_startup(struct irq_desc *desc)
{
- desc->status &= ~(IRQ_MASKED | IRQ_DISABLED);
+ desc->status &= ~IRQ_DISABLED;
desc->depth = 0;
- if (desc->irq_data.chip->irq_startup)
- return desc->irq_data.chip->irq_startup(&desc->irq_data);
+ if (desc->irq_data.chip->irq_startup) {
+ int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
+ desc->status &= ~IRQ_MASKED;
+ return ret;
+ }
irq_enable(desc);
return 0;
void irq_shutdown(struct irq_desc *desc)
{
- desc->status |= IRQ_MASKED | IRQ_DISABLED;
+ desc->status |= IRQ_DISABLED;
desc->depth = 1;
if (desc->irq_data.chip->irq_shutdown)
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
desc->irq_data.chip->irq_disable(&desc->irq_data);
else
desc->irq_data.chip->irq_mask(&desc->irq_data);
+ desc->status |= IRQ_MASKED;
}
void irq_enable(struct irq_desc *desc)
{
+ desc->status &= ~IRQ_DISABLED;
if (desc->irq_data.chip->irq_enable)
desc->irq_data.chip->irq_enable(&desc->irq_data);
else
void irq_disable(struct irq_desc *desc)
{
+ desc->status |= IRQ_DISABLED;
if (desc->irq_data.chip->irq_disable) {
desc->irq_data.chip->irq_disable(&desc->irq_data);
desc->status |= IRQ_MASKED;
desc->status |= IRQ_SUSPENDED;
}
- if (!desc->depth++) {
- desc->status |= IRQ_DISABLED;
+ if (!desc->depth++)
irq_disable(desc);
- }
}
/**
WARN(1, KERN_WARNING "Unbalanced enable for IRQ %d\n", irq);
break;
case 1: {
- unsigned int status = desc->status & ~IRQ_DISABLED;
-
if (desc->status & IRQ_SUSPENDED)
goto err_out;
/* Prevent probing on this irq: */
- desc->status = status | IRQ_NOPROBE;
+ desc->status |= IRQ_NOPROBE;
+ irq_enable(desc);
check_irq_resend(desc, irq);
/* fall-through */
}
*/
void check_irq_resend(struct irq_desc *desc, unsigned int irq)
{
- /*
- * Make sure the interrupt is enabled, before resending it:
- */
- irq_enable(desc);
-
/*
* We do not resend level type interrupts. Level type
* interrupts are resent by hardware when they are still