aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorJohn Stultz <[email protected]>2025-08-05 00:10:02 +0000
committerPeter Zijlstra <[email protected]>2025-08-13 08:34:54 +0000
commit21924af67d69d7c9fdaf845be69043cfe75196a1 (patch)
tree156c223a25779d061990c133427ee909548d9efb /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parentfutex: Use user_write_access_begin/_end() in futex_put_value() (diff)
downloadkernel-21924af67d69d7c9fdaf845be69043cfe75196a1.tar.gz
kernel-21924af67d69d7c9fdaf845be69043cfe75196a1.zip
locking: Fix __clear_task_blocked_on() warning from __ww_mutex_wound() path
The __clear_task_blocked_on() helper added a number of sanity checks ensuring we hold the mutex wait lock and that the task we are clearing blocked_on pointer (if set) matches the mutex. However, there is an edge case in the _ww_mutex_wound() logic where we need to clear the blocked_on pointer for the task that owns the mutex, not the task that is waiting on the mutex. For this case the sanity checks aren't valid, so handle this by allowing a NULL lock to skip the additional checks. K Prateek Nayak and Maarten Lankhorst also pointed out that in this case where we don't hold the owner's mutex wait_lock, we need to be a bit more careful using READ_ONCE/WRITE_ONCE in both the __clear_task_blocked_on() and __set_task_blocked_on() implementations to avoid accidentally tripping WARN_ONs if two instances race. So do that here as well. This issue was easier to miss, I realized, as the test-ww_mutex driver only exercises the wait-die class of ww_mutexes. I've sent a patch[1] to address this so the logic will be easier to test. [1]: https://lore.kernel.org/lkml/[email protected]/ Fixes: a4f0b6fef4b0 ("locking/mutex: Add p->blocked_on wrappers for correctness checks") Closes: https://lore.kernel.org/lkml/[email protected]/ Reported-by: [email protected] Reported-by: Maarten Lankhorst <[email protected]> Signed-off-by: John Stultz <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: K Prateek Nayak <[email protected]> Acked-by: Maarten Lankhorst <[email protected]> Tested-by: K Prateek Nayak <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
0 files changed, 0 insertions, 0 deletions