Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/panthor: disable async work during unplug

A previous change, "drm/panthor: Fix UAF race between device unplug and
FW event processing", fixes a real issue where new work was unexpectedly
queued after cancellation. This was fixed by a disable instead.

Apply the same disable logic to other device level async work on device
unplug as a precaution.

Signed-off-by: Ketil Johnsen <ketil.johnsen@arm.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20251029111412.924104-1-ketil.johnsen@arm.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>

authored by

Ketil Johnsen and committed by
Liviu Dudau
65c22519 7051f6ba

+4 -5
+1 -1
drivers/gpu/drm/panthor/panthor_device.c
··· 121 121 { 122 122 struct panthor_device *ptdev = container_of(ddev, struct panthor_device, base); 123 123 124 - cancel_work_sync(&ptdev->reset.work); 124 + disable_work_sync(&ptdev->reset.work); 125 125 destroy_workqueue(ptdev->reset.wq); 126 126 } 127 127
+1 -1
drivers/gpu/drm/panthor/panthor_fw.c
··· 1164 1164 { 1165 1165 struct panthor_fw_section *section; 1166 1166 1167 - cancel_delayed_work_sync(&ptdev->fw->watchdog.ping_work); 1167 + disable_delayed_work_sync(&ptdev->fw->watchdog.ping_work); 1168 1168 1169 1169 if (!IS_ENABLED(CONFIG_PM) || pm_runtime_active(ptdev->base.dev)) { 1170 1170 /* Make sure the IRQ handler cannot be called after that point. */
+2 -3
drivers/gpu/drm/panthor/panthor_sched.c
··· 3877 3877 { 3878 3878 struct panthor_scheduler *sched = ptdev->scheduler; 3879 3879 3880 - cancel_delayed_work_sync(&sched->tick_work); 3880 + disable_delayed_work_sync(&sched->tick_work); 3881 3881 disable_work_sync(&sched->fw_events_work); 3882 + disable_work_sync(&sched->sync_upd_work); 3882 3883 3883 3884 mutex_lock(&sched->lock); 3884 3885 if (sched->pm.has_ref) { ··· 3896 3895 3897 3896 if (!sched || !sched->csg_slot_count) 3898 3897 return; 3899 - 3900 - cancel_delayed_work_sync(&sched->tick_work); 3901 3898 3902 3899 if (sched->wq) 3903 3900 destroy_workqueue(sched->wq);