linux-stable/drivers/gpu/drm/nouveau/nvkm/subdev/instmem
Thierry Reding 46dec61643 drm/nouveau: Fixup gk20a instobj hierarchy
Commit 12c9b05da9 ("drm/nouveau/imem: support allocations not
preserved across suspend") uses container_of() to cast from struct
nvkm_memory to struct nvkm_instobj, assuming that all instance objects
are derived from struct nvkm_instobj. For the gk20a family that's not
the case and they are derived from struct nvkm_memory instead. This
causes some subtle data corruption (nvkm_instobj.preserve ends up
mapping to gk20a_instobj.vaddr) that causes a NULL pointer dereference
in gk20a_instobj_acquire_iommu() (and possibly elsewhere) and also
prevents suspend/resume from working.

Fix this by making struct gk20a_instobj derive from struct nvkm_instobj
instead.

Fixes: 12c9b05da9 ("drm/nouveau/imem: support allocations not preserved across suspend")
Reported-by: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231208104653.1917055-1-thierry.reding@gmail.com
2023-12-15 14:10:40 +10:00
..
Kbuild drm/nouveau/mmu/r535: initial support 2023-10-31 15:08:16 +10:00
base.c drm/nouveau/imem/tu102-: prepare for GSP-RM 2023-10-31 15:08:12 +10:00
gk20a.c drm/nouveau: Fixup gk20a instobj hierarchy 2023-12-15 14:10:40 +10:00
nv04.c drm/nouveau/imem/tu102-: prepare for GSP-RM 2023-10-31 15:08:12 +10:00
nv40.c
nv50.c drm/nouveau/mmu/r535: initial support 2023-10-31 15:08:16 +10:00
priv.h drm/nouveau/mmu/r535: initial support 2023-10-31 15:08:16 +10:00
r535.c nouveau/gsp: move to 535.113.01 2023-11-03 12:57:14 +10:00