All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds: add hibernation callbacks
@ 2015-02-02 16:33 ` grygorii.strashko
  0 siblings, 0 replies; 3+ messages in thread
From: grygorii.strashko @ 2015-02-02 16:33 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie, linux-leds
  Cc: sumit.semwal, linux-arm-kernel, linux-kernel, linux-pm,
	Grygorii Strashko

From: Grygorii Strashko <Grygorii.Strashko@linaro.org>

Setting a dev_pm_ops suspend/resume pair of callbacks but not a set of
hibernation callbacks means those pm functions will not be
called upon hibernation - that leads to system crash on ARM during
freezing if gpio-led is used in combination with CPU led trigger.
It may happen after freeze_noirq stage (GPIO is suspended)
and before syscore_suspend stage (CPU led trigger is suspended)
- usually when disable_nonboot_cpus() is called.

Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
assigns the suspend and hibernation callbacks.

Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
---
 drivers/leds/led-class.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index f37d63c..4c03808 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -198,10 +198,7 @@ static int led_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops leds_class_dev_pm_ops = {
-	.suspend        = led_suspend,
-	.resume         = led_resume,
-};
+static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume);
 
 /**
  * led_classdev_register - register a new object of led_classdev class.
-- 
1.9.1


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

* [PATCH] leds: add hibernation callbacks
@ 2015-02-02 16:33 ` grygorii.strashko
  0 siblings, 0 replies; 3+ messages in thread
From: grygorii.strashko @ 2015-02-02 16:33 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie, linux-leds
  Cc: sumit.semwal, linux-arm-kernel, linux-kernel, linux-pm,
	Grygorii Strashko

From: Grygorii Strashko <Grygorii.Strashko@linaro.org>

Setting a dev_pm_ops suspend/resume pair of callbacks but not a set of
hibernation callbacks means those pm functions will not be
called upon hibernation - that leads to system crash on ARM during
freezing if gpio-led is used in combination with CPU led trigger.
It may happen after freeze_noirq stage (GPIO is suspended)
and before syscore_suspend stage (CPU led trigger is suspended)
- usually when disable_nonboot_cpus() is called.

Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
assigns the suspend and hibernation callbacks.

Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
---
 drivers/leds/led-class.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index f37d63c..4c03808 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -198,10 +198,7 @@ static int led_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops leds_class_dev_pm_ops = {
-	.suspend        = led_suspend,
-	.resume         = led_resume,
-};
+static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume);
 
 /**
  * led_classdev_register - register a new object of led_classdev class.
-- 
1.9.1


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

* [PATCH] leds: add hibernation callbacks
@ 2015-02-02 16:33 ` grygorii.strashko
  0 siblings, 0 replies; 3+ messages in thread
From: grygorii.strashko at linaro.org @ 2015-02-02 16:33 UTC (permalink / raw)
  To: linux-arm-kernel

From: Grygorii Strashko <Grygorii.Strashko@linaro.org>

Setting a dev_pm_ops suspend/resume pair of callbacks but not a set of
hibernation callbacks means those pm functions will not be
called upon hibernation - that leads to system crash on ARM during
freezing if gpio-led is used in combination with CPU led trigger.
It may happen after freeze_noirq stage (GPIO is suspended)
and before syscore_suspend stage (CPU led trigger is suspended)
- usually when disable_nonboot_cpus() is called.

Fix this by using SIMPLE_DEV_PM_OPS, which appropriately
assigns the suspend and hibernation callbacks.

Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
---
 drivers/leds/led-class.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index f37d63c..4c03808 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -198,10 +198,7 @@ static int led_resume(struct device *dev)
 	return 0;
 }
 
-static const struct dev_pm_ops leds_class_dev_pm_ops = {
-	.suspend        = led_suspend,
-	.resume         = led_resume,
-};
+static SIMPLE_DEV_PM_OPS(leds_class_dev_pm_ops, led_suspend, led_resume);
 
 /**
  * led_classdev_register - register a new object of led_classdev class.
-- 
1.9.1

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

end of thread, other threads:[~2015-02-02 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02 16:33 [PATCH] leds: add hibernation callbacks grygorii.strashko
2015-02-02 16:33 ` grygorii.strashko at linaro.org
2015-02-02 16:33 ` grygorii.strashko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.