Page MenuHomeFreeBSD

acpi: Forbid requesting S4 when S4BIOS is not supported
Needs ReviewPublic

Authored by olce on Wed, Jun 3, 4:54 PM.
Tags
None
Referenced Files
F159395537: D57414.id179142.diff
Sat, Jun 13, 4:30 PM
Unknown Object (File)
Fri, Jun 12, 2:58 AM
Unknown Object (File)
Thu, Jun 11, 1:01 PM
Unknown Object (File)
Wed, Jun 10, 10:30 PM
Unknown Object (File)
Wed, Jun 10, 5:39 PM
Unknown Object (File)
Wed, Jun 10, 5:07 PM
Unknown Object (File)
Wed, Jun 10, 7:48 AM
Unknown Object (File)
Wed, Jun 10, 1:07 AM
Subscribers

Details

Reviewers
obiwac
Summary

Pending the OS-supported hibernate functionality, prevent requesting S4
when S4BIOS is not supported.

To this end, make sure that acpi_supported_stypes[] indicates that
POWER_STYPE_FW_HIBERNATE is not supported if 'acpi_s4bios_supported' is
false, even if S4 is supported by the platform (which is only
a power-down-like state, without any support to save the system image by
itself). This will cause requests to enter S4, which are translated to
POWER_STYPE_FW_HIBERNATE before reaching
acpi_ReqSleepState()/acpi_EnterSleepState(), to fail in this case.

Retire the 'hw.acpi.s4bios' sysctl knob, as having it to 0 by default
(S4BIOS not supported) or setting it to 0 (default is 1 when S4BIOS is
supported) could only lead, on a S4 request, to a power down without any
possibility to restore the system (and, since a recent commit, it has
not been possible anymore to force it to 1 when S4BIOS is not announced
supported in the FACS table, which would cause a failure or a crash).

When OS-supported hibernate is introduced, it will become the default
hibernate method over S4BIOS, as we have not heard of any semi-recent
hardware platform implementing it (and when it is, it usually needs
a sufficiently large dedicated slice/partition, and does not use FreeBSD
swap slices/partitions). Then, for people still wanting to use S4BIOS
on older platforms that support it, the tentative plans are to modify
acpiconf(8) to accept '4BIOS' as an argument to '-s', or modify zzz(8)
so that one can pass a specific suspension method.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73668
Build 70551: arc lint + arc unit

Event Timeline

olce requested review of this revision.Wed, Jun 3, 4:54 PM
  • Remove remaining declaration for acpi_s4bios_sysctl() in acpi.c
  • Add a comment in the acpi_sleep_machdep() functions explaining why we are just testing on S4 state before calling AcpiEnterSleepStateS4bios().

my only concern with making S4 BIOS its own ACPI sleep state is that we won't really have a way of making the fw_hibernate sleep type map to it, and we might have to re-add a similar sysctl to s4bios

sys/dev/acpica/acpi.c
648–653

maybe update this comment to mention this is only until we have S4 non-bios support