Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package power-profiles-daemon for openSUSE:Factory checked in at 2022-05-16 18:08:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/power-profiles-daemon (Old) and /work/SRC/openSUSE:Factory/.power-profiles-daemon.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "power-profiles-daemon" Mon May 16 18:08:40 2022 rev:5 rq:977488 version:0.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/power-profiles-daemon/power-profiles-daemon.changes 2022-05-02 16:25:43.820848934 +0200 +++ /work/SRC/openSUSE:Factory/.power-profiles-daemon.new.1538/power-profiles-daemon.changes 2022-05-16 18:11:09.953404541 +0200 @@ -1,0 +2,9 @@ +Fri May 13 13:13:55 UTC 2022 - Atri Bhattacharya <badshah...@gmail.com> + +- Update to version 0.11.1: + * Stops power-profiles-daemon from modifying the cpufreq driver + when the user/administrator has chosen to disable the Intel + P-State scaling governor (eg. forcing a passive operation + mode). + +------------------------------------------------------------------- Old: ---- power-profiles-daemon-0.11.tar.bz2 New: ---- power-profiles-daemon-0.11.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ power-profiles-daemon.spec ++++++ --- /var/tmp/diff_new_pack.ZKZHe8/_old 2022-05-16 18:11:10.401404898 +0200 +++ /var/tmp/diff_new_pack.ZKZHe8/_new 2022-05-16 18:11:10.405404901 +0200 @@ -17,7 +17,7 @@ Name: power-profiles-daemon -Version: 0.11 +Version: 0.11.1 Release: 0 Summary: Power profiles handling over D-Bus License: GPL-3.0-or-later ++++++ power-profiles-daemon-0.11.tar.bz2 -> power-profiles-daemon-0.11.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power-profiles-daemon-0.11/NEWS new/power-profiles-daemon-0.11.1/NEWS --- old/power-profiles-daemon-0.11/NEWS 2022-04-29 14:29:31.000000000 +0200 +++ new/power-profiles-daemon-0.11.1/NEWS 2022-05-02 17:07:24.000000000 +0200 @@ -1,3 +1,12 @@ +0.11.1 +------ + +This release stops power-profiles-daemon from modifying the cpufreq driver when +driver when the user/administrator has chosen to disable the Intel P-State scaling +governor (eg. forcing a passive operation mode). + +More information is available in the README. + 0.11 ---- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power-profiles-daemon-0.11/README.md new/power-profiles-daemon-0.11.1/README.md --- old/power-profiles-daemon-0.11/README.md 2022-04-29 14:29:31.000000000 +0200 +++ new/power-profiles-daemon-0.11.1/README.md 2022-05-02 17:07:24.000000000 +0200 @@ -97,6 +97,35 @@ sudo G_MESSAGES_DEBUG=all /usr/libexec/power-profiles-daemon -r -v ``` +Operations on Intel-based machines +---------------------------------- + +The "driver" for making the hardware act on the user-selected power profile on Intel +CPU-based machines is based on the [Intel P-State scaling driver](https://www.kernel.org/doc/html/v5.17/admin-guide/pm/intel_pstate.html). + +It is only used if a `platform_profile` driver isn't available for the system, and the +CPU supports hardware-managed P-states (HWP). If HWP isn't supported, or the P-State +scaling driver is set to `passive` mode. + +System without `platform_profile support` but with `active` P-State operation mode: +``` +$ cat /sys/firmware/acpi/platform_profile_choices +cat: /sys/firmware/acpi/platform_profile_choices: No such file or directory +$ cat /sys/devices/system/cpu/intel_pstate/status +active +``` + +If the Intel P-State scaling driver is in `passive` mode, either because the system doesn't +support HWP, or the administator has disabled it, then the placeholder driver will be +used, and there won't be a performance mode. + +Finally, if the Intel P-State scaling driver is used in `active` mode, the P-State +scaling governor will be changed to `powersave` as it is the only P-State scaling +governor that allows for the "Energy vs Performance Hints" to be taken into consideration, +ie. the only P-State scaling governor that allows power-profiles-daemon to work. + +For more information, please refer to the [Intel P-State scaling driver documentation](https://www.kernel.org/doc/html/v5.17/admin-guide/pm/intel_pstate.html). + Testing ------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power-profiles-daemon-0.11/meson.build new/power-profiles-daemon-0.11.1/meson.build --- old/power-profiles-daemon-0.11/meson.build 2022-04-29 14:29:31.000000000 +0200 +++ new/power-profiles-daemon-0.11.1/meson.build 2022-05-02 17:07:24.000000000 +0200 @@ -1,5 +1,5 @@ project('power-profiles-daemon', [ 'c' ], - version: '0.11', + version: '0.11.1', license: 'GPLv3+', default_options: [ 'buildtype=debugoptimized', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power-profiles-daemon-0.11/src/ppd-driver-intel-pstate.c new/power-profiles-daemon-0.11.1/src/ppd-driver-intel-pstate.c --- old/power-profiles-daemon-0.11/src/ppd-driver-intel-pstate.c 2022-04-29 14:29:31.000000000 +0200 +++ new/power-profiles-daemon-0.11.1/src/ppd-driver-intel-pstate.c 2022-05-02 17:07:24.000000000 +0200 @@ -14,6 +14,7 @@ #define CPUFREQ_POLICY_DIR "/sys/devices/system/cpu/cpufreq/" #define DEFAULT_CPU_FREQ_SCALING_GOV "powersave" +#define PSTATE_STATUS_PATH "/sys/devices/system/cpu/intel_pstate/status" #define NO_TURBO_PATH "/sys/devices/system/cpu/intel_pstate/no_turbo" #define TURBO_PCT_PATH "/sys/devices/system/cpu/intel_pstate/turbo_pct" @@ -131,9 +132,21 @@ PpdDriverIntelPstate *pstate = PPD_DRIVER_INTEL_PSTATE (driver); g_autoptr(GDir) dir = NULL; g_autofree char *policy_dir = NULL; + g_autofree char *pstate_status_path = NULL; + g_autofree char *status = NULL; const char *dirname; PpdProbeResult ret = PPD_PROBE_RESULT_FAIL; + /* Verify that Intel P-State is running in active mode */ + pstate_status_path = ppd_utils_get_sysfs_path (PSTATE_STATUS_PATH); + if (!g_file_get_contents (pstate_status_path, &status, NULL, NULL)) + goto out; + status = g_strchomp (status); + if (g_strcmp0 (status, "active") != 0) { + g_debug ("Intel P-State is running in passive mode"); + goto out; + } + dir = open_policy_dir (); if (!dir) goto out; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power-profiles-daemon-0.11/tests/integration-test.py new/power-profiles-daemon-0.11.1/tests/integration-test.py --- old/power-profiles-daemon-0.11/tests/integration-test.py 2022-04-29 14:29:31.000000000 +0200 +++ new/power-profiles-daemon-0.11.1/tests/integration-test.py 2022-05-02 17:07:24.000000000 +0200 @@ -377,11 +377,13 @@ with open(os.path.join(dir2, "energy_performance_preference"),'w') as prefs: prefs.write("performance\n") - # Create no_turbo pref + # Create Intel P-State configuration pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") os.makedirs(pstate_dir) with open(os.path.join(pstate_dir, "no_turbo"),'w') as no_turbo: no_turbo.write("0\n") + with open(os.path.join(pstate_dir, "status"),'w') as status: + status.write("active\n") self.start_daemon() @@ -433,6 +435,10 @@ gov.write('performance\n') with open(os.path.join(dir1, "energy_performance_preference"),'w') as prefs: prefs.write("performance\n") + pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") + os.makedirs(pstate_dir) + with open(os.path.join(pstate_dir, "status"),'w') as status: + status.write("active\n") upowerd, obj_upower = self.spawn_server_template( 'upower', {'DaemonVersion': '0.99', 'OnBattery': False}, stdout=subprocess.PIPE) @@ -463,6 +469,11 @@ def test_intel_pstate_error(self): '''Intel P-State driver in error state''' + pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") + os.makedirs(pstate_dir) + with open(os.path.join(pstate_dir, "status"),'w') as status: + status.write("active\n") + dir1 = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/cpufreq/policy0/") os.makedirs(dir1) with open(os.path.join(dir1, 'scaling_governor'), 'w') as gov: @@ -497,6 +508,47 @@ if os.geteuid() == 0: subprocess.check_output(['chattr', '-i', pref_path]) + def test_intel_pstate_passive(self): + '''Intel P-State in passive mode -> pladeholder''' + + dir1 = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/cpufreq/policy0/") + os.makedirs(dir1) + with open(os.path.join(dir1, 'scaling_governor'), 'w') as gov: + gov.write('powersave\n') + with open(os.path.join(dir1, "energy_performance_preference"),'w') as prefs: + prefs.write("performance\n") + + # Create Intel P-State configuration + pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") + os.makedirs(pstate_dir) + with open(os.path.join(pstate_dir, "no_turbo"),'w') as no_turbo: + no_turbo.write("0\n") + with open(os.path.join(pstate_dir, "status"),'w') as status: + status.write("passive\n") + + self.start_daemon() + + profiles = self.get_dbus_property('Profiles') + self.assertEqual(len(profiles), 2) + self.assertEqual(profiles[0]['Driver'], 'placeholder') + self.assertEqual(self.get_dbus_property('ActiveProfile'), 'balanced') + + contents = None + with open(os.path.join(dir1, "energy_performance_preference"), 'rb') as f: + contents = f.read() + self.assertEqual(contents, b'performance\n') + + # Set performance mode + self.set_dbus_property('ActiveProfile', GLib.Variant.new_string('power-saver')) + self.assertEqual(self.get_dbus_property('ActiveProfile'), 'power-saver') + + contents = None + with open(os.path.join(dir1, "energy_performance_preference"), 'rb') as f: + contents = f.read() + self.assertEqual(contents, b'performance\n') + + self.stop_daemon() + def test_dytc_performance_driver(self): '''Lenovo DYTC performance driver''' @@ -891,13 +943,15 @@ with open(os.path.join(dir1, "energy_performance_preference"),'w') as prefs: prefs.write("performance\n") - # Create no_turbo pref with turbo_pct + # Create Intel P-State configuration pstate_dir = os.path.join(self.testbed.get_root_dir(), "sys/devices/system/cpu/intel_pstate") os.makedirs(pstate_dir) with open(os.path.join(pstate_dir, "no_turbo"),'w') as no_turbo: no_turbo.write("1\n") with open(os.path.join(pstate_dir, "turbo_pct"),'w') as no_turbo: no_turbo.write("0\n") + with open(os.path.join(pstate_dir, "status"),'w') as status: + status.write("active\n") self.start_daemon()