]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/ttm: Reorder sys manager cleanup step
authorKarolina Stolarek <karolina.stolarek@intel.com>
Mon, 16 Oct 2023 12:15:25 +0000 (14:15 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Nov 2023 13:09:00 +0000 (14:09 +0100)
commit93ff3297b04a3d2565cb35c0e47477044dbf37ab
treec672eaf54e928d66dcebcb57fc17f00c97e9db1e
parent0074d0980bf868c6c07fb18450f574a7cb95921f
drm/ttm: Reorder sys manager cleanup step

[ Upstream commit 3b401e30c249849d803de6c332dad2a595a58658 ]

With the current cleanup flow, we could trigger a NULL pointer
dereference if there is a delayed destruction of a BO with a
system resource that gets executed on drain_workqueue() call,
as we attempt to free a resource using an already released
resource manager.

Remove the device from the device list and drain its workqueue
before releasing the system domain manager in ttm_device_fini().

Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231016121525.2237838-1-karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/ttm/ttm_device.c