Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement S0ix low power states and s2idle #32

Open
2 tasks
alice-sowerby opened this issue Nov 21, 2024 · 1 comment
Open
2 tasks

Implement S0ix low power states and s2idle #32

alice-sowerby opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@alice-sowerby
Copy link
Member

alice-sowerby commented Nov 21, 2024

User Story

As a laptop user I want to be able to put my laptop to sleep and for it to enter a low power state so that I can conserve battery charge and use the laptop for longer between charges.

NOTE: S0ix represents a set of SoC states which allow the SoC to consume less power by shutting off parts of the SoC when not needed. Source

Implementation Notes

There's an existing non-functional start of S0ix support, but nothing that is a demoable proof of concept.

Acceptance Criteria

  • Can suspend/resume on AMD and enter a low power idle state, even if the CPU may sporadically wake.
  • Test on Intel (may work out of the box)
@alice-sowerby alice-sowerby changed the title Add s0ix support Implement S0ix low power states Nov 21, 2024
@alice-sowerby alice-sowerby added this to the Q1 - 2025 milestone Dec 5, 2024
@alice-sowerby alice-sowerby moved this from Backlog to Ready in Laptop Project Board Dec 5, 2024
@FreeBSDFoundation FreeBSDFoundation deleted a comment from emaste Dec 10, 2024
@alice-sowerby alice-sowerby moved this from Ready to In progress in Laptop Project Board Jan 10, 2025
@obiwac
Copy link
Collaborator

obiwac commented Jan 20, 2025

Current state:

Driver for the SPMC (system power management controller, acpi_spmc) has been written (D48387), and is able to parse and verify device power constraints as well as provide hooks for S0ix suspend entry/exit. These hooks will be used before and after suspending to idle (s2idle) when the user wants to go to sleep. I am working on a revision for s2idle but I haven't put that up for review yet (this should be the last thing needed for the first acceptance criterion).

D3cold support (https://reviews.freebsd.org/D48384) was added and fixes for switching device power states (https://reviews.freebsd.org/D48385) were made to respect the device constraints necessary for entering lower power idle states.

Currently, the only blocking thing is in ACPICA upstream (see acpica/acpica#993), as D3cold and D3hot are not currently being distinguished and it is unclear whether the existing D3 should really be D3hot or D3cold.

This has been tested and is (sort of) working on the AMD Framework laptop. The only issue is that the CPU frequently wakes from idle as we get a lot of SCI interrupts which wake the CPU from the EC, most of which are not actually wake events. These events can not be masked as they share the same GPE number (and if we mask this GPE we also mask wake events). The solution might be with the AMD PMC, which we might be able to ask to quiet down the EC. This is tracked by #55.

There are other GPE's we might want to mask and FreeBSD already provides sysctls to configure this, but currently this is using the _PSW object which, on modern devices, has been replaced by _DSW and needs updating.

Likely completion date: probably some time during the month of February.

@obiwac obiwac changed the title Implement S0ix low power states Implement S0ix low power states and s2idle Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

No branches or pull requests

2 participants