]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/panthor: Keep the reset work disabled until everything is initialized
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 25 Jun 2026 12:40:28 +0000 (14:40 +0200)
committerLiviu Dudau <liviu.dudau@arm.com>
Tue, 30 Jun 2026 14:26:55 +0000 (15:26 +0100)
The reset work will sub-component reset helpers, which might not be
ready if the reset happens during initialization, leading to NULL
pointer dereferences or worse.

Avoid that by keeping the reset work disabled while we're initializing
those sub-components.

Fixes: 5fe909cae118 ("drm/panthor: Add the device logical block")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260625-panthor-signal-from-irq-v5-0-8836a74e0ef9@collabora.com?part=4
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260625-panthor-misc-fixes-v1-2-b67ed973fea6@collabora.com
drivers/gpu/drm/panthor/panthor_device.c

index bd417d6ae8c00cca362d750bf2fc131656c07139..0b25abebb803c6a016ce85a80469f9e8124a324d 100644 (file)
@@ -207,6 +207,7 @@ int panthor_device_init(struct panthor_device *ptdev)
        *dummy_page_virt = 1;
 
        INIT_WORK(&ptdev->reset.work, panthor_device_reset_work);
+       disable_work(&ptdev->reset.work);
        ptdev->reset.wq = alloc_ordered_workqueue("panthor-reset-wq", 0);
        if (!ptdev->reset.wq)
                return -ENOMEM;
@@ -285,6 +286,9 @@ int panthor_device_init(struct panthor_device *ptdev)
 
        panthor_gem_init(ptdev);
 
+       /* Now that everything is initialized, we can enable the reset work. */
+       enable_work(&ptdev->reset.work);
+
        /* ~3 frames */
        pm_runtime_set_autosuspend_delay(ptdev->base.dev, 50);
        pm_runtime_use_autosuspend(ptdev->base.dev);