Page MenuHomeFreeBSD

acpi: Ask SPMC for D-state in s2idle instead of _S255D
Needs ReviewPublic

Authored by obiwac on Thu, Feb 5, 12:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 20, 5:11 AM
Unknown Object (File)
Fri, Feb 20, 5:11 AM
Unknown Object (File)
Thu, Feb 19, 5:16 AM
Unknown Object (File)
Wed, Feb 18, 5:22 PM
Unknown Object (File)
Wed, Feb 18, 12:30 AM
Unknown Object (File)
Tue, Feb 17, 5:47 PM
Unknown Object (File)
Tue, Feb 17, 3:58 AM
Unknown Object (File)
Tue, Feb 17, 3:48 AM
Subscribers

Details

Reviewers
olce
jkim
Summary

Currently, when entering s2idle, we are parsing the _S255D object to get the shallowest D-state supported by device, as acpi_stype_to_sstate() returns -1 for s2idle.

Instead, we should really be asking the SPMC device for the minimum D-state constraints for the given device, or falling back to _S3D.

To do this, a new acpi_spmc interface was added to ask for an ACPI handle's min D-state constraint, and acpi_device_pwr_for_sleep() has been refactored to attempt the SPMC path on s2idle or the _SxD path if that fails or not doing s2idle.

Relevant document: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/07_Power_and_Performance_Mgmt/device-power-management-objects.html#s3d-s3-device-state

Sponsored by: The FreeBSD Foundation

Test Plan

I need someone with working S3 on their laptop to make sure I didn't break this (again)!

Diff Detail

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

Event Timeline

obiwac added reviewers: olce, jkim.
obiwac retitled this revision from acpi: _S225D fix to acpi: Evaluate _S3D instead of _S225D when entering s2idle.
obiwac edited the summary of this revision. (Show Details)

Ask SPMC for D-state in s2idle instead of _S255D

obiwac retitled this revision from acpi: Evaluate _S3D instead of _S225D when entering s2idle to acpi: Ask SPMC for D-state in s2idle instead of _S255D.Fri, Feb 6, 5:32 PM
obiwac edited the summary of this revision. (Show Details)
obiwac edited the test plan for this revision. (Show Details)

I need someone with working S3 on their laptop to make sure I didn't break this (again)!

I can give this a try on my WIP branch in a little while, on my Framework 13" 11th gen Intel. Currently running wipbsd-n283918-87f5b3153f15 which is a bunch of WIP from main at c59a47dc6c016dff74466cecb160459980a5d782, and S3 is working.

Now running wipbsd-n284325-ae4a668b7590 which has been rebased on main as of 89aa8a94053fdd22ed716fdf424a2d10e70b3188 and includes this patch. CPU is 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (2803.20-MHz K8-class CPU. S3 works as before.

Fix passing dev instead of handle to acpi_device_pwr_for_sleep_sxd