All of lore.kernel.org
 help / color / mirror / Atom feed
* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-06-13  2:39 ` Zhang Bo
  0 siblings, 0 replies; 21+ messages in thread
From: Zhang Bo @ 2017-06-13  2:39 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: rpurdie, pavel, jacek.anaszewski, linus.walleij, ulf.hansson,
	grygorii.strashko, linux-leds

This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.

System cannot enter suspend mode because of heartbeat led trigger.
In autosleep_wq, try_to_suspend function will try to enter suspend
mode in specific period. it will get wakeup_count then call pm_notifier
chain callback function and freeze processes.
Heartbeat_pm_notifier is called and it call led_trigger_unregister to
change the trigger of led device to none. It will send uevent message
and the wakeup source count changed. As wakeup_count changed, suspend
will abort.

Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
---
 drivers/leds/trigger/ledtrig-heartbeat.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c
index afa3b40..e95ea65 100644
--- a/drivers/leds/trigger/ledtrig-heartbeat.c
+++ b/drivers/leds/trigger/ledtrig-heartbeat.c
@@ -20,7 +20,6 @@
 #include <linux/sched/loadavg.h>
 #include <linux/leds.h>
 #include <linux/reboot.h>
-#include <linux/suspend.h>
 #include "../leds.h"
 
 static int panic_heartbeats;
@@ -163,30 +162,6 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev)
 	.deactivate = heartbeat_trig_deactivate,
 };
 
-static int heartbeat_pm_notifier(struct notifier_block *nb,
-				 unsigned long pm_event, void *unused)
-{
-	int rc;
-
-	switch (pm_event) {
-	case PM_SUSPEND_PREPARE:
-	case PM_HIBERNATION_PREPARE:
-	case PM_RESTORE_PREPARE:
-		led_trigger_unregister(&heartbeat_led_trigger);
-		break;
-	case PM_POST_SUSPEND:
-	case PM_POST_HIBERNATION:
-	case PM_POST_RESTORE:
-		rc = led_trigger_register(&heartbeat_led_trigger);
-		if (rc)
-			pr_err("could not re-register heartbeat trigger\n");
-		break;
-	default:
-		break;
-	}
-	return NOTIFY_DONE;
-}
-
 static int heartbeat_reboot_notifier(struct notifier_block *nb,
 				     unsigned long code, void *unused)
 {
@@ -201,10 +176,6 @@ static int heartbeat_panic_notifier(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block heartbeat_pm_nb = {
-	.notifier_call = heartbeat_pm_notifier,
-};
-
 static struct notifier_block heartbeat_reboot_nb = {
 	.notifier_call = heartbeat_reboot_notifier,
 };
@@ -221,14 +192,12 @@ static int __init heartbeat_trig_init(void)
 		atomic_notifier_chain_register(&panic_notifier_list,
 					       &heartbeat_panic_nb);
 		register_reboot_notifier(&heartbeat_reboot_nb);
-		register_pm_notifier(&heartbeat_pm_nb);
 	}
 	return rc;
 }
 
 static void __exit heartbeat_trig_exit(void)
 {
-	unregister_pm_notifier(&heartbeat_pm_nb);
 	unregister_reboot_notifier(&heartbeat_reboot_nb);
 	atomic_notifier_chain_unregister(&panic_notifier_list,
 					 &heartbeat_panic_nb);
-- 
1.9.1

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-06-13  2:39 ` Zhang Bo
  0 siblings, 0 replies; 21+ messages in thread
From: Zhang Bo @ 2017-06-13  2:39 UTC (permalink / raw)
  To: linux-arm-kernel

This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.

System cannot enter suspend mode because of heartbeat led trigger.
In autosleep_wq, try_to_suspend function will try to enter suspend
mode in specific period. it will get wakeup_count then call pm_notifier
chain callback function and freeze processes.
Heartbeat_pm_notifier is called and it call led_trigger_unregister to
change the trigger of led device to none. It will send uevent message
and the wakeup source count changed. As wakeup_count changed, suspend
will abort.

Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
---
 drivers/leds/trigger/ledtrig-heartbeat.c | 31 -------------------------------
 1 file changed, 31 deletions(-)

diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c
index afa3b40..e95ea65 100644
--- a/drivers/leds/trigger/ledtrig-heartbeat.c
+++ b/drivers/leds/trigger/ledtrig-heartbeat.c
@@ -20,7 +20,6 @@
 #include <linux/sched/loadavg.h>
 #include <linux/leds.h>
 #include <linux/reboot.h>
-#include <linux/suspend.h>
 #include "../leds.h"
 
 static int panic_heartbeats;
@@ -163,30 +162,6 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev)
 	.deactivate = heartbeat_trig_deactivate,
 };
 
-static int heartbeat_pm_notifier(struct notifier_block *nb,
-				 unsigned long pm_event, void *unused)
-{
-	int rc;
-
-	switch (pm_event) {
-	case PM_SUSPEND_PREPARE:
-	case PM_HIBERNATION_PREPARE:
-	case PM_RESTORE_PREPARE:
-		led_trigger_unregister(&heartbeat_led_trigger);
-		break;
-	case PM_POST_SUSPEND:
-	case PM_POST_HIBERNATION:
-	case PM_POST_RESTORE:
-		rc = led_trigger_register(&heartbeat_led_trigger);
-		if (rc)
-			pr_err("could not re-register heartbeat trigger\n");
-		break;
-	default:
-		break;
-	}
-	return NOTIFY_DONE;
-}
-
 static int heartbeat_reboot_notifier(struct notifier_block *nb,
 				     unsigned long code, void *unused)
 {
@@ -201,10 +176,6 @@ static int heartbeat_panic_notifier(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block heartbeat_pm_nb = {
-	.notifier_call = heartbeat_pm_notifier,
-};
-
 static struct notifier_block heartbeat_reboot_nb = {
 	.notifier_call = heartbeat_reboot_notifier,
 };
@@ -221,14 +192,12 @@ static int __init heartbeat_trig_init(void)
 		atomic_notifier_chain_register(&panic_notifier_list,
 					       &heartbeat_panic_nb);
 		register_reboot_notifier(&heartbeat_reboot_nb);
-		register_pm_notifier(&heartbeat_pm_nb);
 	}
 	return rc;
 }
 
 static void __exit heartbeat_trig_exit(void)
 {
-	unregister_pm_notifier(&heartbeat_pm_nb);
 	unregister_reboot_notifier(&heartbeat_reboot_nb);
 	atomic_notifier_chain_unregister(&panic_notifier_list,
 					 &heartbeat_panic_nb);
-- 
1.9.1

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-06-13  2:39 ` Zhang Bo
@ 2017-06-13  7:31   ` Pavel Machek
  -1 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-06-13  7:31 UTC (permalink / raw)
  To: Zhang Bo
  Cc: linux-arm-kernel, rpurdie, jacek.anaszewski, linus.walleij,
	ulf.hansson, grygorii.strashko, linux-leds

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

On Tue 2017-06-13 10:39:20, Zhang Bo wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> 
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
> 
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

Yes, this makes sense. Turning led off should be done at driver level.

As this fixes a regression, it would be kind of nice to get it to
v4.12...

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-06-13  7:31   ` Pavel Machek
  0 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-06-13  7:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue 2017-06-13 10:39:20, Zhang Bo wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> 
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
> 
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

Yes, this makes sense. Turning led off should be done at driver level.

As this fixes a regression, it would be kind of nice to get it to
v4.12...

Acked-by: Pavel Machek <pavel@ucw.cz>

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170613/75079f2d/attachment.sig>

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-06-13  2:39 ` Zhang Bo
@ 2017-06-13  9:35   ` Linus Walleij
  -1 siblings, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2017-06-13  9:35 UTC (permalink / raw)
  To: Zhang Bo
  Cc: linux-arm-kernel, Richard Purdie, Pavel Machek, Jacek Anaszewski,
	Ulf Hansson, Grygorii Strashko, linux-leds

On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:

> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
>
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

OK I was stupid, lesson learned.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-06-13  9:35   ` Linus Walleij
  0 siblings, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2017-06-13  9:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:

> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
>
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

OK I was stupid, lesson learned.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-06-13  2:39 ` Zhang Bo
@ 2017-06-13 18:44   ` Jacek Anaszewski
  -1 siblings, 0 replies; 21+ messages in thread
From: Jacek Anaszewski @ 2017-06-13 18:44 UTC (permalink / raw)
  To: Zhang Bo, linux-arm-kernel
  Cc: rpurdie, pavel, linus.walleij, ulf.hansson, grygorii.strashko,
	linux-leds

Hi Bo,

On 06/13/2017 04:39 AM, Zhang Bo wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> 
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
> 
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> ---
>  drivers/leds/trigger/ledtrig-heartbeat.c | 31 -------------------------------
>  1 file changed, 31 deletions(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c
> index afa3b40..e95ea65 100644
> --- a/drivers/leds/trigger/ledtrig-heartbeat.c
> +++ b/drivers/leds/trigger/ledtrig-heartbeat.c
> @@ -20,7 +20,6 @@
>  #include <linux/sched/loadavg.h>
>  #include <linux/leds.h>
>  #include <linux/reboot.h>
> -#include <linux/suspend.h>
>  #include "../leds.h"
>  
>  static int panic_heartbeats;
> @@ -163,30 +162,6 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev)
>  	.deactivate = heartbeat_trig_deactivate,
>  };
>  
> -static int heartbeat_pm_notifier(struct notifier_block *nb,
> -				 unsigned long pm_event, void *unused)
> -{
> -	int rc;
> -
> -	switch (pm_event) {
> -	case PM_SUSPEND_PREPARE:
> -	case PM_HIBERNATION_PREPARE:
> -	case PM_RESTORE_PREPARE:
> -		led_trigger_unregister(&heartbeat_led_trigger);
> -		break;
> -	case PM_POST_SUSPEND:
> -	case PM_POST_HIBERNATION:
> -	case PM_POST_RESTORE:
> -		rc = led_trigger_register(&heartbeat_led_trigger);
> -		if (rc)
> -			pr_err("could not re-register heartbeat trigger\n");
> -		break;
> -	default:
> -		break;
> -	}
> -	return NOTIFY_DONE;
> -}
> -
>  static int heartbeat_reboot_notifier(struct notifier_block *nb,
>  				     unsigned long code, void *unused)
>  {
> @@ -201,10 +176,6 @@ static int heartbeat_panic_notifier(struct notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block heartbeat_pm_nb = {
> -	.notifier_call = heartbeat_pm_notifier,
> -};
> -
>  static struct notifier_block heartbeat_reboot_nb = {
>  	.notifier_call = heartbeat_reboot_notifier,
>  };
> @@ -221,14 +192,12 @@ static int __init heartbeat_trig_init(void)
>  		atomic_notifier_chain_register(&panic_notifier_list,
>  					       &heartbeat_panic_nb);
>  		register_reboot_notifier(&heartbeat_reboot_nb);
> -		register_pm_notifier(&heartbeat_pm_nb);
>  	}
>  	return rc;
>  }
>  
>  static void __exit heartbeat_trig_exit(void)
>  {
> -	unregister_pm_notifier(&heartbeat_pm_nb);
>  	unregister_reboot_notifier(&heartbeat_reboot_nb);
>  	atomic_notifier_chain_unregister(&panic_notifier_list,
>  					 &heartbeat_panic_nb);
> 

Thanks for the patch.

Added tag:

 Fixes: 5ab92a7cb82c ("leds: handle suspend/resume in heartbeat trigger")

and applied to the fixes-for-4.12-rc6 branch of linux-leds.git.

-- 
Best regards,
Jacek Anaszewski

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-06-13 18:44   ` Jacek Anaszewski
  0 siblings, 0 replies; 21+ messages in thread
From: Jacek Anaszewski @ 2017-06-13 18:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Bo,

On 06/13/2017 04:39 AM, Zhang Bo wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> 
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
> 
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> ---
>  drivers/leds/trigger/ledtrig-heartbeat.c | 31 -------------------------------
>  1 file changed, 31 deletions(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/leds/trigger/ledtrig-heartbeat.c
> index afa3b40..e95ea65 100644
> --- a/drivers/leds/trigger/ledtrig-heartbeat.c
> +++ b/drivers/leds/trigger/ledtrig-heartbeat.c
> @@ -20,7 +20,6 @@
>  #include <linux/sched/loadavg.h>
>  #include <linux/leds.h>
>  #include <linux/reboot.h>
> -#include <linux/suspend.h>
>  #include "../leds.h"
>  
>  static int panic_heartbeats;
> @@ -163,30 +162,6 @@ static void heartbeat_trig_deactivate(struct led_classdev *led_cdev)
>  	.deactivate = heartbeat_trig_deactivate,
>  };
>  
> -static int heartbeat_pm_notifier(struct notifier_block *nb,
> -				 unsigned long pm_event, void *unused)
> -{
> -	int rc;
> -
> -	switch (pm_event) {
> -	case PM_SUSPEND_PREPARE:
> -	case PM_HIBERNATION_PREPARE:
> -	case PM_RESTORE_PREPARE:
> -		led_trigger_unregister(&heartbeat_led_trigger);
> -		break;
> -	case PM_POST_SUSPEND:
> -	case PM_POST_HIBERNATION:
> -	case PM_POST_RESTORE:
> -		rc = led_trigger_register(&heartbeat_led_trigger);
> -		if (rc)
> -			pr_err("could not re-register heartbeat trigger\n");
> -		break;
> -	default:
> -		break;
> -	}
> -	return NOTIFY_DONE;
> -}
> -
>  static int heartbeat_reboot_notifier(struct notifier_block *nb,
>  				     unsigned long code, void *unused)
>  {
> @@ -201,10 +176,6 @@ static int heartbeat_panic_notifier(struct notifier_block *nb,
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block heartbeat_pm_nb = {
> -	.notifier_call = heartbeat_pm_notifier,
> -};
> -
>  static struct notifier_block heartbeat_reboot_nb = {
>  	.notifier_call = heartbeat_reboot_notifier,
>  };
> @@ -221,14 +192,12 @@ static int __init heartbeat_trig_init(void)
>  		atomic_notifier_chain_register(&panic_notifier_list,
>  					       &heartbeat_panic_nb);
>  		register_reboot_notifier(&heartbeat_reboot_nb);
> -		register_pm_notifier(&heartbeat_pm_nb);
>  	}
>  	return rc;
>  }
>  
>  static void __exit heartbeat_trig_exit(void)
>  {
> -	unregister_pm_notifier(&heartbeat_pm_nb);
>  	unregister_reboot_notifier(&heartbeat_reboot_nb);
>  	atomic_notifier_chain_unregister(&panic_notifier_list,
>  					 &heartbeat_panic_nb);
> 

Thanks for the patch.

Added tag:

 Fixes: 5ab92a7cb82c ("leds: handle suspend/resume in heartbeat trigger")

and applied to the fixes-for-4.12-rc6 branch of linux-leds.git.

-- 
Best regards,
Jacek Anaszewski

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-06-13  9:35   ` Linus Walleij
@ 2017-07-13 12:03     ` Pavel Machek
  -1 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-07-13 12:03 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Zhang Bo, linux-arm-kernel, Richard Purdie, Jacek Anaszewski,
	Ulf Hansson, Grygorii Strashko, linux-leds

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

On Tue 2017-06-13 11:35:22, Linus Walleij wrote:
> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> 
> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >
> > System cannot enter suspend mode because of heartbeat led trigger.
> > In autosleep_wq, try_to_suspend function will try to enter suspend
> > mode in specific period. it will get wakeup_count then call pm_notifier
> > chain callback function and freeze processes.
> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> > change the trigger of led device to none. It will send uevent message
> > and the wakeup source count changed. As wakeup_count changed, suspend
> > will abort.
> >
> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> 
> OK I was stupid, lesson learned.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

You may still want to submit patch to turn the LED off over suspend
for your platform...

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-07-13 12:03     ` Pavel Machek
  0 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-07-13 12:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue 2017-06-13 11:35:22, Linus Walleij wrote:
> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> 
> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >
> > System cannot enter suspend mode because of heartbeat led trigger.
> > In autosleep_wq, try_to_suspend function will try to enter suspend
> > mode in specific period. it will get wakeup_count then call pm_notifier
> > chain callback function and freeze processes.
> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> > change the trigger of led device to none. It will send uevent message
> > and the wakeup source count changed. As wakeup_count changed, suspend
> > will abort.
> >
> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> 
> OK I was stupid, lesson learned.
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

You may still want to submit patch to turn the LED off over suspend
for your platform...

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170713/26983c1c/attachment-0001.sig>

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-07-13 12:03     ` Pavel Machek
@ 2017-07-13 12:46       ` Linus Walleij
  -1 siblings, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2017-07-13 12:46 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Zhang Bo, linux-arm-kernel, Richard Purdie, Jacek Anaszewski,
	Ulf Hansson, Grygorii Strashko, linux-leds

On Thu, Jul 13, 2017 at 2:03 PM, Pavel Machek <pavel@ucw.cz> wrote:
> On Tue 2017-06-13 11:35:22, Linus Walleij wrote:
>> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
>>
>> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>> >
>> > System cannot enter suspend mode because of heartbeat led trigger.
>> > In autosleep_wq, try_to_suspend function will try to enter suspend
>> > mode in specific period. it will get wakeup_count then call pm_notifier
>> > chain callback function and freeze processes.
>> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
>> > change the trigger of led device to none. It will send uevent message
>> > and the wakeup source count changed. As wakeup_count changed, suspend
>> > will abort.
>> >
>> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
>>
>> OK I was stupid, lesson learned.
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> You may still want to submit patch to turn the LED off over suspend
> for your platform...

I think it would make more sense to have the LED subsystem handle
that. Given that it already keeps track of LED_SUSPENDED in a
special flag.

Probably optionally, like LEDs can opt in to be turned off during
suspend.

Yours,
Linus Walleij

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-07-13 12:46       ` Linus Walleij
  0 siblings, 0 replies; 21+ messages in thread
From: Linus Walleij @ 2017-07-13 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jul 13, 2017 at 2:03 PM, Pavel Machek <pavel@ucw.cz> wrote:
> On Tue 2017-06-13 11:35:22, Linus Walleij wrote:
>> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
>>
>> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>> >
>> > System cannot enter suspend mode because of heartbeat led trigger.
>> > In autosleep_wq, try_to_suspend function will try to enter suspend
>> > mode in specific period. it will get wakeup_count then call pm_notifier
>> > chain callback function and freeze processes.
>> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
>> > change the trigger of led device to none. It will send uevent message
>> > and the wakeup source count changed. As wakeup_count changed, suspend
>> > will abort.
>> >
>> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
>>
>> OK I was stupid, lesson learned.
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> You may still want to submit patch to turn the LED off over suspend
> for your platform...

I think it would make more sense to have the LED subsystem handle
that. Given that it already keeps track of LED_SUSPENDED in a
special flag.

Probably optionally, like LEDs can opt in to be turned off during
suspend.

Yours,
Linus Walleij

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-06-13  2:39 ` Zhang Bo
@ 2017-08-23 14:02   ` Geert Uytterhoeven
  -1 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2017-08-23 14:02 UTC (permalink / raw)
  To: Zhang Bo
  Cc: linux-arm-kernel, Ulf Hansson, Grygorii Strashko, Linus Walleij,
	Richard Purdie, Jacek Anaszewski, Pavel Machek, linux-leds

Hi Zhang,

On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
>
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).

Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
for heartbeat, I can actually suspend the system using s2ram.
However, after system resume the heartbeat LED no longer flashes.
/sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
wasn't restored to "heartbeat" by the notifier.
There's no "could not re-register heartbeat trigger" message printed.

Backporting the revert fixes this.

Gr{oetje,eeting}s,

                        Geert

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-08-23 14:02   ` Geert Uytterhoeven
  0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2017-08-23 14:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Zhang,

On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>
> System cannot enter suspend mode because of heartbeat led trigger.
> In autosleep_wq, try_to_suspend function will try to enter suspend
> mode in specific period. it will get wakeup_count then call pm_notifier
> chain callback function and freeze processes.
> Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> change the trigger of led device to none. It will send uevent message
> and the wakeup source count changed. As wakeup_count changed, suspend
> will abort.
>
> Signed-off-by: Zhang Bo <bo.zhang@nxp.com>

While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).

Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
for heartbeat, I can actually suspend the system using s2ram.
However, after system resume the heartbeat LED no longer flashes.
/sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
wasn't restored to "heartbeat" by the notifier.
There's no "could not re-register heartbeat trigger" message printed.

