From 33ec2db8c7be46e98a9d39189dfb2f10bd735a24 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Mon, 2 Apr 2018 20:51:30 +0200 Subject: [PATCH 1/4] Update README.md --- README.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 810e5c9..b475267 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # lenovo-throttling-fix Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks as described [here](https://www.reddit.com/r/thinkpad/comments/870u0a/t480s_linux_throttling_bug/). -This script forces the CPU package power limit (PL1/2) to **45 W** and the temperature trip point to **97 C** by overriding default values in MSR and MCHBAR every 15 seconds to block the Embedded Controller from resetting these values to default. +This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **97 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. ## Requirements The python module `python-periphery` is used for accessing the MCHBAR register by memory mapped I/O. @@ -15,5 +15,28 @@ sudo systemctl enable lenovo_fix.service sudo systemctl start lenovo_fix.service ``` +## Configuration +The script can be configured by editing `lenovo_fix.py` directly. There exist two profiles `AC` and `BATTERY`: +``` +config = { + 'AC': { + 'UPDATE_RATE_SEC': 5, # Update the registers every this many seconds + 'PL1_TDP_W': 44, # Max package power for time window #1 + 'PL1_DURATION_S': 28, # Time window #1 duration + 'PL2_TDP_W': 44, # Max package power for time window #2 + 'PL2_DURATION_S': 0.002, # Time window #2 duration + 'TRIP_TEMP_C': 97 # Max allowed temperature before throttling + }, + 'BATTERY': { + 'UPDATE_RATE_SEC': 30, # Update the registers every this many seconds + 'PL1_TDP_W': 29, # Max package power for time window #1 + 'PL1_DURATION_S': 28, # Time window #1 duration + 'PL2_TDP_W': 44, # Max package power for time window #2 + 'PL2_DURATION_S': 0.002, # Time window #2 duration + 'TRIP_TEMP_C': 85 # Max allowed temperature before throttling + }, +} +``` + ## Disclaimer This script overrides the default values set by Lenovo. I'm using it without any problem, but it is still experimental so use it at your own risk. From 0e97ee4109b68ce9dfed36c95011f80584018362 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Mon, 2 Apr 2018 20:53:38 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b475267..88fa83b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# lenovo-throttling-fix +# Fix T480 / T480s / X1C6 Throttling on Linux Workaround for Linux throttling issues on Lenovo T480 / T480s / X1C6 notebooks as described [here](https://www.reddit.com/r/thinkpad/comments/870u0a/t480s_linux_throttling_bug/). This script forces the CPU package power limit (PL1/2) to **44 W** (29 W on battery) and the temperature trip point to **97 'C** (85 'C on battery) by overriding default values in MSR and MCHBAR every 5 seconds (30 on battery) to block the Embedded Controller from resetting these values to default. @@ -39,4 +39,4 @@ config = { ``` ## Disclaimer -This script overrides the default values set by Lenovo. I'm using it without any problem, but it is still experimental so use it at your own risk. +This script overrides the default values set by Lenovo. I'm using it without any problem, but it is still experimental so use it at your own risk. This script can be probably adapter/used on other notebooks too. From 7d13bfda7e741ca5b1e952b2c3a7e20f5358856d Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Mon, 2 Apr 2018 21:58:13 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 88fa83b..af83fc3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The python module `python-periphery` is used for accessing the MCHBAR register b ## Installation ``` git clone https://github.com/erpalma/lenovo-throttling-fix.git -sudo pip install python-periphery +sudo -H pip install python-periphery sudo make install sudo systemctl enable lenovo_fix.service sudo systemctl start lenovo_fix.service From ed3857c816b503c21fb50a28aeb1b68bcf2b9371 Mon Sep 17 00:00:00 2001 From: Francesco Palmarini Date: Tue, 3 Apr 2018 10:09:05 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af83fc3..10cea73 100644 --- a/README.md +++ b/README.md @@ -39,4 +39,4 @@ config = { ``` ## Disclaimer -This script overrides the default values set by Lenovo. I'm using it without any problem, but it is still experimental so use it at your own risk. This script can be probably adapter/used on other notebooks too. +This script overrides the default values set by Lenovo. I'm using it without any problem, but it is still experimental so use it at your own risk. This script can be probably adapted/used on other notebooks too.