diff --git a/flake.lock b/flake.lock index d53cfed..7aff31c 100644 --- a/flake.lock +++ b/flake.lock @@ -190,11 +190,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1706834982, - "narHash": "sha256-3CfxA7gZ+DVv/N9Pvw61bV5Oe/mWfxYPyVQGqp9TMJA=", + "lastModified": 1707211557, + "narHash": "sha256-LTKTzZ6fM5j8XWXf51IMBzDaOaJg9kYWLUZxoIhzRN8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "83e571bb291161682b9c3ccd48318f115143a550", + "rev": "6e5cc385fc8cf5ca6495d70243074ccdea9f64c7", "type": "github" }, "original": { @@ -206,11 +206,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1707546158, - "narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=", + "lastModified": 1707956935, + "narHash": "sha256-ZL2TrjVsiFNKOYwYQozpbvQSwvtV/3Me7Zwhmdsfyu4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0", + "rev": "a4d4fe8c5002202493e87ec8dbc91335ff55552c", "type": "github" }, "original": { @@ -254,11 +254,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1707650010, - "narHash": "sha256-dOhphIA4MGrH4ElNCy/OlwmN24MsnEqFjRR6+RY7jZw=", + "lastModified": 1707978831, + "narHash": "sha256-UblFdWQ2MMZNzD9C/w8+7RjAJ2QIbebbzHUniQ/a44o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "809cca784b9f72a5ad4b991e0e7bcf8890f9c3a6", + "rev": "c68a9fc85c2cb3a313be6ff40511635544dde8da", "type": "github" }, "original": { diff --git a/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch b/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch deleted file mode 100644 index cc0d4a0..0000000 --- a/hosts/framenix/0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6e77e6de7582f35138fa1c7523268602ecb2e0a0 Mon Sep 17 00:00:00 2001 -From: Arunpravin Paneer Selvam -Date: Tue, 6 Feb 2024 10:39:24 -0800 -Subject: [PATCH] drm/buddy: Improve alloc_range error handling routine - -If alloc_range() couldn't allocate the requuired size, -return -ENOSPC. - -Signed-off-by: Arunpravin Paneer Selvam ---- - drivers/gpu/drm/drm_buddy.c | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c -index f57e6d74fb0e..d5aba6392da0 100644 ---- a/drivers/gpu/drm/drm_buddy.c -+++ b/drivers/gpu/drm/drm_buddy.c -@@ -483,9 +483,9 @@ static int __alloc_range(struct drm_buddy *mm, - struct list_head *blocks, - u64 *total_allocated_on_err) - { -+ u64 total_allocated = 0, allocated_size = 0; - struct drm_buddy_block *block; - struct drm_buddy_block *buddy; -- u64 total_allocated = 0; - LIST_HEAD(allocated); - u64 end; - int err; -@@ -539,6 +539,15 @@ static int __alloc_range(struct drm_buddy *mm, - } while (1); - - list_splice_tail(&allocated, blocks); -+ -+ list_for_each_entry(block, blocks, link) -+ allocated_size += drm_buddy_block_size(mm, block); -+ -+ if (allocated_size < size) { -+ err = -ENOSPC; -+ goto err_free; -+ } -+ - return 0; - - err_undo: --- -2.25.1 - diff --git a/hosts/framenix/default.nix b/hosts/framenix/default.nix index 6c2be01..1f97a15 100644 --- a/hosts/framenix/default.nix +++ b/hosts/framenix/default.nix @@ -24,19 +24,30 @@ in argsOverride = rec { src = pkgs.fetchurl { url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz"; - hash = "sha256-9CfwhjawHkMjNYqqJAHq9dQnpeWm0qH/UOAnSu82mNQ="; + hash = "sha256-sLypPyMhFhamhQOWDIkzZ5cVrWfoZDb3prJaESD6UU0="; }; - version = "6.8-rc3"; - modDirVersion = "6.8.0-rc3"; + version = "6.8-rc4"; + modDirVersion = "6.8.0-rc4"; }; }); # revert some commits that introduced the clourful graphics artefacts flickering, # at least that's the current working hypothesis in https://gitlab.freedesktop.org/drm/amd/-/issues/3097 boot.kernelPatches = [ - {name = "patch attempt from https://gitlab.freedesktop.org/drm/amd/-/issues/3097#note_2271482"; - patch = ./0001-drm-buddy-Improve-alloc_range-error-handling-routine.patch; + {name = "[PATCH] platform/x86/amd/pmf: Fix a suspend hang on Framework 13"; + patch = pkgs.fetchpatch { + url = "https://lore.kernel.org/platform-driver-x86/20240217005216.113408-1-mario.limonciello@amd.com/raw"; + hash = "sha256-FeKIQ0eLP4yq1WcMaf8Dp0c+DuqOdeuBQU07dFswzD4="; + }; + } + {name = "drm/buddy: Fix alloc_range() error handling code"; + patch = pkgs.fetchpatch { + url = "https://cgit.freedesktop.org/drm/drm-misc/patch/?id=8746c6c9dfa31d269c65dd52ab42fde0720b7d91"; + hash = "sha256-Ir7TDLspbYilTJr6aVVb8urIYI2N2vZwI5ayp7laaGw="; + }; } ]; + # fix freezes after s2idle suspend-resume + #boot.blacklistedKernelModules = [ "amd-pmf" ]; boot.kernelParams = [ # temporary workaround for white flickering graphics artefacts