Backporting the revert fixes this.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-08-23 14:02   ` Geert Uytterhoeven
@ 2017-08-23 19:34     ` Pavel Machek
  -1 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-08-23 19:34 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Zhang Bo, linux-arm-kernel, Ulf Hansson, Grygorii Strashko,
	Linus Walleij, Richard Purdie, Jacek Anaszewski, linux-leds

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

Hi!

> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >
> > System cannot enter suspend mode because of heartbeat led trigger.
> > In autosleep_wq, try_to_suspend function will try to enter suspend
> > mode in specific period. it will get wakeup_count then call pm_notifier
> > chain callback function and freeze processes.
> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> > change the trigger of led device to none. It will send uevent message
> > and the wakeup source count changed. As wakeup_count changed, suspend
> > will abort.
> >
> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> 
> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
> 
> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
> for heartbeat, I can actually suspend the system using s2ram.
> However, after system resume the heartbeat LED no longer flashes.
> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
> wasn't restored to "heartbeat" by the notifier.
> There's no "could not re-register heartbeat trigger" message printed.
> 
> Backporting the revert fixes this.

You have my Acked-by: if you want to submit this to some -stable
kernels...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-08-23 19:34     ` Pavel Machek
  0 siblings, 0 replies; 21+ messages in thread
From: Pavel Machek @ 2017-08-23 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >
> > System cannot enter suspend mode because of heartbeat led trigger.
> > In autosleep_wq, try_to_suspend function will try to enter suspend
> > mode in specific period. it will get wakeup_count then call pm_notifier
> > chain callback function and freeze processes.
> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> > change the trigger of led device to none. It will send uevent message
> > and the wakeup source count changed. As wakeup_count changed, suspend
> > will abort.
> >
> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> 
> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
> 
> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
> for heartbeat, I can actually suspend the system using s2ram.
> However, after system resume the heartbeat LED no longer flashes.
> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
> wasn't restored to "heartbeat" by the notifier.
> There's no "could not re-register heartbeat trigger" message printed.
> 
> Backporting the revert fixes this.

You have my Acked-by: if you want to submit this to some -stable
kernels...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170823/12e18239/attachment.sig>

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-08-23 19:34     ` Pavel Machek
  (?)
