Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH RESEND V2 1/2] power: gpio-charger: balance enable/disable_irq_wake calls
@ 2015-01-15  2:00 Dmitry Eremin-Solenikov
  2015-01-15 13:44 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Eremin-Solenikov @ 2015-01-15  2:00 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-kernel, linux-arm-kernel, stable

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.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.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 7536933..e5deb11 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)
 		disable_irq_wake(gpio_charger->irq);
 	power_supply_changed(&gpio_charger->charger);
 
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND V2 1/2] power: gpio-charger: balance enable/disable_irq_wake calls
  2015-01-15  2:00 [PATCH RESEND V2 1/2] power: gpio-charger: balance enable/disable_irq_wake calls Dmitry Eremin-Solenikov
@ 2015-01-15 13:44 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2015-01-15 13:44 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: linux-pm, linux-kernel, linux-arm-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

Hi,

On Thu, Jan 15, 2015 at 05:00:37AM +0300, Dmitry Eremin-Solenikov wrote:
> 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.

Thanks, applied:

http://git.infradead.org/battery-2.6.git/commit/9a2fb8ac9677ab9cf17ab336e06b59d93a57f4a4

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-15 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15  2:00 [PATCH RESEND V2 1/2] power: gpio-charger: balance enable/disable_irq_wake calls Dmitry Eremin-Solenikov
2015-01-15 13:44 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox