Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:munix9
power-profiles-daemon
fix-turbo_pct.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-turbo_pct.patch of Package power-profiles-daemon
From 2e00350f922261329c5203706dbb5dc4426972a6 Mon Sep 17 00:00:00 2001 From: Mario Limonciello <superm1@gmail.com> Date: Sat, 6 Apr 2024 15:02:13 -0500 Subject: [PATCH] trivial: Don't assume that turbo_pct is present According to kernel documentation this file is only exposed if the value will be the same for all CPUs. "This attribute is present only if the value exposed by it is the same for all of the CPUs in the system." Link: https://www.kernel.org/doc/html/v6.9-rc1/admin-guide/pm/intel_pstate.html --- src/ppd-driver-intel-pstate.c | 5 ++--- tests/integration_test.py | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ppd-driver-intel-pstate.c b/src/ppd-driver-intel-pstate.c index 90a5d17..8696506 100644 --- a/src/ppd-driver-intel-pstate.c +++ b/src/ppd-driver-intel-pstate.c @@ -118,13 +118,12 @@ sys_has_turbo (void) { g_autofree char *turbo_pct_path = NULL; g_autofree char *contents = NULL; - gboolean has_turbo = TRUE; + gboolean has_turbo = FALSE; turbo_pct_path = ppd_utils_get_sysfs_path (TURBO_PCT_PATH); if (g_file_get_contents (turbo_pct_path, &contents, NULL, NULL)) { contents = g_strchomp (contents); - if (g_strcmp0 (contents, "0") == 0) - has_turbo = FALSE; + has_turbo = (g_strcmp0 (contents, "0") != 0); } return has_turbo; diff --git a/tests/integration_test.py b/tests/integration_test.py index b88c728..d9b27c7 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -566,6 +566,7 @@ class Tests(dbusmock.DBusTestCase): ) os.makedirs(pstate_dir) self.write_file_contents(os.path.join(pstate_dir, "no_turbo"), "0\n") + self.write_file_contents(os.path.join(pstate_dir, "turbo_pct"), "1\n") self.write_file_contents(os.path.join(pstate_dir, "status"), "active\n") self.start_daemon() @@ -649,6 +650,7 @@ class Tests(dbusmock.DBusTestCase): ) os.makedirs(pstate_dir) self.write_file_contents(os.path.join(pstate_dir, "no_turbo"), "0\n") + self.write_file_contents(os.path.join(pstate_dir, "turbo_pct"), "1\n") self.write_file_contents(os.path.join(pstate_dir, "status"), "active\n") self.start_daemon() @@ -827,6 +829,7 @@ class Tests(dbusmock.DBusTestCase): ) os.makedirs(pstate_dir) self.write_file_contents(os.path.join(pstate_dir, "no_turbo"), "0\n") + self.write_file_contents(os.path.join(pstate_dir, "turbo_pct"), "1\n") self.write_file_contents(os.path.join(pstate_dir, "status"), "passive\n") self.start_daemon() @@ -870,6 +873,7 @@ class Tests(dbusmock.DBusTestCase): ) os.makedirs(pstate_dir) self.write_file_contents(os.path.join(pstate_dir, "no_turbo"), "0\n") + self.write_file_contents(os.path.join(pstate_dir, "turbo_pct"), "1\n") self.write_file_contents(os.path.join(pstate_dir, "status"), "passive\n") self.start_daemon() -- GitLab
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor