From dbcef1e91a10ba9e4b1573fa7a88a59f2ae5bb7e Mon Sep 17 00:00:00 2001 From: erpalma Date: Fri, 30 Apr 2021 09:02:44 +0200 Subject: [PATCH] fix wrong bit for BDPROCHOT in MSR_POWER_CTL and BDPROCHOT config parsing error (thanks Andrea) --- lenovo_fix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lenovo_fix.py b/lenovo_fix.py index 30637a6..59093d9 100755 --- a/lenovo_fix.py +++ b/lenovo_fix.py @@ -645,7 +645,7 @@ def set_disable_bdprochot(): writemsr('MSR_POWER_CTL', new_val) if args.debug: - read_value = readmsr('MSR_POWER_CTL', from_bit=31, to_bit=31)[0] + read_value = readmsr('MSR_POWER_CTL', from_bit=0, to_bit=0)[0] match = OK if ~read_value else ERR log('[D] BDPROCHOT - write "{:#02x}" - read "{:#02x}" - match {}'.format(0, read_value, match)) @@ -750,7 +750,7 @@ def power_thread(config, regs, exit_event): # Disable BDPROCHOT disable_bdprochot = config.getboolean(power['source'], 'Disable_BDPROCHOT', fallback=None) - if disable_bdprochot is not None: + if disable_bdprochot: set_disable_bdprochot() wait_t = config.getfloat(power['source'], 'Update_Rate_s')