@ 2017-08-25  8:23       ` Geert Uytterhoeven
  -1 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2017-08-25  8:23 UTC (permalink / raw)
  To: Pavel Machek, stable
  Cc: Zhang Bo, linux-arm-kernel, Ulf Hansson, Grygorii Strashko,
	Linus Walleij, Richard Purdie, Jacek Anaszewski, linux-leds,
	ltsi-dev

On Wed, Aug 23, 2017 at 9:34 PM, Pavel Machek <pavel@ucw.cz> wrote:
>> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
>> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>> >
>> > System cannot enter suspend mode because of heartbeat led trigger.
>> > In autosleep_wq, try_to_suspend function will try to enter suspend
>> > mode in specific period. it will get wakeup_count then call pm_notifier
>> > chain callback function and freeze processes.
>> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
>> > change the trigger of led device to none. It will send uevent message
>> > and the wakeup source count changed. As wakeup_count changed, suspend
>> > will abort.
>> >
>> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
>>
>> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
>> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
>> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
>>
>> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
>> for heartbeat, I can actually suspend the system using s2ram.
>> However, after system resume the heartbeat LED no longer flashes.
>> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
>> wasn't restored to "heartbeat" by the notifier.
>> There's no "could not re-register heartbeat trigger" message printed.
>>
>> Backporting the revert fixes this.
>
> You have my Acked-by: if you want to submit this to some -stable
> kernels...

Thank you!

Greg: Can you please queue 436c4c45b5b9562b ("Revert "leds: handle
suspend/resume in heartbeat trigger"") for v4.9.x or v4.9-ltsi?
Thanks!

Gr{oetje,eeting}s,

                        Geert

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-08-25  8:23       ` Geert Uytterhoeven
  0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2017-08-25  8:23 UTC (permalink / raw)
  To: Pavel Machek, stable
  Cc: Zhang Bo, linux-arm-kernel, Ulf Hansson, Grygorii Strashko,
	Linus Walleij, Richard Purdie, Jacek Anaszewski, linux-leds,
	ltsi-dev

