genirq: Move suspend/resume logic into irq/pm code
No functional change. Preparatory patch for cleaning up the suspend abort functionality. Update the comments while at it. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:

committed by
Rafael J. Wysocki

parent
068765ba79
commit
8df2e02c5c
@@ -382,14 +382,8 @@ setup_affinity(unsigned int irq, struct irq_desc *desc, struct cpumask *mask)
|
||||
}
|
||||
#endif
|
||||
|
||||
void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
|
||||
void __disable_irq(struct irq_desc *desc, unsigned int irq)
|
||||
{
|
||||
if (suspend) {
|
||||
if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
|
||||
return;
|
||||
desc->istate |= IRQS_SUSPENDED;
|
||||
}
|
||||
|
||||
if (!desc->depth++)
|
||||
irq_disable(desc);
|
||||
}
|
||||
@@ -401,7 +395,7 @@ static int __disable_irq_nosync(unsigned int irq)
|
||||
|
||||
if (!desc)
|
||||
return -EINVAL;
|
||||
__disable_irq(desc, irq, false);
|
||||
__disable_irq(desc, irq);
|
||||
irq_put_desc_busunlock(desc, flags);
|
||||
return 0;
|
||||
}
|
||||
@@ -442,20 +436,8 @@ void disable_irq(unsigned int irq)
|
||||
}
|
||||
EXPORT_SYMBOL(disable_irq);
|
||||
|
||||
void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume)
|
||||
void __enable_irq(struct irq_desc *desc, unsigned int irq)
|
||||
{
|
||||
if (resume) {
|
||||
if (!(desc->istate & IRQS_SUSPENDED)) {
|
||||
if (!desc->action)
|
||||
return;
|
||||
if (!(desc->action->flags & IRQF_FORCE_RESUME))
|
||||
return;
|
||||
/* Pretend that it got disabled ! */
|
||||
desc->depth++;
|
||||
}
|
||||
desc->istate &= ~IRQS_SUSPENDED;
|
||||
}
|
||||
|
||||
switch (desc->depth) {
|
||||
case 0:
|
||||
err_out:
|
||||
@@ -497,7 +479,7 @@ void enable_irq(unsigned int irq)
|
||||
KERN_ERR "enable_irq before setup/request_irq: irq %u\n", irq))
|
||||
goto out;
|
||||
|
||||
__enable_irq(desc, irq, false);
|
||||
__enable_irq(desc, irq);
|
||||
out:
|
||||
irq_put_desc_busunlock(desc, flags);
|
||||
}
|
||||
@@ -1228,7 +1210,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
|
||||
*/
|
||||
if (shared && (desc->istate & IRQS_SPURIOUS_DISABLED)) {
|
||||
desc->istate &= ~IRQS_SPURIOUS_DISABLED;
|
||||
__enable_irq(desc, irq, false);
|
||||
__enable_irq(desc, irq);
|
||||
}
|
||||
|
||||
raw_spin_unlock_irqrestore(&desc->lock, flags);
|
||||
|
Reference in New Issue
Block a user