diff --git a/kernel/0010-tegra-gpc-dma-mem-leak.patch b/kernel/0010-tegra-gpc-dma-mem-leak.patch deleted file mode 100644 index f1797be2..00000000 --- a/kernel/0010-tegra-gpc-dma-mem-leak.patch +++ /dev/null @@ -1,26 +0,0 @@ -From ec28603337e94c34732db6c779af7c891a887bba Wed 24 Jan 09:00:00 2024 -From: Kevin Christensen -Date: Wed, 24 Jan 2024 09:00:00 -0700 -Subject: [PATCH] Fix memory leak in tegra_dma_prep_slave_sg - -Fixes a memory leak in kernel tegra serial driver. -This ensures the memory allocated in function `tegra_dma_prep_slave_sg` -is cleaned up properly. Manifested as slab unreclaimable growing unbounded -via calls to kmalloc-256 - ---- - drivers/dma/tegra-gpc-dma.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/dma/tegra-gpc-dma.c b/drivers/dma/tegra-gpc-dma.c -index 6f9ebd9..b99f210 100644 ---- a/drivers/dma/tegra-gpc-dma.c -+++ b/drivers/dma/tegra-gpc-dma.c -@@ -696,6 +696,7 @@ static int tegra_dma_terminate_all(struct dma_chan *dc) - return err; - } - -+ vchan_terminate_vdesc(&tdc->dma_desc->vd); - tegra_dma_disable(tdc); - tdc->dma_desc = NULL; - } diff --git a/kernel/default.nix b/kernel/default.nix index 22eb731e..6f9c0e8c 100644 --- a/kernel/default.nix +++ b/kernel/default.nix @@ -1,6 +1,7 @@ { pkgs , lib , fetchFromGitHub +, fetchpatch , l4t-xusb-firmware , realtime ? false , kernelPatches ? [ ] @@ -91,11 +92,16 @@ pkgsAarch64.buildLinux (args // { # Fix gcc13 compilation failure { patch = ./0009-bonding-gcc13-synchronize-bond_-a-t-lb_xmit-types.patch; } - + # Fixes a memory leak by kernel tegra serial driver # This manifested via slab unreclaimable growing unbounded via repeated kmalloc-256 calls - # Patch is applied on tegra-gpc-dma.c - { patch = ./0010-tegra-gpc-dma-mem-leak.patch; } + # This patch is present in 35.4.1 and should be removed when we update + { + patch = fetchpatch { + url = "https://github.com/OE4T/linux-tegra-5.10/commit/d5b90d6b9365250adb73b2fe5b52a5228df3b1d9.patch"; + sha256 = "sha256-a5LL4avaxQ3WYr9fRPMCfHrl4iAp1yhH95R+iI/PwYc="; + }; + } ] ++ kernelPatches; structuredExtraConfig = with lib.kernel; {