On Wed, Aug 23, 2017 at 9:34 PM, Pavel Machek <pavel@ucw.cz> wrote:
>> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
>> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>> >
>> > System cannot enter suspend mode because of heartbeat led trigger.
>> > In autosleep_wq, try_to_suspend function will try to enter suspend
>> > mode in specific period. it will get wakeup_count then call pm_notifier
>> > chain callback function and freeze processes.
>> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
>> > change the trigger of led device to none. It will send uevent message
>> > and the wakeup source count changed. As wakeup_count changed, suspend
>> > will abort.
>> >
>> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
>>
>> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
>> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
>> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
>>
>> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
>> for heartbeat, I can actually suspend the system using s2ram.
>> However, after system resume the heartbeat LED no longer flashes.
>> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
>> wasn't restored to "heartbeat" by the notifier.
>> There's no "could not re-register heartbeat trigger" message printed.
>>
>> Backporting the revert fixes this.
>
> You have my Acked-by: if you want to submit this to some -stable
> kernels...

Thank you!

Greg: Can you please queue 436c4c45b5b9562b ("Revert "leds: handle
suspend/resume in heartbeat trigger"") for v4.9.x or v4.9-ltsi?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-08-25  8:23       ` Geert Uytterhoeven
  0 siblings, 0 replies; 21+ messages in thread
From: Geert Uytterhoeven @ 2017-08-25  8:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 23, 2017 at 9:34 PM, Pavel Machek <pavel@ucw.cz> wrote:
>> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
>> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
>> >
>> > System cannot enter suspend mode because of heartbeat led trigger.
>> > In autosleep_wq, try_to_suspend function will try to enter suspend
>> > mode in specific period. it will get wakeup_count then call pm_notifier
>> > chain callback function and freeze processes.
>> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
>> > change the trigger of led device to none. It will send uevent message
>> > and the wakeup source count changed. As wakeup_count changed, suspend
>> > will abort.
>> >
>> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
>>
>> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
>> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
>> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
>>
>> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
>> for heartbeat, I can actually suspend the system using s2ram.
>> However, after system resume the heartbeat LED no longer flashes.
>> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
>> wasn't restored to "heartbeat" by the notifier.
>> There's no "could not re-register heartbeat trigger" message printed.
>>
>> Backporting the revert fixes this.
>
> You have my Acked-by: if you want to submit this to some -stable
> kernels...

Thank you!

Greg: Can you please queue 436c4c45b5b9562b ("Revert "leds: handle
suspend/resume in heartbeat trigger"") for v4.9.x or v4.9-ltsi?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
  2017-08-25  8:23       ` Geert Uytterhoeven
