From ceb4778d67cbd525322bf46e4d3a5173e7d78d5e Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 5 Mar 2026 00:23:34 -0800 Subject: [PATCH] linux-firmware: Fix hardware sleep regression in amdnpu firmware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux-firmware 20260221 introduced new AMD NPU firmware that’s incompatible with kernels before the unreleased 7.0-rc versions, preventing affected devices from going into sleep. Apply the upstream patch that restores the old files for current kernels and renames the new files for unreleased kernels. https://gitlab.freedesktop.org/drm/amd/-/issues/5009 https://gitlab.com/kernel-firmware/linux-firmware/-/merge_requests/935 Signed-off-by: Anders Kaseorg --- pkgs/by-name/li/linux-firmware/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/linux-firmware/package.nix b/pkgs/by-name/li/linux-firmware/package.nix index 59d1d6fdf032..da540ba5d41d 100644 --- a/pkgs/by-name/li/linux-firmware/package.nix +++ b/pkgs/by-name/li/linux-firmware/package.nix @@ -1,6 +1,7 @@ { stdenvNoCC, fetchFromGitLab, + fetchpatch, lib, python3, rdfind, @@ -31,6 +32,15 @@ stdenvNoCC.mkDerivation rec { hash = "sha256-QHoS9+WS9IjRVhTJEFF/X8+4ZKjKwpJAvf7EqsV+qEY="; }; + patches = [ + # amdnpu: Restore old NPU firmware for compatibility + # https://gitlab.com/kernel-firmware/linux-firmware/-/merge_requests/935 + (fetchpatch { + url = "https://gitlab.com/kernel-firmware/linux-firmware/-/commit/58cf579b98c0c4878deeda1acb5db70e699875b5.patch"; + hash = "sha256-2UO9CxGM2Asb/fRAST4zRlMBSVjM+N/87NzSkSoQrQ0="; + }) + ]; + postUnpack = '' patchShebangs . '';