]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/vc4: Shut down BO cache timer before teardown
authorLinmao Li <lilinmao@kylinos.cn>
Mon, 20 Jul 2026 08:44:26 +0000 (16:44 +0800)
committerMaíra Canal <mcanal@igalia.com>
Thu, 23 Jul 2026 23:07:23 +0000 (20:07 -0300)
The BO cache timer callback schedules time_work, and time_work can rearm
the timer through vc4_bo_cache_free_old().

vc4_bo_cache_destroy() deletes the timer and then cancels the work, which
does not break that cycle: the work being cancelled can rearm the timer,
and the timer then queues work again after teardown.

Use timer_shutdown_sync() instead, so the timer cannot be rearmed and the
cycle ends with cancel_work_sync().

Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
Cc: stable@vger.kernel.org
Signed-off-by: Linmao Li <lilinmao@kylinos.cn>
Link: https://patch.msgid.link/20260720084426.1632508-1-lilinmao@kylinos.cn
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
drivers/gpu/drm/vc4/vc4_bo.c

index 5e7c46dd7823abb68fdc50fa25b03eeb0e08ea84..49ea2ed0996b4c57da9e843fcfbd8ffc74748894 100644 (file)
@@ -1048,7 +1048,7 @@ static void vc4_bo_cache_destroy(struct drm_device *dev, void *unused)
        struct vc4_dev *vc4 = to_vc4_dev(dev);
        int i;
 
-       timer_delete(&vc4->bo_cache.time_timer);
+       timer_shutdown_sync(&vc4->bo_cache.time_timer);
        cancel_work_sync(&vc4->bo_cache.time_work);
 
        vc4_bo_cache_purge(dev);