@ 2017-08-27 12:46         ` Greg KH
  -1 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2017-08-27 12:46 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Pavel Machek, stable, Zhang Bo, linux-arm-kernel, Ulf Hansson,
	Grygorii Strashko, Linus Walleij, Richard Purdie,
	Jacek Anaszewski, linux-leds, ltsi-dev

On Fri, Aug 25, 2017 at 10:23:11AM +0200, Geert Uytterhoeven wrote:
> On Wed, Aug 23, 2017 at 9:34 PM, Pavel Machek <pavel@ucw.cz> wrote:
> >> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> >> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >> >
> >> > System cannot enter suspend mode because of heartbeat led trigger.
> >> > In autosleep_wq, try_to_suspend function will try to enter suspend
> >> > mode in specific period. it will get wakeup_count then call pm_notifier
> >> > chain callback function and freeze processes.
> >> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> >> > change the trigger of led device to none. It will send uevent message
> >> > and the wakeup source count changed. As wakeup_count changed, suspend
> >> > will abort.
> >> >
> >> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> >>
> >> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
> >> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
> >> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
> >>
> >> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
> >> for heartbeat, I can actually suspend the system using s2ram.
> >> However, after system resume the heartbeat LED no longer flashes.
> >> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
> >> wasn't restored to "heartbeat" by the notifier.
> >> There's no "could not re-register heartbeat trigger" message printed.
> >>
> >> Backporting the revert fixes this.
> >
> > You have my Acked-by: if you want to submit this to some -stable
> > kernels...
> 
> Thank you!
> 
> Greg: Can you please queue 436c4c45b5b9562b ("Revert "leds: handle
> suspend/resume in heartbeat trigger"") for v4.9.x or v4.9-ltsi?
> Thanks!

Now applied, thanks.

greg k-h

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

* [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger"
@ 2017-08-27 12:46         ` Greg KH
  0 siblings, 0 replies; 21+ messages in thread
