Bug 488373

Summary: cannot enter s0ix sleep after commit a6b9cf5f706385c8711dd873eedfe7faefc187b4
Product: [Unmaintained] Powerdevil Reporter: fanzhuyifan
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal CC: me, natalie_clarius
Priority: NOR Keywords: regression
Version First Reported In: git-stable-Plasma/6.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://github.com/rockowitz/ddcutil/issues/429
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description fanzhuyifan 2024-06-11 17:30:18 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY
After https://invent.kde.org/plasma/powerdevil/-/merge_requests/312, my laptop cannot enter into s0ix sleep. It can only enter into s2idle, and does not enter s0ix.

STEPS TO REPRODUCE
1. Run `cat /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us && sudo rtcwake -m mem -s 5 && cat /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us`

OBSERVED RESULT
See a value increase before the problematic commit, but no value increase after the problematic commit.

EXPECTED RESULT
powerdevil shouldn't interfere with entry into s0ix.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.1.80
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.1
Kernel Version: 6.9.3-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i9-13900H
Memory: 15.2 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G16 GU603VV_GU603VV
System Version: 1.0

ADDITIONAL INFORMATION
ddcutil version: 2.1.4

Note that not being able to enter s0ix could cause laptop heating issues (if placed in bag) that could cause hardware damage.
Comment 1 fanzhuyifan 2024-06-11 17:43:36 UTC
The powerdevil logs:

Jun 11 10:41:09 arch org_kde_powerdevil[1834]: org.kde.powerdevil: Handle button events action could not check for screen configuration
Jun 11 10:41:11 arch org_kde_powerdevil[1834]: Initializing libddcutil.  ddcutil version: 2.1.4, shared library: /usr/lib/libddcutil.so.5.1.2
Jun 11 10:41:11 arch org_kde_powerdevil[1834]: Options passed from client:
Jun 11 10:41:11 arch org_kde_powerdevil[1834]: Applying combined options:
Jun 11 10:41:13 arch org_kde_powerdevil[1834]: Library initialization complete.
Jun 11 10:41:13 arch org_kde_powerdevil[1834]: Watch thread started
Comment 2 fanzhuyifan 2024-06-11 22:03:51 UTC
Marking as UPSTREAM since this is probably a bug in ddcutil, and not a bug in KDE software.

Will try to submit an upstream bug report and add the link here later.
Comment 3 Bug Janitor Service 2024-06-11 22:05:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/379
Comment 4 fanzhuyifan 2024-06-17 20:00:12 UTC
Git commit 40625d0302017f1fe1345d9a3d2a5ac670f9ba5d by Yifan Zhu.
Committed on 17/06/2024 at 19:57.
Pushed by fanzhuyifan into branch 'master'.

skip ddcutil initialization when POWERDEVIL_NO_DDCUTIL is set

When POWERDEVIL_NO_DDCUTIL is set, the platform initialization should be
skipped entirely. This restores the old behavior before
a6b9cf5f706385c8711dd873eedfe7faefc187b4.

M  +9    -1    daemon/controllers/ddcutildetector.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/40625d0302017f1fe1345d9a3d2a5ac670f9ba5d
Comment 5 Bug Janitor Service 2024-06-17 22:41:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/381
Comment 6 fanzhuyifan 2024-06-19 14:12:00 UTC
Git commit 1aa9ea47962c5c46a960c55b45f05235fb32ca10 by Yifan Zhu.
Committed on 19/06/2024 at 14:08.
Pushed by fanzhuyifan into branch 'Plasma/6.1'.

skip ddcutil initialization when POWERDEVIL_NO_DDCUTIL is set

When POWERDEVIL_NO_DDCUTIL is set, the platform initialization should be
skipped entirely. This restores the old behavior before
a6b9cf5f706385c8711dd873eedfe7faefc187b4.


(cherry picked from commit 40625d0302017f1fe1345d9a3d2a5ac670f9ba5d)

Co-authored-by: Yifan Zhu <fanzhuyifan@gmail.com>

M  +9    -1    daemon/controllers/ddcutildetector.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/1aa9ea47962c5c46a960c55b45f05235fb32ca10