[3.16.y-ckt stable] Patch "power: gpio-charger: balance enable/disable_irq_wake calls" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Mar 2 13:34:30 UTC 2015

This is a note to let you know that I have just added a patch titled

    power: gpio-charger: balance enable/disable_irq_wake calls

to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree 
which can be found at:


This patch is scheduled to be released in version 3.16.7-ckt8.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.16.y-ckt tree, see



>From 831296d31c15bb2c286ee7aad627f365eb21f116 Mon Sep 17 00:00:00 2001
From: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Date: Thu, 15 Jan 2015 05:00:37 +0300
Subject: power: gpio-charger: balance enable/disable_irq_wake calls

commit faeed51bb65ce0241052d8dc24ac331ade12e976 upstream.

enable_irq_wakeup returns 0 in case it correctly enabled the IRQ to
generate the wakeup event (and thus resume should call disable_irq_wake).
Currently gpio-charger driver has this logic inverted. Correct that thus
correcting enable/disable_irq_wake() calls balance.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Signed-off-by: Sebastian Reichel <sre at kernel.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
 drivers/power/gpio-charger.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index a0024b252197..86e03c6d28f3 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -168,7 +168,7 @@ static int gpio_charger_suspend(struct device *dev)

 	if (device_may_wakeup(dev))
 		gpio_charger->wakeup_enabled =
-			enable_irq_wake(gpio_charger->irq);
+			!enable_irq_wake(gpio_charger->irq);

 	return 0;
@@ -178,7 +178,7 @@ static int gpio_charger_resume(struct device *dev)
 	struct platform_device *pdev = to_platform_device(dev);
 	struct gpio_charger *gpio_charger = platform_get_drvdata(pdev);

-	if (gpio_charger->wakeup_enabled)
+	if (device_may_wakeup(dev) && gpio_charger->wakeup_enabled)

More information about the kernel-team mailing list