]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: fix locking in vmap/vunmap TTM GEM helpers
authorChristian König <christian.koenig@amd.com>
Fri, 15 Jul 2022 07:57:22 +0000 (09:57 +0200)
committerChristian König <christian.koenig@amd.com>
Mon, 18 Jul 2022 07:18:53 +0000 (09:18 +0200)
commitabf856589033084c75c082d21408c382ed3be2f4
tree0118d6aa78d7d7425ef58a031f45344e32f7cde8
parentbabdbae3592ba69c1a1ea79c7cec58bccd9e6cae
drm/ttm: fix locking in vmap/vunmap TTM GEM helpers

I've stumbled over this while reviewing patches for DMA-buf and it looks
like we completely messed the locking up here.

In general most TTM function should only be called while holding the
appropriate BO resv lock. Without this we could break the internal
buffer object state here.

Only compile tested!

Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes: 22f109eb6e34 ("drm/ttm: Add vmap/vunmap to TTM and TTM GEM helpers")
Cc: stable@vger.kernel.org
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220715111533.467012-1-christian.koenig@amd.com
drivers/gpu/drm/drm_gem_ttm_helper.c