Sasha Levin
2024-Jan-08 12:28 UTC
[PATCH AUTOSEL 6.1 5/5] nouveau: fix disp disabling with GSP
From: Dave Airlie <airlied at gmail.com> [ Upstream commit 7854ea0e408d7f2e8faaada1773f3ddf9cb538f5 ] This func ptr here is normally static allocation, but gsp r535 uses a dynamic pointer, so we need to handle that better. This fixes a crash with GSP when you use config=disp=0 to avoid disp problems. Signed-off-by: Dave Airlie <airlied at redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied at gmail.com Signed-off-by: Sasha Levin <sashal at kernel.org> --- drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c index 65c99d948b686..ae47eabd5d0bd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c @@ -359,7 +359,7 @@ nvkm_disp_oneinit(struct nvkm_engine *engine) if (ret) return ret; - if (disp->func->oneinit) { + if (disp->func && disp->func->oneinit) { ret = disp->func->oneinit(disp); if (ret) return ret; @@ -461,8 +461,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, spin_lock_init(&disp->client.lock); ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine); - if (ret) + if (ret) { + disp->func = NULL; return ret; + } if (func->super) { disp->super.wq = create_singlethread_workqueue("nvkm-disp"); -- 2.43.0
David Airlie
2024-Jan-08 20:51 UTC
[PATCH AUTOSEL 6.1 5/5] nouveau: fix disp disabling with GSP
NAK for backporting this to anything, it is just a fix for 6.7 On Mon, Jan 8, 2024 at 10:28?PM Sasha Levin <sashal at kernel.org> wrote:> > From: Dave Airlie <airlied at gmail.com> > > [ Upstream commit 7854ea0e408d7f2e8faaada1773f3ddf9cb538f5 ] > > This func ptr here is normally static allocation, but gsp r535 > uses a dynamic pointer, so we need to handle that better. > > This fixes a crash with GSP when you use config=disp=0 to avoid > disp problems. > > Signed-off-by: Dave Airlie <airlied at redhat.com> > Link: https://patchwork.freedesktop.org/patch/msgid/20231222043308.3090089-4-airlied at gmail.com > Signed-off-by: Sasha Levin <sashal at kernel.org> > --- > drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c > index 65c99d948b686..ae47eabd5d0bd 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c > +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/base.c > @@ -359,7 +359,7 @@ nvkm_disp_oneinit(struct nvkm_engine *engine) > if (ret) > return ret; > > - if (disp->func->oneinit) { > + if (disp->func && disp->func->oneinit) { > ret = disp->func->oneinit(disp); > if (ret) > return ret; > @@ -461,8 +461,10 @@ nvkm_disp_new_(const struct nvkm_disp_func *func, struct nvkm_device *device, > spin_lock_init(&disp->client.lock); > > ret = nvkm_engine_ctor(&nvkm_disp, device, type, inst, true, &disp->engine); > - if (ret) > + if (ret) { > + disp->func = NULL; > return ret; > + } > > if (func->super) { > disp->super.wq = create_singlethread_workqueue("nvkm-disp"); > -- > 2.43.0 >
Reasonably Related Threads
- [PATCH AUTOSEL 6.1 5/5] nouveau: fix disp disabling with GSP
- nouveau GSP fixes
- [PATCH 2/2] nouveau/disp: fix post-gsp build on 32-bit arm.
- [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page
- [PATCH v5 0/3] drm/nouveau: set DMA mask before mapping scratch page