drm/lima: Drain fence callbacks before destroying slab
Subsystems (3)
PATCH 1/1 drm/lima: Drain fence callbacks before destroying slab
lima_fence_release() defers freeing fences from lima_fence_slab to an RCU callback. The last lima_sched_slab_fini() can destroy the slab and clear its pointer while a release callback is still queued. Module removal can also free lima_fence_release_rcu() before that callback runs.
Drain outstanding callbacks before destroying the last fence slab.
--- drivers/gpu/drm/lima/lima_sched.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/lima/lima_sched.c +1 -0
@@ -44,6 +44,7 @@ int lima_sched_slab_init(void)void lima_sched_slab_fini (void ) {if (!--lima_fence_slab_refcnt) { +rcu_barrier ();kmem_cache_destroy (lima_fence_slab); lima_fence_slab =NULL ; }
Signature · 1 line
2.34.1
Quoted 29 lines · Jiale Yao
lima_fence_release()defers freeing fences fromlima_fence_slabto an RCU callback. The lastlima_sched_slab_fini()can destroy the slab and clear its pointer while a release callback is still queued. Module removal can also freelima_fence_release_rcu()before that callback runs.Drain outstanding callbacks before destroying the last fence slab.
Fixes a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")Signed-off-by Jiale Yao <[email protected]>--- drivers/gpu/drm/lima/lima_sched.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/lima/lima_sched.c +1
-1@@ -44,6 +44,7 @@ int lima_sched_slab_init(void)void lima_sched_slab_fini (void ) {if (!--lima_fence_slab_refcnt) { +rcu_barrier ();kmem_cache_destroy (lima_fence_slab); lima_fence_slab =NULL ; } --2.34.1