]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/6.8.6/nouveau-fix-devinit-paths-to-only-handle-display-on-.patch
Linux 6.8.6
[thirdparty/kernel/stable-queue.git] / releases / 6.8.6 / nouveau-fix-devinit-paths-to-only-handle-display-on-.patch
1 From 0f7b66430032dfc3b05586fb97ff5da6121f7047 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Mon, 8 Apr 2024 16:42:43 +1000
4 Subject: nouveau: fix devinit paths to only handle display on GSP.
5
6 From: Dave Airlie <airlied@gmail.com>
7
8 [ Upstream commit 718c4fb221dbeff9072810841b949413c5ffc345 ]
9
10 This reverts:
11 nouveau/gsp: don't check devinit disable on GSP.
12 and applies a further fix.
13
14 It turns out the open gpu driver, checks this register,
15 but only for display.
16
17 Match that behaviour and in the turing path only disable
18 the display block. (ampere already only does displays).
19
20 Fixes: 5d4e8ae6e57b ("nouveau/gsp: don't check devinit disable on GSP.")
21 Reviewed-by: Danilo Krummrich <dakr@redhat.com>
22 Signed-off-by: Dave Airlie <airlied@redhat.com>
23 Link: https://patchwork.freedesktop.org/patch/msgid/20240408064243.2219527-1-airlied@gmail.com
24 Signed-off-by: Sasha Levin <sashal@kernel.org>
25 ---
26 drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c | 12 ++++++++----
27 drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c | 1 +
28 2 files changed, 9 insertions(+), 4 deletions(-)
29
30 diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
31 index 7bcbc4895ec22..271bfa038f5bc 100644
32 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
33 +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
34 @@ -25,6 +25,7 @@
35
36 #include <subdev/bios.h>
37 #include <subdev/bios/init.h>
38 +#include <subdev/gsp.h>
39
40 void
41 gm107_devinit_disable(struct nvkm_devinit *init)
42 @@ -33,10 +34,13 @@ gm107_devinit_disable(struct nvkm_devinit *init)
43 u32 r021c00 = nvkm_rd32(device, 0x021c00);
44 u32 r021c04 = nvkm_rd32(device, 0x021c04);
45
46 - if (r021c00 & 0x00000001)
47 - nvkm_subdev_disable(device, NVKM_ENGINE_CE, 0);
48 - if (r021c00 & 0x00000004)
49 - nvkm_subdev_disable(device, NVKM_ENGINE_CE, 2);
50 + /* gsp only wants to enable/disable display */
51 + if (!nvkm_gsp_rm(device->gsp)) {
52 + if (r021c00 & 0x00000001)
53 + nvkm_subdev_disable(device, NVKM_ENGINE_CE, 0);
54 + if (r021c00 & 0x00000004)
55 + nvkm_subdev_disable(device, NVKM_ENGINE_CE, 2);
56 + }
57 if (r021c04 & 0x00000001)
58 nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
59 }
60 diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c
61 index 11b4c9c274a1a..666eb93b1742c 100644
62 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c
63 +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/r535.c
64 @@ -41,6 +41,7 @@ r535_devinit_new(const struct nvkm_devinit_func *hw,
65
66 rm->dtor = r535_devinit_dtor;
67 rm->post = hw->post;
68 + rm->disable = hw->disable;
69
70 ret = nv50_devinit_new_(rm, device, type, inst, pdevinit);
71 if (ret)
72 --
73 2.43.0
74