mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] PM: hibernate: Use kernel_can_power_off()
@ 2022-06-17 12:24 Dmitry Osipenko
  2022-06-21 19:00 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Osipenko @ 2022-06-17 12:24 UTC (permalink / raw)
  To: Rafael J . Wysocki, Ken Moffat; +Cc: linux-kernel, linux-pm

Use new kernel_can_power_off() API instead of legacy pm_power_off global
variable to fix regressed hibernation to disk where machine no longer
powers off when it should because ACPI power driver transitioned to the
new sys-off based API and it doesn't use pm_power_off anymore.

Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API")
Tested-by: Ken Moffat <zarniwhoop@ntlworld.com>
Reported-by: Ken Moffat <zarniwhhop@ntlworld.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.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 20a66bf9f465..89c71fce225d 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -665,7 +665,7 @@ static void power_down(void)
 		hibernation_platform_enter();
 		fallthrough;
 	case HIBERNATION_SHUTDOWN:
-		if (pm_power_off)
+		if (kernel_can_power_off())
 			kernel_power_off();
 		break;
 	}
-- 
2.35.3


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

* Re: [PATCH v1] PM: hibernate: Use kernel_can_power_off()
  2022-06-17 12:24 [PATCH v1] PM: hibernate: Use kernel_can_power_off() Dmitry Osipenko
@ 2022-06-21 19:00 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2022-06-21 19:00 UTC (permalink / raw)
  To: Dmitry Osipenko
  Cc: Rafael J . Wysocki, Ken Moffat, Linux Kernel Mailing List, Linux PM

On Fri, Jun 17, 2022 at 2:24 PM Dmitry Osipenko
<dmitry.osipenko@collabora.com> wrote:
>
> Use new kernel_can_power_off() API instead of legacy pm_power_off global
> variable to fix regressed hibernation to disk where machine no longer
> powers off when it should because ACPI power driver transitioned to the
> new sys-off based API and it doesn't use pm_power_off anymore.
>
> Fixes: 98f30d0ecf79 ("ACPI: power: Switch to sys-off handler API")
> Tested-by: Ken Moffat <zarniwhoop@ntlworld.com>
> Reported-by: Ken Moffat <zarniwhhop@ntlworld.com>
> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.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 20a66bf9f465..89c71fce225d 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -665,7 +665,7 @@ static void power_down(void)
>                 hibernation_platform_enter();
>                 fallthrough;
>         case HIBERNATION_SHUTDOWN:
> -               if (pm_power_off)
> +               if (kernel_can_power_off())
>                         kernel_power_off();
>                 break;
>         }
> --

Applied as 5.19-rc material, thanks!

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

end of thread, other threads:[~2022-06-21 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-17 12:24 [PATCH v1] PM: hibernate: Use kernel_can_power_off() Dmitry Osipenko
2022-06-21 19:00 ` 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

all inboxes | Powered by JetHome®