linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM: hibernate: Allow hybrid sleep to work with s2idle
@ 2022-10-13  3:50 Mario Limonciello
  2022-10-25  0:12 ` Limonciello, Mario
  0 siblings, 1 reply; 3+ messages in thread
From: Mario Limonciello @ 2022-10-13  3:50 UTC (permalink / raw)
  To: mario.limonciello, Rafael J. Wysocki, Pavel Machek, Len Brown
  Cc: kolAflash, linux-pm, linux-kernel

Hybrid sleep is currently hardcoded to only operate with S3 even
on systems that might not support it.

Instead of assuming this mode is what the user wants to use, for
hybrid sleep follow the setting of `mem_sleep_current` which
will respect mem_sleep_default kernel command line and policy
decisions made by the presence of the FADT low power idle bit.

Reported-and-tested-by: kolAflash <kolAflash@kolahilft.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 kernel/power/hibernate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 89c71fce225dd..537dd3beafc16 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -641,7 +641,7 @@ static void power_down(void)
 	int error;
 
 	if (hibernation_mode == HIBERNATION_SUSPEND) {
-		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
+		error = suspend_devices_and_enter(mem_sleep_current);
 		if (error) {
 			hibernation_mode = hibernation_ops ?
 						HIBERNATION_PLATFORM :
-- 
2.34.1


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

* Re: [PATCH] PM: hibernate: Allow hybrid sleep to work with s2idle
  2022-10-13  3:50 [PATCH] PM: hibernate: Allow hybrid sleep to work with s2idle Mario Limonciello
@ 2022-10-25  0:12 ` Limonciello, Mario
  2022-10-25 12:55   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Limonciello, Mario @ 2022-10-25  0:12 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: kolAflash, linux-pm, linux-kernel, Pavel Machek, Len Brown

On 10/12/2022 22:50, Mario Limonciello wrote:
> Hybrid sleep is currently hardcoded to only operate with S3 even
> on systems that might not support it.
> 
> Instead of assuming this mode is what the user wants to use, for
> hybrid sleep follow the setting of `mem_sleep_current` which
> will respect mem_sleep_default kernel command line and policy
> decisions made by the presence of the FADT low power idle bit.
> 
> Reported-and-tested-by: kolAflash <kolAflash@kolahilft.de>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   kernel/power/hibernate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Hi Rafael,

This got sent near the merge window a few weeks ago.  It's a trivial fix 
so I just want to make sure it didn't get misplaced.

Thanks!

> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 89c71fce225dd..537dd3beafc16 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -641,7 +641,7 @@ static void power_down(void)
>   	int error;
>   
>   	if (hibernation_mode == HIBERNATION_SUSPEND) {
> -		error = suspend_devices_and_enter(PM_SUSPEND_MEM);
> +		error = suspend_devices_and_enter(mem_sleep_current);
>   		if (error) {
>   			hibernation_mode = hibernation_ops ?
>   						HIBERNATION_PLATFORM :


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

* Re: [PATCH] PM: hibernate: Allow hybrid sleep to work with s2idle
  2022-10-25  0:12 ` Limonciello, Mario
@ 2022-10-25 12:55   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-10-25 12:55 UTC (permalink / raw)
  To: Limonciello, Mario
  Cc: Rafael J. Wysocki, kolAflash, linux-pm, linux-kernel,
	Pavel Machek, Len Brown

On Tue, Oct 25, 2022 at 2:12 AM Limonciello, Mario
<mario.limonciello@amd.com> wrote:
>
> On 10/12/2022 22:50, Mario Limonciello wrote:
> > Hybrid sleep is currently hardcoded to only operate with S3 even
> > on systems that might not support it.
> >
> > Instead of assuming this mode is what the user wants to use, for
> > hybrid sleep follow the setting of `mem_sleep_current` which
> > will respect mem_sleep_default kernel command line and policy
> > decisions made by the presence of the FADT low power idle bit.
> >
> > Reported-and-tested-by: kolAflash <kolAflash@kolahilft.de>
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=216574
> > Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> > ---
> >   kernel/power/hibernate.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Hi Rafael,
>
> This got sent near the merge window a few weeks ago.  It's a trivial fix
> so I just want to make sure it didn't get misplaced.

It wasn't lost.

I've just applied it for -rc3 (and added a Fixes: tag that was missing to it).

Thanks!

> >
> > diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> > index 89c71fce225dd..537dd3beafc16 100644
> > --- a/kernel/power/hibernate.c
> > +++ b/kernel/power/hibernate.c
> > @@ -641,7 +641,7 @@ static void power_down(void)
> >       int error;
> >
> >       if (hibernation_mode == HIBERNATION_SUSPEND) {
> > -             error = suspend_devices_and_enter(PM_SUSPEND_MEM);
> > +             error = suspend_devices_and_enter(mem_sleep_current);
> >               if (error) {
> >                       hibernation_mode = hibernation_ops ?
> >                                               HIBERNATION_PLATFORM :
>

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

end of thread, other threads:[~2022-10-25 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-13  3:50 [PATCH] PM: hibernate: Allow hybrid sleep to work with s2idle Mario Limonciello
2022-10-25  0:12 ` Limonciello, Mario
2022-10-25 12:55   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).