OSDN Git Service

drm/panfrost: Fix a race in panfrost_gem_free_object()
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 29 Nov 2019 13:59:04 +0000 (14:59 +0100)
committerRob Herring <robh@kernel.org>
Fri, 6 Dec 2019 17:06:16 +0000 (11:06 -0600)
commitaed44cbeae2b7674cd155ba5cc6506aafe46a94e
treeca806245e28d14a4f018ef7fd675d4216bfffddf
parent3bb69dbcb9e8430e0cc9990cff427ca3ae25ffdc
drm/panfrost: Fix a race in panfrost_gem_free_object()

panfrost_gem_shrinker_scan() might purge a BO (release the sgt and
kill the GPU mapping) that's being freed by panfrost_gem_free_object()
if we don't remove the BO from the shrinker list at the beginning of
panfrost_gem_free_object().

Fixes: 013b65101315 ("drm/panfrost: Add madvise and shrinker support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191129135908.2439529-5-boris.brezillon@collabora.com
drivers/gpu/drm/panfrost/panfrost_gem.c