From 5e9934fa077fb326001972bc4754bf45b33180eb Mon Sep 17 00:00:00 2001 From: paki23 Date: Sat, 30 Jul 2022 18:21:03 +0200 Subject: [PATCH 1/5] pstate:init fixup pstate --- common/cpu/amd/pstate.nix | 9 +++++++++ flake.nix | 1 + 2 files changed, 10 insertions(+) create mode 100644 common/cpu/amd/pstate.nix diff --git a/common/cpu/amd/pstate.nix b/common/cpu/amd/pstate.nix new file mode 100644 index 0000000..35d8be0 --- /dev/null +++ b/common/cpu/amd/pstate.nix @@ -0,0 +1,9 @@ +{ lib, config, ... }: { + #Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html + + imports = [ ./. ]; + boot = lib.mkIf (!lib.versionOlder config.boot.kernelPackages.kernel.version "5.17") { + kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ]; + kernelModules = [ "amd-pstate" ]; + }; +} diff --git a/flake.nix b/flake.nix index 7337b68..7f02785 100644 --- a/flake.nix +++ b/flake.nix @@ -131,6 +131,7 @@ tuxedo-infinitybook-v4 = import ./tuxedo/infinitybook/v4; common-cpu-amd = import ./common/cpu/amd; + common-cpu-amd-pstate = import ./common/cpu/amd/pstate.nix; common-cpu-intel = import ./common/cpu/intel; common-cpu-intel-cpu-only = import ./common/cpu/intel/cpu-only.nix; common-cpu-intel-kaby-lake = import ./common/cpu/intel/kaby-lake; From b183aac0ac4115a4aae4592e761e4e79ac287324 Mon Sep 17 00:00:00 2001 From: paki23 Date: Sat, 30 Jul 2022 18:21:18 +0200 Subject: [PATCH 2/5] g733qs: addded amd pstate handling --- asus/rog-strix/g733qs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asus/rog-strix/g733qs/default.nix b/asus/rog-strix/g733qs/default.nix index 89ec2a7..8e5fde1 100644 --- a/asus/rog-strix/g733qs/default.nix +++ b/asus/rog-strix/g733qs/default.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: { imports = [ - ../../../common/cpu/amd + ../../../common/cpu/amd/pstate.nix ../../../common/gpu/nvidia.nix ../../../common/pc/laptop ../../../common/pc/ssd From 8732fa9eb5f4d98ed0986e8cf7214057beec0cb0 Mon Sep 17 00:00:00 2001 From: paki23 Date: Sun, 31 Jul 2022 20:13:42 +0200 Subject: [PATCH 3/5] clarify amd pstate --- common/cpu/amd/pstate.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/common/cpu/amd/pstate.nix b/common/cpu/amd/pstate.nix index 35d8be0..62c88f0 100644 --- a/common/cpu/amd/pstate.nix +++ b/common/cpu/amd/pstate.nix @@ -1,5 +1,6 @@ { lib, config, ... }: { #Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html + #On recent AMD cupus this can be more energy efficient imports = [ ./. ]; boot = lib.mkIf (!lib.versionOlder config.boot.kernelPackages.kernel.version "5.17") { From 68a27c2b00fd6e4ed23b7093c226ef604fdf4f0f Mon Sep 17 00:00:00 2001 From: pasqui23 Date: Mon, 1 Aug 2022 12:03:29 +0200 Subject: [PATCH 4/5] Clarify kernel version condition Co-authored-by: Sandro --- common/cpu/amd/pstate.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/cpu/amd/pstate.nix b/common/cpu/amd/pstate.nix index 62c88f0..efd01f1 100644 --- a/common/cpu/amd/pstate.nix +++ b/common/cpu/amd/pstate.nix @@ -1,9 +1,9 @@ { lib, config, ... }: { - #Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html - #On recent AMD cupus this can be more energy efficient + # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html + # On recent AMD cupus this can be more energy efficient imports = [ ./. ]; - boot = lib.mkIf (!lib.versionOlder config.boot.kernelPackages.kernel.version "5.17") { + boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "5.17") { kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ]; kernelModules = [ "amd-pstate" ]; }; From a01a1095e4226dcb3ba68937831c7cc90a8eedea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 1 Aug 2022 14:14:12 +0200 Subject: [PATCH 5/5] amd pstate: small typo --- common/cpu/amd/pstate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cpu/amd/pstate.nix b/common/cpu/amd/pstate.nix index efd01f1..7d5c2c0 100644 --- a/common/cpu/amd/pstate.nix +++ b/common/cpu/amd/pstate.nix @@ -1,6 +1,6 @@ { lib, config, ... }: { # Enables the amd cpu scaling https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html - # On recent AMD cupus this can be more energy efficient + # On recent AMD CPUs this can be more energy efficient. imports = [ ./. ]; boot = lib.mkIf (lib.versionAtLeast config.boot.kernelPackages.kernel.version "5.17") {