Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a0d6fb3 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

genirq: Move IRQ_PENDING flag to core



Keep status in sync until all users are fixed.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent c1594b77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -56,9 +56,9 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
#define IRQ_REPLAY		0x00000200	/* DEPRECATED */
#define IRQ_WAITING		0x00000400	/* DEPRECATED */
#define IRQ_DISABLED		0x00000800	/* DEPRECATED */
#define IRQ_PENDING		0x00001000	/* DEPRECATED */
#endif

#define IRQ_PENDING		0x00001000	/* IRQ pending - replay on enable */

#define IRQ_LEVEL		0x00004000	/* IRQ level triggered */
#define IRQ_MASKED		0x00008000	/* IRQ masked - shouldn't be seen again */
+4 −2
Original line number Diff line number Diff line
@@ -76,8 +76,10 @@ unsigned long probe_irq_on(void)
		raw_spin_lock_irq(&desc->lock);
		if (!desc->action && !(desc->status & IRQ_NOPROBE)) {
			desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
			if (irq_startup(desc))
				desc->status |= IRQ_PENDING;
			if (irq_startup(desc)) {
				irq_compat_set_pending(desc);
				desc->istate |= IRQS_PENDING;
			}
		}
		raw_spin_unlock_irq(&desc->lock);
	}
+6 −4
Original line number Diff line number Diff line
@@ -518,7 +518,8 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
	 * then mask it and get out of here:
	 */
	if (unlikely(!desc->action || (desc->istate & IRQS_DISABLED))) {
		desc->status |= IRQ_PENDING;
		irq_compat_set_pending(desc);
		desc->istate |= IRQS_PENDING;
		mask_irq(desc);
		goto out;
	}
@@ -558,7 +559,8 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
	if (unlikely((desc->istate & (IRQS_DISABLED | IRQS_INPROGRESS) ||
		      !desc->action))) {
		if (!irq_check_poll(desc)) {
			desc->status |= IRQ_PENDING;
			irq_compat_set_pending(desc);
			desc->istate |= IRQS_PENDING;
			mask_ack_irq(desc);
			goto out_unlock;
		}
@@ -579,7 +581,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
		 * one, we could have masked the irq.
		 * Renable it, if it was not disabled in meantime.
		 */
		if (unlikely(desc->status & IRQ_PENDING)) {
		if (unlikely(desc->istate & IRQS_PENDING)) {
			if (!(desc->istate & IRQS_DISABLED) &&
			    (desc->status & IRQ_MASKED))
				unmask_irq(desc);
@@ -587,7 +589,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)

		handle_irq_event(desc);

	} while ((desc->status & IRQ_PENDING) &&
	} while ((desc->istate & IRQS_PENDING) &&
		 !(desc->istate & IRQS_DISABLED));

out_unlock:
+11 −1
Original line number Diff line number Diff line
@@ -15,15 +15,25 @@ static inline void irq_compat_set_disabled(struct irq_desc *desc)
{
	desc->status |= IRQ_DISABLED;
}

static inline void irq_compat_clr_disabled(struct irq_desc *desc)
{
	desc->status &= ~IRQ_DISABLED;
}
static inline void irq_compat_set_pending(struct irq_desc *desc)
{
	desc->status |= IRQ_PENDING;
}

static inline void irq_compat_clr_pending(struct irq_desc *desc)
{
	desc->status &= ~IRQ_PENDING;
}
#else
static inline void irq_compat_set_progress(struct irq_desc *desc) { }
static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
static inline void irq_compat_set_disabled(struct irq_desc *desc) { }
static inline void irq_compat_clr_disabled(struct irq_desc *desc) { }
static inline void irq_compat_set_pending(struct irq_desc *desc) { }
static inline void irq_compat_clr_pending(struct irq_desc *desc) { }
#endif
+2 −1
Original line number Diff line number Diff line
@@ -122,7 +122,8 @@ irqreturn_t handle_irq_event(struct irq_desc *desc)
	struct irqaction *action = desc->action;
	irqreturn_t ret;

	desc->status &= ~IRQ_PENDING;
	irq_compat_clr_pending(desc);
	desc->istate &= ~IRQS_PENDING;
	irq_compat_set_progress(desc);
	desc->istate |= IRQS_INPROGRESS;
	raw_spin_unlock(&desc->lock);
Loading