mirror of
https://gitlab.freedesktop.org/upower/power-profiles-daemon.git
synced 2026-05-08 22:58:06 +02:00
intel-pstate: Fix inhibition not being detected
We should have inhibited the performance profile when "no_turbo" was set to "1", but we didn't take the linefeed into account, so we never actually read that value.
This commit is contained in:
parent
0e02519880
commit
b3ab935ac8
2 changed files with 3 additions and 2 deletions
|
|
@ -80,6 +80,7 @@ update_no_turbo (PpdDriverIntelPstate *pstate)
|
|||
gboolean turbo_disabled = FALSE;
|
||||
|
||||
if (g_file_get_contents (pstate->no_turbo_path, &contents, NULL, NULL)) {
|
||||
contents = g_strchomp (contents);
|
||||
if (g_strcmp0 (contents, "1") == 0)
|
||||
turbo_disabled = TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ class Tests(dbusmock.DBusTestCase):
|
|||
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")
|
||||
no_turbo.write("0\n")
|
||||
|
||||
self.start_daemon()
|
||||
|
||||
|
|
@ -342,7 +342,7 @@ class Tests(dbusmock.DBusTestCase):
|
|||
|
||||
# Disable turbo
|
||||
with open(os.path.join(pstate_dir, "no_turbo") ,'w') as no_turbo:
|
||||
no_turbo.write("1")
|
||||
no_turbo.write("1\n")
|
||||
|
||||
self.assertEventually(lambda: self.have_text_in_log('File monitor change happened for '))
|
||||
self.assertEqual(self.get_dbus_property('ActiveProfile'), 'balanced')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue