Make CPU reset workaround skip resume from sleep

This commit is contained in:
NGnius (Graham) 2023-08-24 20:02:31 -04:00
parent b1d53ab038
commit 5f6370e778
4 changed files with 24 additions and 20 deletions

2
backend/Cargo.lock generated
View file

@ -1052,7 +1052,7 @@ dependencies = [
[[package]] [[package]]
name = "powertools" name = "powertools"
version = "1.4.0-beta2" version = "1.4.0-beta3"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"libryzenadj", "libryzenadj",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "powertools" name = "powertools"
version = "1.4.0-beta2" version = "1.4.0-beta3"
edition = "2021" edition = "2021"
authors = ["NGnius (Graham) <ngniusness@gmail.com>"] authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
description = "Backend (superuser) functionality for PowerTools" description = "Backend (superuser) functionality for PowerTools"

View file

@ -375,6 +375,7 @@ impl Cpu {
// https://github.com/NGnius/PowerTools/issues/107 // https://github.com/NGnius/PowerTools/issues/107
fn clock_unset_workaround(&self) -> Result<(), Vec<SettingError>> { fn clock_unset_workaround(&self) -> Result<(), Vec<SettingError>> {
if !self.state.is_resuming {
let mut errors = Vec::new(); let mut errors = Vec::new();
POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index);
// always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug)
@ -395,6 +396,9 @@ impl Cpu {
} else { } else {
Err(errors) Err(errors)
} }
} else {
Ok(())
}
} }
fn set_confirm(&self) -> Result<(), SettingError> { fn set_confirm(&self) -> Result<(), SettingError> {

View file

@ -1,6 +1,6 @@
{ {
"name": "PowerTools", "name": "PowerTools",
"version": "1.4.0-beta2", "version": "1.4.0-beta3",
"description": "Power tweaks for power users", "description": "Power tweaks for power users",
"scripts": { "scripts": {
"build": "shx rm -rf dist && rollup -c", "build": "shx rm -rf dist && rollup -c",