]> www.infradead.org Git - users/hch/misc.git/commit
drm/panthor: Fix race when converting group handle to group object
authorSteven Price <steven.price@arm.com>
Mon, 23 Sep 2024 10:34:06 +0000 (11:34 +0100)
committerSteven Price <steven.price@arm.com>
Mon, 23 Sep 2024 15:09:21 +0000 (16:09 +0100)
commitcac075706f298948898b1f63e81709df42afa75d
tree2bcb2d063c13c278f3dccc535aed3426f6e10fb3
parentd92b90f9a54d9300a6e883258e79f36dab53bfae
drm/panthor: Fix race when converting group handle to group object

XArray provides it's own internal lock which protects the internal array
when entries are being simultaneously added and removed. However there
is still a race between retrieving the pointer from the XArray and
incrementing the reference count.

To avoid this race simply hold the internal XArray lock when
incrementing the reference count, this ensures there cannot be a racing
call to xa_erase().

Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240923103406.2509906-1-steven.price@arm.com
drivers/gpu/drm/panthor/panthor_sched.c