]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/panthor: Fix race with suspend during unplug
authorKetil Johnsen <ketil.johnsen@arm.com>
Wed, 22 Oct 2025 10:32:41 +0000 (12:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:49 +0000 (14:02 +0100)
commit05bfa79dec11c96397b9087dca4a661f48cc29e3
treeab016b5d6432685e2a26f6de151b0c38ae765060
parent6c1da9ae2c123a9ffda5375e64cc81f9ed3cc04a
drm/panthor: Fix race with suspend during unplug

[ Upstream commit 08be57e6e8aa20ea5a6dd2552e38ac168d6a9b11 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/panthor/panthor_device.c