}
EXPORT_SYMBOL_GPL(irq_get_irq_data);
+static void irq_state_clr_disabled(struct irq_desc *desc)
+{
+ desc->istate &= ~IRQS_DISABLED;
+ irq_compat_clr_disabled(desc);
+}
+
+static void irq_state_set_disabled(struct irq_desc *desc)
+{
+ desc->istate |= IRQS_DISABLED;
+ irq_compat_set_disabled(desc);
+}
+
int irq_startup(struct irq_desc *desc)
{
- desc->status &= ~IRQ_DISABLED;
+ irq_state_clr_disabled(desc);
desc->depth = 0;
if (desc->irq_data.chip->irq_startup) {
void irq_shutdown(struct irq_desc *desc)
{
- desc->status |= IRQ_DISABLED;
+ irq_state_set_disabled(desc);
desc->depth = 1;
if (desc->irq_data.chip->irq_shutdown)
desc->irq_data.chip->irq_shutdown(&desc->irq_data);
void irq_enable(struct irq_desc *desc)
{
- desc->status &= ~IRQ_DISABLED;
+ irq_state_clr_disabled(desc);
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;
+ irq_state_set_disabled(desc);
if (desc->irq_data.chip->irq_disable) {
desc->irq_data.chip->irq_disable(&desc->irq_data);
desc->status |= IRQ_MASKED;
kstat_incr_irqs_this_cpu(irq, desc);
action = desc->action;
- if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+ if (unlikely(!action || (desc->istate & IRQS_DISABLED)))
goto out_unlock;
irq_compat_set_progress(desc);
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
kstat_incr_irqs_this_cpu(irq, desc);
- if (unlikely(!desc->action || (desc->status & IRQ_DISABLED)))
+ if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED)))
goto out_unlock;
handle_irq_event(desc);
* If its disabled or no action available
* keep it masked and get out of here
*/
- if (unlikely(!desc->action || (desc->status & IRQ_DISABLED)))
+ if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED)))
goto out_unlock;
handle_irq_event(desc);
- if (!(desc->status & IRQ_DISABLED) && !(desc->istate & IRQS_ONESHOT))
+ if (!(desc->istate & (IRQS_DISABLED | IRQS_ONESHOT)))
unmask_irq(desc);
out_unlock:
raw_spin_unlock(&desc->lock);
* If its disabled or no action available
* then mask it and get out of here:
*/
- if (unlikely(!desc->action || (desc->status & IRQ_DISABLED))) {
+ if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) {
desc->status |= IRQ_PENDING;
mask_irq(desc);
goto out;
* we shouldn't process the IRQ. Mark it pending, handle
* the necessary masking and go out
*/
- if (unlikely((desc->istate & (IRQS_INPROGRESS) ||
- (desc->status & IRQ_DISABLED) || !desc->action))) {
+ if (unlikely((desc->istate & (IRQS_DISABLED | IRQS_INPROGRESS) ||
+ !desc->action))) {
if (!irq_check_poll(desc)) {
desc->status |= IRQ_PENDING;
mask_ack_irq(desc);
* one, we could have masked the irq.
* Renable it, if it was not disabled in meantime.
*/
- if (unlikely((desc->status &
- (IRQ_PENDING | IRQ_MASKED | IRQ_DISABLED)) ==
- (IRQ_PENDING | IRQ_MASKED))) {
- unmask_irq(desc);
+ if (unlikely(desc->status & IRQ_PENDING)) {
+ if (!(desc->istate & IRQS_DISABLED) &&
+ (desc->status & IRQ_MASKED))
+ unmask_irq(desc);
}
handle_irq_event(desc);
- } while ((desc->status & (IRQ_PENDING | IRQ_DISABLED)) == IRQ_PENDING);
+ } while ((desc->status & IRQ_PENDING) &&
+ !(desc->istate & IRQS_DISABLED));
out_unlock:
raw_spin_unlock(&desc->lock);
if (handle == handle_bad_irq) {
if (desc->irq_data.chip != &no_irq_chip)
mask_ack_irq(desc);
- desc->status |= IRQ_DISABLED;
+ irq_compat_set_disabled(desc);
+ desc->istate |= IRQS_DISABLED;
desc->depth = 1;
}
desc->handle_irq = handle;
* IRQS_ONESHOT - irq is not unmasked in primary handler
* IRQS_REPLAY - irq is replayed
* IRQS_WAITING - irq is waiting
+ * IRQS_DISABLED - irq is disabled
*/
enum {
IRQS_AUTODETECT = 0x00000001,
IRQS_ONESHOT = 0x00000020,
IRQS_REPLAY = 0x00000040,
IRQS_WAITING = 0x00000080,
+ IRQS_DISABLED = 0x00000100,
};
#define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
print_symbol("%s\n", (unsigned long)desc->action->handler);
}
- P(IRQ_DISABLED);
P(IRQ_PENDING);
P(IRQ_LEVEL);
P(IRQ_MASKED);
PS(IRQS_INPROGRESS);
PS(IRQS_REPLAY);
PS(IRQS_WAITING);
+ PS(IRQS_DISABLED);
}
#undef P