* [PATCH v3 2/2] PM: ACPI: reboot: Reinstate S5 for reboot
[not found] <20220913062042.1977790-1-kai.heng.feng@canonical.com>
@ 2022-09-13 6:20 ` Kai-Heng Feng
2022-09-13 15:17 ` Dmitry Osipenko
0 siblings, 1 reply; 3+ messages in thread
From: Kai-Heng Feng @ 2022-09-13 6:20 UTC (permalink / raw)
To: rafael.j.wysocki, lenb
Cc: Kai-Heng Feng, Josef Bacik, Dmitry Osipenko, Rafael J. Wysocki,
linux-acpi, linux-kernel
Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused Dell
PowerEdge r440 hangs at reboot.
The issue is fixed by commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on
system reboot to avoid triggering AER"), so use the new sysoff API to
reinstate S5 for reboot on ACPI-based systems.
Cc: Josef Bacik <josef@toxicpanda.com>
Suggested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
v3:
- Use new API to invoke ACPI S5.
v2:
- Use do_kernel_power_off_prepare() instead.
drivers/acpi/sleep.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index ad4b2987b3d6e..dce5460902eed 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -1088,6 +1088,10 @@ int __init acpi_sleep_init(void)
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
SYS_OFF_PRIO_FIRMWARE,
acpi_power_off, NULL);
+
+ register_sys_off_handler(SYS_OFF_MODE_RESTART_PREPARE,
+ SYS_OFF_PRIO_FIRMWARE,
+ acpi_power_off_prepare, NULL);
} else {
acpi_no_s5 = true;
}
--
2.36.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 2/2] PM: ACPI: reboot: Reinstate S5 for reboot
2022-09-13 6:20 ` [PATCH v3 2/2] PM: ACPI: reboot: Reinstate S5 for reboot Kai-Heng Feng
@ 2022-09-13 15:17 ` Dmitry Osipenko
2022-09-16 0:03 ` Kai-Heng Feng
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Osipenko @ 2022-09-13 15:17 UTC (permalink / raw)
To: Kai-Heng Feng, rafael.j.wysocki, lenb
Cc: Josef Bacik, Rafael J. Wysocki, linux-acpi, linux-kernel
On 9/13/22 09:20, Kai-Heng Feng wrote:
> Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused Dell
> PowerEdge r440 hangs at reboot.
>
> The issue is fixed by commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on
> system reboot to avoid triggering AER"), so use the new sysoff API to
> reinstate S5 for reboot on ACPI-based systems.
>
> Cc: Josef Bacik <josef@toxicpanda.com>
> Suggested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
> v3:
> - Use new API to invoke ACPI S5.
>
> v2:
> - Use do_kernel_power_off_prepare() instead.
>
> drivers/acpi/sleep.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> index ad4b2987b3d6e..dce5460902eed 100644
> --- a/drivers/acpi/sleep.c
> +++ b/drivers/acpi/sleep.c
> @@ -1088,6 +1088,10 @@ int __init acpi_sleep_init(void)
> register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
> SYS_OFF_PRIO_FIRMWARE,
> acpi_power_off, NULL);
> +
> + register_sys_off_handler(SYS_OFF_MODE_RESTART_PREPARE,
> + SYS_OFF_PRIO_FIRMWARE,
> + acpi_power_off_prepare, NULL);
Maybe you could add a small comment to the code explaining why
acpi_power_off_prepare is used for restarting?
Is it safe to use S5 on restart for all devices in general?
--
Best regards,
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 2/2] PM: ACPI: reboot: Reinstate S5 for reboot
2022-09-13 15:17 ` Dmitry Osipenko
@ 2022-09-16 0:03 ` Kai-Heng Feng
0 siblings, 0 replies; 3+ messages in thread
From: Kai-Heng Feng @ 2022-09-16 0:03 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: rafael.j.wysocki, lenb, Josef Bacik, Rafael J. Wysocki,
linux-acpi, linux-kernel
On Tue, Sep 13, 2022 at 11:17 PM Dmitry Osipenko
<dmitry.osipenko@collabora.com> wrote:
>
> On 9/13/22 09:20, Kai-Heng Feng wrote:
> > Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused Dell
> > PowerEdge r440 hangs at reboot.
> >
> > The issue is fixed by commit 2ca1c94ce0b6 ("tg3: Disable tg3 device on
> > system reboot to avoid triggering AER"), so use the new sysoff API to
> > reinstate S5 for reboot on ACPI-based systems.
> >
> > Cc: Josef Bacik <josef@toxicpanda.com>
> > Suggested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > ---
> > v3:
> > - Use new API to invoke ACPI S5.
> >
> > v2:
> > - Use do_kernel_power_off_prepare() instead.
> >
> > drivers/acpi/sleep.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
> > index ad4b2987b3d6e..dce5460902eed 100644
> > --- a/drivers/acpi/sleep.c
> > +++ b/drivers/acpi/sleep.c
> > @@ -1088,6 +1088,10 @@ int __init acpi_sleep_init(void)
> > register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
> > SYS_OFF_PRIO_FIRMWARE,
> > acpi_power_off, NULL);
> > +
> > + register_sys_off_handler(SYS_OFF_MODE_RESTART_PREPARE,
> > + SYS_OFF_PRIO_FIRMWARE,
> > + acpi_power_off_prepare, NULL);
>
> Maybe you could add a small comment to the code explaining why
> acpi_power_off_prepare is used for restarting?
Will do.
>
> Is it safe to use S5 on restart for all devices in general?
S5 should be used, but it may expose some driver bugs like the one
mentioned in the commit message.
Kai-Heng
>
> --
> Best regards,
> Dmitry
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-09-16 0:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220913062042.1977790-1-kai.heng.feng@canonical.com>
2022-09-13 6:20 ` [PATCH v3 2/2] PM: ACPI: reboot: Reinstate S5 for reboot Kai-Heng Feng
2022-09-13 15:17 ` Dmitry Osipenko
2022-09-16 0:03 ` Kai-Heng Feng
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).