Page MenuHomeFreeBSD

acpi_powerres: `acpi_pwr_get_state` and getting initial D-state for device
Needs ReviewPublic

Authored by obiwac_gmail.com on Wed, Jan 8, 11:24 PM.
Tags
None
Referenced Files
F107015191: D48386.diff
Thu, Jan 9, 12:10 AM
F107014550: D48386.id148953.diff
Wed, Jan 8, 11:57 PM
Unknown Object (File)
Wed, Jan 8, 11:38 PM
Unknown Object (File)
Wed, Jan 8, 11:37 PM
Subscribers

Details

Summary

acpi_pwr_get_state is added as a prerequisite to LPI (low-power idle) states. Since these states define minimum D-state constraints on other devices to be able to enter them, it will be necessary to use this function to check them before attempting to do so.

Aside from that, this function is currently only used to get the initial D-state of a power consumer when registering it (previously the ac_state value would be set to ACPI_STATE_UNKNOWN). It uses the _PSC method if available (older devices), or infers the D-state through the _PRx objects (cached in ac_prx) with acpi_pwr_infer_state if not.

acpi_pwr_switch_consumer now uses this to verify that the D-state of a power consumer was switched correctly.

This was split out from D48294.

Sponsored by: The FreeBSD Foundation

Test Plan

I have tested this on the Framework 13 AMD Ryzen 7040 series. All devices are able to suspend/resume fine and their D-states are set/gotten correctly now (am able to verify that they pass the LPI constraints).

I do not have a device with _PSC objects, so I am unable to test that path.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 61588
Build 58472: arc lint + arc unit

Event Timeline

obiwac_gmail.com retitled this revision from acpi_powerres: Get initial D-state for device to acpi_powerres: `acpi_pwr_get_state` and getting initial D-state for device.Thu, Jan 9, 12:14 AM