forked from luck/tmp_suning_uos_patched
genirq: Move IRQ_MASKED to core
Keep status in sync until all users are fixed. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
2a0d6fb335
commit
6e40262ea4
|
@ -57,11 +57,11 @@ typedef void (*irq_flow_handler_t)(unsigned int irq,
|
|||
#define IRQ_WAITING 0x00000400 /* DEPRECATED */
|
||||
#define IRQ_DISABLED 0x00000800 /* DEPRECATED */
|
||||
#define IRQ_PENDING 0x00001000 /* DEPRECATED */
|
||||
#define IRQ_MASKED 0x00002000 /* DEPRECATED */
|
||||
#endif
|
||||
|
||||
|
||||
#define IRQ_LEVEL 0x00004000 /* IRQ level triggered */
|
||||
#define IRQ_MASKED 0x00008000 /* IRQ masked - shouldn't be seen again */
|
||||
#define IRQ_PER_CPU 0x00010000 /* IRQ is per CPU */
|
||||
#define IRQ_NOPROBE 0x00020000 /* IRQ is not valid for probing */
|
||||
#define IRQ_NOREQUEST 0x00040000 /* IRQ cannot be requested */
|
||||
|
|
|
@ -176,6 +176,18 @@ static void irq_state_set_disabled(struct irq_desc *desc)
|
|||
irq_compat_set_disabled(desc);
|
||||
}
|
||||
|
||||
static void irq_state_clr_masked(struct irq_desc *desc)
|
||||
{
|
||||
desc->istate &= ~IRQS_MASKED;
|
||||
irq_compat_clr_masked(desc);
|
||||
}
|
||||
|
||||
static void irq_state_set_masked(struct irq_desc *desc)
|
||||
{
|
||||
desc->istate |= IRQS_MASKED;
|
||||
irq_compat_set_masked(desc);
|
||||
}
|
||||
|
||||
int irq_startup(struct irq_desc *desc)
|
||||
{
|
||||
irq_state_clr_disabled(desc);
|
||||
|
@ -183,7 +195,7 @@ int irq_startup(struct irq_desc *desc)
|
|||
|
||||
if (desc->irq_data.chip->irq_startup) {
|
||||
int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
|
||||
desc->status &= ~IRQ_MASKED;
|
||||
irq_state_clr_masked(desc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -201,7 +213,7 @@ void irq_shutdown(struct irq_desc *desc)
|
|||
desc->irq_data.chip->irq_disable(&desc->irq_data);
|
||||
else
|
||||
desc->irq_data.chip->irq_mask(&desc->irq_data);
|
||||
desc->status |= IRQ_MASKED;
|
||||
irq_state_set_masked(desc);
|
||||
}
|
||||
|
||||
void irq_enable(struct irq_desc *desc)
|
||||
|
@ -211,7 +223,7 @@ void irq_enable(struct irq_desc *desc)
|
|||
desc->irq_data.chip->irq_enable(&desc->irq_data);
|
||||
else
|
||||
desc->irq_data.chip->irq_unmask(&desc->irq_data);
|
||||
desc->status &= ~IRQ_MASKED;
|
||||
irq_state_clr_masked(desc);
|
||||
}
|
||||
|
||||
void irq_disable(struct irq_desc *desc)
|
||||
|
@ -219,8 +231,8 @@ void irq_disable(struct irq_desc *desc)
|
|||
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;
|
||||
}
|
||||
irq_state_set_masked(desc);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_GENERIC_HARDIRQS_NO_DEPRECATED
|
||||
|
@ -352,14 +364,14 @@ static inline void mask_ack_irq(struct irq_desc *desc)
|
|||
if (desc->irq_data.chip->irq_ack)
|
||||
desc->irq_data.chip->irq_ack(&desc->irq_data);
|
||||
}
|
||||
desc->status |= IRQ_MASKED;
|
||||
irq_state_set_masked(desc);
|
||||
}
|
||||
|
||||
static inline void mask_irq(struct irq_desc *desc)
|
||||
{
|
||||
if (desc->irq_data.chip->irq_mask) {
|
||||
desc->irq_data.chip->irq_mask(&desc->irq_data);
|
||||
desc->status |= IRQ_MASKED;
|
||||
irq_state_set_masked(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -367,7 +379,7 @@ static inline void unmask_irq(struct irq_desc *desc)
|
|||
{
|
||||
if (desc->irq_data.chip->irq_unmask) {
|
||||
desc->irq_data.chip->irq_unmask(&desc->irq_data);
|
||||
desc->status &= ~IRQ_MASKED;
|
||||
irq_state_clr_masked(desc);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -583,7 +595,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
|
|||
*/
|
||||
if (unlikely(desc->istate & IRQS_PENDING)) {
|
||||
if (!(desc->istate & IRQS_DISABLED) &&
|
||||
(desc->status & IRQ_MASKED))
|
||||
(desc->istate & IRQS_MASKED))
|
||||
unmask_irq(desc);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,15 @@ static inline void irq_compat_clr_pending(struct irq_desc *desc)
|
|||
{
|
||||
desc->status &= ~IRQ_PENDING;
|
||||
}
|
||||
static inline void irq_compat_set_masked(struct irq_desc *desc)
|
||||
{
|
||||
desc->status |= IRQ_MASKED;
|
||||
}
|
||||
|
||||
static inline void irq_compat_clr_masked(struct irq_desc *desc)
|
||||
{
|
||||
desc->status &= ~IRQ_MASKED;
|
||||
}
|
||||
#else
|
||||
static inline void irq_compat_set_progress(struct irq_desc *desc) { }
|
||||
static inline void irq_compat_clr_progress(struct irq_desc *desc) { }
|
||||
|
@ -35,5 +44,7 @@ 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) { }
|
||||
static inline void irq_compat_set_masked(struct irq_desc *desc) { }
|
||||
static inline void irq_compat_clr_masked(struct irq_desc *desc) { }
|
||||
#endif
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ enum {
|
|||
* IRQS_WAITING - irq is waiting
|
||||
* IRQS_DISABLED - irq is disabled
|
||||
* IRQS_PENDING - irq is pending and replayed later
|
||||
* IRQS_MASKED - irq is masked
|
||||
*/
|
||||
enum {
|
||||
IRQS_AUTODETECT = 0x00000001,
|
||||
|
@ -58,6 +59,7 @@ enum {
|
|||
IRQS_WAITING = 0x00000080,
|
||||
IRQS_DISABLED = 0x00000100,
|
||||
IRQS_PENDING = 0x00000200,
|
||||
IRQS_MASKED = 0x00000400,
|
||||
};
|
||||
|
||||
#define irq_data_to_desc(data) container_of(data, struct irq_desc, irq_data)
|
||||
|
@ -142,7 +144,6 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
|
|||
}
|
||||
|
||||
P(IRQ_LEVEL);
|
||||
P(IRQ_MASKED);
|
||||
#ifdef CONFIG_IRQ_PER_CPU
|
||||
P(IRQ_PER_CPU);
|
||||
#endif
|
||||
|
@ -156,6 +157,7 @@ static inline void print_irq_desc(unsigned int irq, struct irq_desc *desc)
|
|||
PS(IRQS_WAITING);
|
||||
PS(IRQS_DISABLED);
|
||||
PS(IRQS_PENDING);
|
||||
PS(IRQS_MASKED);
|
||||
}
|
||||
|
||||
#undef P
|
||||
|
|
|
@ -646,8 +646,9 @@ static void irq_finalize_oneshot(unsigned int irq, struct irq_desc *desc)
|
|||
goto again;
|
||||
}
|
||||
|
||||
if (!(desc->istate & IRQS_DISABLED) && (desc->status & IRQ_MASKED)) {
|
||||
desc->status &= ~IRQ_MASKED;
|
||||
if (!(desc->istate & IRQS_DISABLED) && (desc->istate & IRQS_MASKED)) {
|
||||
irq_compat_clr_masked(desc);
|
||||
desc->istate &= ~IRQS_MASKED;
|
||||
desc->irq_data.chip->irq_unmask(&desc->irq_data);
|
||||
}
|
||||
raw_spin_unlock_irq(&desc->lock);
|
||||
|
|
|
@ -69,7 +69,7 @@ void move_native_irq(int irq)
|
|||
* threaded interrupt with ONESHOT set, we can end up with an
|
||||
* interrupt storm.
|
||||
*/
|
||||
masked = desc->status & IRQ_MASKED;
|
||||
masked = desc->istate & IRQS_MASKED;
|
||||
if (!masked)
|
||||
desc->irq_data.chip->irq_mask(&desc->irq_data);
|
||||
move_masked_irq(irq);
|
||||
|
|
|
@ -16,3 +16,5 @@ enum {
|
|||
#define IRQ_DISABLED GOT_YOU_MORON
|
||||
#undef IRQ_PENDING
|
||||
#define IRQ_PENDING GOT_YOU_MORON
|
||||
#undef IRQ_MASKED
|
||||
#define IRQ_MASKED GOT_YOU_MORON
|
||||
|
|
Loading…
Reference in New Issue
Block a user