From: Greg KH @ 2017-08-27 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Aug 25, 2017 at 10:23:11AM +0200, Geert Uytterhoeven wrote:
> On Wed, Aug 23, 2017 at 9:34 PM, Pavel Machek <pavel@ucw.cz> wrote:
> >> On Tue, Jun 13, 2017 at 4:39 AM, Zhang Bo <bo.zhang@nxp.com> wrote:
> >> > This reverts commit 5ab92a7cb82c66bf30685583a38a18538e3807db.
> >> >
> >> > System cannot enter suspend mode because of heartbeat led trigger.
> >> > In autosleep_wq, try_to_suspend function will try to enter suspend
> >> > mode in specific period. it will get wakeup_count then call pm_notifier
> >> > chain callback function and freeze processes.
> >> > Heartbeat_pm_notifier is called and it call led_trigger_unregister to
> >> > change the trigger of led device to none. It will send uevent message
> >> > and the wakeup source count changed. As wakeup_count changed, suspend
> >> > will abort.
> >> >
> >> > Signed-off-by: Zhang Bo <bo.zhang@nxp.com>
> >>
> >> While investigating an heartbeat LED issue in v4.9.40-ltsi, I stumpled on this
> >> revert (commit 436c4c45b5b9562b ("Revert "leds: handle suspend/resume in
> >> heartbeat trigger"") in v4.12-rc6), which was not backported to v4.9 (yet).
> >>
> >> Interestingly, while running v4.9.x on r8a7791/koelsch with an LED configured
> >> for heartbeat, I can actually suspend the system using s2ram.
> >> However, after system resume the heartbeat LED no longer flashes.
> >> /sys/class/leds/LED6/trigger shows the trigger is still "none", and thus
> >> wasn't restored to "heartbeat" by the notifier.
> >> There's no "could not re-register heartbeat trigger" message printed.
> >>
> >> Backporting the revert fixes this.
> >
> > You have my Acked-by: if you want to submit this to some -stable
> > kernels...
> 
> Thank you!
> 
> Greg: Can you please queue 436c4c45b5b9562b ("Revert "leds: handle
> suspend/resume in heartbeat trigger"") for v4.9.x or v4.9-ltsi?
> Thanks!

