diff --git a/CHANGELOG.md b/CHANGELOG.md index be817c38..46884dec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +# [3.5.2] - 2021-05-15 +### Changed +- Bugfix: prevent the hang on compute/integrated mode change + # [3.5.1] - 2021-04-25 ### Changed + Anime: diff --git a/Cargo.lock b/Cargo.lock index ad1ac5a8..50a8c5bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "daemon" -version = "3.5.1" +version = "3.5.2" dependencies = [ "env_logger", "intel-pstate", diff --git a/Cargo.toml b/Cargo.toml index 1daec777..c80df6f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,4 @@ opt-level = 1 [profile.bench] debug = false -opt-level = 3 +opt-level = 3 \ No newline at end of file diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index ad5c47f8..7759537d 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon" -version = "3.5.1" +version = "3.5.2" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/daemon/src/ctrl_gfx/controller.rs b/daemon/src/ctrl_gfx/controller.rs index 57fe324f..ec5af564 100644 --- a/daemon/src/ctrl_gfx/controller.rs +++ b/daemon/src/ctrl_gfx/controller.rs @@ -1,3 +1,4 @@ +use ::zbus::Connection; use ctrl_gfx::error::GfxError; use ctrl_gfx::*; use ctrl_rog_bios::CtrlRogBios; @@ -14,7 +15,6 @@ use std::{str::FromStr, sync::mpsc}; use std::{sync::Arc, sync::Mutex}; use sysfs_class::{PciDevice, SysClass}; use system::{GraphicsDevice, PciBus}; -use ::zbus::{Connection}; use crate::*; @@ -607,11 +607,14 @@ impl CtrlGraphics { let bus = self.bus.clone(); Self::do_vendor_tasks(vendor, vfio_enable, &devices, &bus)?; info!("GFX: Graphics mode changed to {}", <&str>::from(vendor)); - if let Ok(config) = self.config.lock() { - if matches!(vendor, GfxVendors::Compute | GfxVendors::Vfio) - && config.gfx_save_compute_vfio - { - Self::save_gfx_mode(vendor, self.config.clone()); + if matches!(vendor, GfxVendors::Compute | GfxVendors::Vfio) { + loop { + if let Ok(config) = self.config.try_lock() { + if config.gfx_save_compute_vfio { + Self::save_gfx_mode(vendor, self.config.clone()); + } + return Ok(action_required); + } } } } @@ -625,7 +628,7 @@ impl CtrlGraphics { let devices = self.nvidia.clone(); let bus = self.bus.clone(); - let vfio_enable = if let Ok(config) = self.config.lock() { + let vfio_enable = if let Ok(config) = self.config.try_lock() { config.gfx_vfio_enable } else { false