drm/panfrost: Fix a deadlock between the shrinker and madvise path
authorBoris Brezillon <boris.brezillon@collabora.com>
Sun, 1 Nov 2020 17:40:16 +0000 (18:40 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 3 Nov 2020 08:21:52 +0000 (09:21 +0100)
commit7d2d6d01293e6d9b42a6cb410be4158571f7fe9d
tree6e84f668bfa351c9d31383e327e14202d8efaf03
parentdcda7c28bff2662a44c0adaf87c08031bebeb7d8
drm/panfrost: Fix a deadlock between the shrinker and madvise path

panfrost_ioctl_madvise() and panfrost_gem_purge() acquire the mappings
and shmem locks in different orders, thus leading to a potential
the mappings lock first.

Fixes: bdefca2d8dc0 ("drm/panfrost: Add the panfrost_gem_mapping concept")
Cc: <stable@vger.kernel.org>
Cc: Christian Hewitt <christianshewitt@gmail.com>
Reported-by: Christian Hewitt <christianshewitt@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201101174016.839110-1-boris.brezillon@collabora.com
drivers/gpu/drm/panfrost/panfrost_gem.c
drivers/gpu/drm/panfrost/panfrost_gem.h
drivers/gpu/drm/panfrost/panfrost_gem_shrinker.c