Commit 46210b6b authored by Alessio Belle's avatar Alessio Belle Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: drm/imagination: Fix kernel crash when hard resetting the GPU



commit d38376b3 upstream.

The GPU hard reset sequence calls pm_runtime_force_suspend() and
pm_runtime_force_resume(), which according to their documentation should
only be used during system-wide PM transitions to sleep states.

The main issue though is that depending on some internal runtime PM
state as seen by pm_runtime_force_suspend() (whether the usage count is
<= 1), pm_runtime_force_resume() might not resume the device unless
needed. If that happens, the runtime PM resume callback
pvr_power_device_resume() is not called, the GPU clocks are not
re-enabled, and the kernel crashes on the next attempt to access GPU
registers as part of the power-on sequence.

Replace calls to pm_runtime_force_suspend() and
pm_runtime_force_resume() with direct calls to the driver's runtime PM
callbacks, pvr_power_device_suspend() and pvr_power_device_resume(),
to ensure clocks are re-enabled and avoid the kernel crash.

Fixes: cc1aeedb ("drm/imagination: Implement firmware infrastructure and META FW support")
Change-Id: I8b7e5aadea6606811af7100720c2ffe0aceda361
Signed-off-by: default avatarAlessio Belle <alessio.belle@imgtec.com>
Reviewed-by: default avatarMatt Coster <matt.coster@imgtec.com>
Link: https://lore.kernel.org/r/20250624-fix-kernel-crash-gpu-hard-reset-v1-1-6d24810d72a6@imgtec.com


Cc: stable@vger.kernel.org
Signed-off-by: default avatarMatt Coster <matt.coster@imgtec.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 9f852d30)
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 66c54340
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment