From: Chris Wilson Date: Wed, 12 Jun 2019 13:28:30 +0000 (+0100) Subject: dma-fence/reservation: Markup rcu protected access for DEBUG_MUTEXES X-Git-Tag: v5.15~303^2~28^2~5137 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5740671e596bdc3986a5391997de194300970201;p=platform%2Fkernel%2Flinux-starfive.git dma-fence/reservation: Markup rcu protected access for DEBUG_MUTEXES Mark the access to reservation_object.fence as being protected to silence sparse. Signed-off-by: Chris Wilson Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20190612132830.31221-1-chris@chris-wilson.co.uk --- diff --git a/include/linux/reservation.h b/include/linux/reservation.h index ee75076..644a22d 100644 --- a/include/linux/reservation.h +++ b/include/linux/reservation.h @@ -216,8 +216,12 @@ reservation_object_unlock(struct reservation_object *obj) { #ifdef CONFIG_DEBUG_MUTEXES /* Test shared fence slot reservation */ - if (obj->fence) - obj->fence->shared_max = obj->fence->shared_count; + if (rcu_access_pointer(obj->fence)) { + struct reservation_object_list *fence = + reservation_object_get_list(obj); + + fence->shared_max = fence->shared_count; + } #endif ww_mutex_unlock(&obj->lock); }