Now applied, thanks.

greg k-h

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

end of thread, other threads:[~2017-08-27 12:46 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-13  2:39 [[PATCH]] Revert "leds: handle suspend/resume in heartbeat trigger" Zhang Bo
2017-06-13  2:39 ` Zhang Bo
2017-06-13  7:31 ` Pavel Machek
2017-06-13  7:31   ` Pavel Machek
2017-06-13  9:35 ` Linus Walleij
2017-06-13  9:35   ` Linus Walleij
2017-07-13 12:03   ` Pavel Machek
2017-07-13 12:03     ` Pavel Machek
2017-07-13 12:46     ` Linus Walleij
2017-07-13 12:46       ` Linus Walleij
2017-06-13 18:44 ` Jacek Anaszewski
2017-06-13 18:44   ` Jacek Anaszewski
2017-08-23 14:02 ` Geert Uytterhoeven
2017-08-23 14:02   ` Geert Uytterhoeven
2017-08-23 19:34   ` Pavel Machek
2017-08-23 19:34     ` Pavel Machek
2017-08-25  8:23     ` Geert Uytterhoeven
2017-08-25  8:23       ` Geert Uytterhoeven
2017-08-25  8:23       ` Geert Uytterhoeven
2017-08-27 12:46       ` Greg KH
2017-08-27 12:46         ` Greg KH

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.