[PATCH 3/3] genirq: Give warning in case calling irq_set_irq_wakewith _NO_SUSPEND flag

From: Chuansheng Liu
Date: Mon Mar 11 2013 - 04:48:54 EST



When one irq is setup with flag IRQF_NO_SUSPEND, it is pointless
to call irq_set_irq_wake().

Because check_wakeup_irqs() is just checking the irq which has pending
but is in IRQS_SUSPENDED state when do syscore_suspend().

Signed-off-by: liu chuansheng <chuansheng.liu@xxxxxxxxx>
---
kernel/irq/manage.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index fa17855..94c5af9 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -513,6 +513,14 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on)
if (!desc)
return -EINVAL;

+ /* Checking if the flag IRQF_NO_SUSPEND is set,
+ * if set, drivers do not need to call irq_set_irq_wake(),
+ * it is pointless.
+ */
+ if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
+ WARN(1, "IRQ %d with flag IRQF_NO_SUSPEND, no need to call here\n",
+ irq);
+
/* wakeup-capable irqs can be shared between drivers that
* don't need to have the same sleep mode behaviors.
*/
--
1.7.0.4



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/