Skip to content

feat(power): implement true s2idle suspend with improved fake-suspend fallback#34

Open
the8055u wants to merge 1 commit into
virtudude:mainfrom
the8055u:true-suspend
Open

feat(power): implement true s2idle suspend with improved fake-suspend fallback#34
the8055u wants to merge 1 commit into
virtudude:mainfrom
the8055u:true-suspend

Conversation

@the8055u

Copy link
Copy Markdown

Description

This PR significantly improves the suspend behavior on SM8550/SM8650/SM8750 devices by introducing support for true s2idle suspend while maintaining and enhancing the legacy fake-suspend mechanism.

The current fake-suspend approach results in higher battery drain because the SoC never truly sleeps. Real suspend (s2idle) is now automatically used if the kernel supports it, falling back to an improved fake-suspend otherwise.

Changes

  • Added s2idle support in fake-suspend: Automatically detected via /sys/power/mem_sleep. When active, it properly freezes tasks and suspends drivers via echo freeze > /sys/power/state, allowing CPUs to enter hardware idle states.
  • Improved fake-suspend fallback: Offlines all secondary CPU cores via hotplug (echo 0 > /sys/devices/system/cpu/cpu*/online) during sleep to further reduce battery drain when s2idle is unavailable.
  • Added configurable suspend_mode: Added to power-profiles.conf with auto (default), s2idle, and fake options to allow users to force a specific behavior.
  • Updated documentation: Rewrote the "Power button and sleep" section in README.md to explain the new behavior.

Testing

  • Test on device: Verify cat /sys/power/mem_sleep to check if s2idle is available.
  • Press power button to suspend and resume. Check battery drain compared to the old fake-suspend implementation.
  • If s2idle causes GPU hangs (Adreno 740), users can safely revert to the legacy path by setting suspend_mode=fake in /etc/armada/power-profiles.conf.

@virtudude

Copy link
Copy Markdown
Owner

@the8055u Were you able to test this successfully? My experience has been that s2idle almost never wakes from sleep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants