linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / reboot: Use S5 for reboot
@ 2020-10-30  7:06 Kai-Heng Feng
  2020-10-30  7:09 ` Kai-Heng Feng
  2020-11-10 18:02 ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Kai-Heng Feng @ 2020-10-30  7:06 UTC (permalink / raw)
  To: rafael.j.wysocki
  Cc: hdegoede, linux-acpi, Kai-Heng Feng, Petr Mladek, Mike Rapoport,
	Guenter Roeck, Pavel Tatashin, Michael Ellerman, Kees Cook,
	open list

After reboot, it's not possible to use hotkeys to enter BIOS setup and
boot menu on some HP laptops.

BIOS folks identified the root cause is the missing _PTS call, and BIOS
is expecting _PTS to do proper reset.

Using S5 for reboot is default behavior under Windows, "A full shutdown
(S5) occurs when a system restart is requested" [1], so let's do the
same here.

[1] https://docs.microsoft.com/en-us/windows/win32/power/system-power-states

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 kernel/reboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/reboot.c b/kernel/reboot.c
index e7b78d5ae1ab..7e5aa1f78693 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -244,6 +244,8 @@ void migrate_to_reboot_cpu(void)
 void kernel_restart(char *cmd)
 {
 	kernel_restart_prepare(cmd);
+	if (pm_power_off_prepare)
+		pm_power_off_prepare();
 	migrate_to_reboot_cpu();
 	syscore_shutdown();
 	if (!cmd)
-- 
2.17.1


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

* Re: [PATCH] PM / reboot: Use S5 for reboot
  2020-10-30  7:06 [PATCH] PM / reboot: Use S5 for reboot Kai-Heng Feng
@ 2020-10-30  7:09 ` Kai-Heng Feng
  2020-10-30 10:01   ` Hans de Goede
  2020-11-10 18:02 ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Kai-Heng Feng @ 2020-10-30  7:09 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Wysocki, Rafael J, linux-acpi, Petr Mladek, Mike Rapoport,
	Guenter Roeck, Pavel Tatashin, Michael Ellerman, Kees Cook,
	open list

Hi Hans,

> On Oct 30, 2020, at 15:06, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
> 
> After reboot, it's not possible to use hotkeys to enter BIOS setup and
> boot menu on some HP laptops.
> 
> BIOS folks identified the root cause is the missing _PTS call, and BIOS
> is expecting _PTS to do proper reset.
> 
> Using S5 for reboot is default behavior under Windows, "A full shutdown
> (S5) occurs when a system restart is requested" [1], so let's do the
> same here.

I wonder if this can also solve "HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown" fixed.

Kai-Heng

> 
> [1] https://docs.microsoft.com/en-us/windows/win32/power/system-power-states
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> kernel/reboot.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index e7b78d5ae1ab..7e5aa1f78693 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -244,6 +244,8 @@ void migrate_to_reboot_cpu(void)
> void kernel_restart(char *cmd)
> {
> 	kernel_restart_prepare(cmd);
> +	if (pm_power_off_prepare)
> +		pm_power_off_prepare();
> 	migrate_to_reboot_cpu();
> 	syscore_shutdown();
> 	if (!cmd)
> -- 
> 2.17.1
> 


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

* Re: [PATCH] PM / reboot: Use S5 for reboot
  2020-10-30  7:09 ` Kai-Heng Feng
@ 2020-10-30 10:01   ` Hans de Goede
  0 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2020-10-30 10:01 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: Wysocki, Rafael J, linux-acpi, Petr Mladek, Mike Rapoport,
	Guenter Roeck, Pavel Tatashin, Michael Ellerman, Kees Cook,
	open list

Hi,

On 10/30/20 8:09 AM, Kai-Heng Feng wrote:
> Hi Hans,
> 
>> On Oct 30, 2020, at 15:06, Kai-Heng Feng <kai.heng.feng@canonical.com> wrote:
>>
>> After reboot, it's not possible to use hotkeys to enter BIOS setup and
>> boot menu on some HP laptops.
>>
>> BIOS folks identified the root cause is the missing _PTS call, and BIOS
>> is expecting _PTS to do proper reset.
>>
>> Using S5 for reboot is default behavior under Windows, "A full shutdown
>> (S5) occurs when a system restart is requested" [1], so let's do the
>> same here.
> 
> I wonder if this can also solve "HID: i2c-hid: Put ACPI enumerated devices in D3 on shutdown" fixed.

I just checked the _PTS of one of the devices with the SMO91D0 i2c-hid
sensor-hub and it does not appear to turn off the sensor-hub (or any
other devices for that matter). Specifically it does not touch the
GPIO used by the _PS0 / _PS3 methods of the SMO91D0.

Regards,

Hans




>> [1] https://docs.microsoft.com/en-us/windows/win32/power/system-power-states
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
>> ---
>> kernel/reboot.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/kernel/reboot.c b/kernel/reboot.c
>> index e7b78d5ae1ab..7e5aa1f78693 100644
>> --- a/kernel/reboot.c
>> +++ b/kernel/reboot.c
>> @@ -244,6 +244,8 @@ void migrate_to_reboot_cpu(void)
>> void kernel_restart(char *cmd)
>> {
>> 	kernel_restart_prepare(cmd);
>> +	if (pm_power_off_prepare)
>> +		pm_power_off_prepare();
>> 	migrate_to_reboot_cpu();
>> 	syscore_shutdown();
>> 	if (!cmd)
>> -- 
>> 2.17.1
>>
> 


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

* Re: [PATCH] PM / reboot: Use S5 for reboot
  2020-10-30  7:06 [PATCH] PM / reboot: Use S5 for reboot Kai-Heng Feng
  2020-10-30  7:09 ` Kai-Heng Feng
@ 2020-11-10 18:02 ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-11-10 18:02 UTC (permalink / raw)
  To: Kai-Heng Feng
  Cc: Rafael Wysocki, Hans de Goede, ACPI Devel Maling List,
	Petr Mladek, Mike Rapoport, Guenter Roeck, Pavel Tatashin,
	Michael Ellerman, Kees Cook, open list

On Fri, Oct 30, 2020 at 8:07 AM Kai-Heng Feng
<kai.heng.feng@canonical.com> wrote:
>
> After reboot, it's not possible to use hotkeys to enter BIOS setup and
> boot menu on some HP laptops.
>
> BIOS folks identified the root cause is the missing _PTS call, and BIOS
> is expecting _PTS to do proper reset.
>
> Using S5 for reboot is default behavior under Windows, "A full shutdown
> (S5) occurs when a system restart is requested" [1], so let's do the
> same here.
>
> [1] https://docs.microsoft.com/en-us/windows/win32/power/system-power-states
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  kernel/reboot.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/kernel/reboot.c b/kernel/reboot.c
> index e7b78d5ae1ab..7e5aa1f78693 100644
> --- a/kernel/reboot.c
> +++ b/kernel/reboot.c
> @@ -244,6 +244,8 @@ void migrate_to_reboot_cpu(void)
>  void kernel_restart(char *cmd)
>  {
>         kernel_restart_prepare(cmd);
> +       if (pm_power_off_prepare)
> +               pm_power_off_prepare();
>         migrate_to_reboot_cpu();
>         syscore_shutdown();
>         if (!cmd)
> --

Applied as 5.11 material with a minor edit in the subject, thanks!

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

end of thread, other threads:[~2020-11-10 18:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30  7:06 [PATCH] PM / reboot: Use S5 for reboot Kai-Heng Feng
2020-10-30  7:09 ` Kai-Heng Feng
2020-10-30 10:01   ` Hans de Goede
2020-11-10 18:02 ` 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).