Page MenuHomeFreeBSD

acpi_powerres: D3cold support and `acpi_d_state_to_str`
AcceptedPublic

Authored by obiwac_gmail.com on Wed, Jan 8, 11:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jan 22, 2:07 PM
Unknown Object (File)
Sun, Jan 19, 3:06 PM
Unknown Object (File)
Mon, Jan 13, 8:39 PM
Unknown Object (File)
Mon, Jan 13, 10:57 AM
Unknown Object (File)
Sun, Jan 12, 6:41 PM
Unknown Object (File)
Sun, Jan 12, 5:50 PM
Unknown Object (File)
Sun, Jan 12, 6:09 AM
Unknown Object (File)
Sat, Jan 11, 1:14 PM
Subscribers

Details

Summary

This patch separates ACPI_STATE_D3 into ACPI_STATE_D3_HOT and ACPI_STATE_D3_COLD. The previous ACPI_STATE_D3 is now defined as ACPI_STATE_D3_COLD. The same distinction has been made between PCI_POWERSTATE_D3_HOT and PCI_POWERSTATE_D3_COLD, as they're defined by ACPI (and are asserted to be the same). D3cold is essentially the same as D3hot except the power resources are turned off. Support for D3cold has been added to acpi_pwr_switch_consumer.

Currently I am awaiting information on whether or not ACPI_STATE_D3 should actually be D3cold or D3hot instead, at which point these macros will be upstreamed and I'll update this revision. See https://github.com/acpica/acpica/pull/993.

acpi_d_state_to_str replaces the printf("D%d", d_state) pattern, allowing for "D3hot" and "D3cold" strings to be printed instead.

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.

I still need to make 100% sure this doesn't break anything with PCI.

Diff Detail

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

Event Timeline

sys/dev/acpica/acpi_pci.c
57

Is this removal intentional?

sys/dev/acpica/acpivar.h
494
497
obiwac_gmail.com marked 2 inline comments as done.

Respond to style comments

obiwac_gmail.com added inline comments.
sys/dev/acpica/acpi_pci.c
57

Yes, my LS was bugging me about these not being used, and as I understand it these are just the autogenerated headers to provide the method interface.

If such changes are deemed out of scope I will revert this.

obiwac_gmail.com edited the summary of this revision. (Show Details)

Add PCI_POWERSTATE_D3_COLD to pci(9) manpage

This looks okay to me, but I'm not very familiar with this part of the kernel.

Based on the discussion on github, it looks like the unqualified D3 state likely should correspond to D3hot?

sys/dev/acpica/acpi_pci.c
57

It's fine, I'd just suggest noting that explicitly in the description/commit log next time, otherwise it can be hard to tell whether or not the change is intentional.

This revision is now accepted and ready to land.Sat, Jan 11, 3:14 PM

Based on the discussion on github, it looks like the unqualified D3 state likely should correspond to D3hot?

I'm still not sure, I will wait for Saket to follow up on this as he isn't certain either. These definitions need to be sorted out upstream before this can be committed anyway.

sys/dev/acpica/acpi_pci.c
57

Clear :)