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: Fix race with suspend during unplug

There is a race between panthor_device_unplug() and
panthor_device_suspend() which can lead to IRQ handlers running on a
powered down GPU. This is how it can happen:
- unplug routine calls drm_dev_unplug()
- panthor_device_suspend() can now execute, and will skip a lot of
important work because the device is currently marked as unplugged.
- IRQs will remain active in this case and IRQ handlers can therefore
try to access a powered down GPU.

The fix is simply to take the PM ref in panthor_device_unplug() a
little bit earlier, before drm_dev_unplug().

Signed-off-by: Ketil Johnsen <ketil.johnsen@arm.com>
Fixes: 5fe909cae118a ("drm/panthor: Add the device logical block")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20251022103242.1083311-1-ketil.johnsen@arm.com
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>

authored by

Ketil Johnsen and committed by
Liviu Dudau
08be57e6 65c22519

+2 -2
+2 -2
drivers/gpu/drm/panthor/panthor_device.c
··· 84 84 return; 85 85 } 86 86 87 + drm_WARN_ON(&ptdev->base, pm_runtime_get_sync(ptdev->base.dev) < 0); 88 + 87 89 /* Call drm_dev_unplug() so any access to HW blocks happening after 88 90 * that point get rejected. 89 91 */ ··· 95 93 * future callers will wait on ptdev->unplug.done anyway. 96 94 */ 97 95 mutex_unlock(&ptdev->unplug.lock); 98 - 99 - drm_WARN_ON(&ptdev->base, pm_runtime_get_sync(ptdev->base.dev) < 0); 100 96 101 97 /* Now, try to cleanly shutdown the GPU before the device resources 102 98 * get reclaimed.