aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorJesus Narvaez <[email protected]>2025-05-28 23:05:51 +0000
committerJoonas Lahtinen <[email protected]>2025-06-02 09:19:14 +0000
commit0323a5127e7c534cfc88efe0f850a0cb777e938b (patch)
tree59aabdd3da2c5a08c4aaa111a13dec30c376417b /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parentdrm/i915/psr: Fix using wrong mask in REG_FIELD_PREP (diff)
downloadkernel-0323a5127e7c534cfc88efe0f850a0cb777e938b.tar.gz
kernel-0323a5127e7c534cfc88efe0f850a0cb777e938b.zip
drm/i915/guc: Handle race condition where wakeref count drops below 0
There is a rare race condition when preparing for a reset where guc_lrc_desc_unpin() could be in the process of deregistering a context while a different thread is scrubbing outstanding contexts and it alters the context state and does a wakeref put. Then, if there is a failure with deregister_context(), a second wakeref put could occur. As a result the wakeref count could drop below 0 and fail an INTEL_WAKEREF_BUG_ON() check. Therefore if there is a failure with deregister_context(), undo the context state changes and do a wakeref put only if the context was set to be destroyed earlier. v2: Expand comment to better explain change. (Daniele) v3: Removed addition to the original comment. (Daniele) Fixes: 2f2cc53b5fe7 ("drm/i915/guc: Close deregister-context race against CT-loss") Signed-off-by: Jesus Narvaez <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Alan Previn <[email protected]> Cc: Anshuman Gupta <[email protected]> Cc: Mousumi Jana <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Matt Roper <[email protected]> Reviewed-by: Daniele Ceraolo Spurio <[email protected]> Signed-off-by: John Harrison <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit f36a75aba1c3176d177964bca76f86a075d2943a) Signed-off-by: Joonas Lahtinen <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
0 files changed, 0 insertions, 0 deletions