From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/amdgpu: fix root reservation in amdgpu_vm_handle_fault Date: Thu, 23 Apr 2026 09:58:50 +1000 Message-ID: In-Reply-To: <20260420121438.1612-1-pierre-eric.pelloux-prayer@amd.com> References: <20260420121438.1612-1-pierre-eric.pelloux-prayer@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/amdgpu: fix root reservation in amdgpu_vm_handle_fault Author: Pierre-Eric Pelloux-Prayer Patches: 2 Reviewed: 2026-04-23T09:58:50.258731 --- This is a single-patch fix for a real deadlock in `amdgpu_vm_handle_fault`.= The bug: `amdgpu_vm_lock_by_pasid` acquires the root BO reservation (via `= amdgpu_bo_reserve`), then calls `svm_range_restore_pages`, which eventually= reaches `svm_range_reserve_bos` =E2=86=92 `amdgpu_vm_lock_pd`, trying to l= ock the same root BO via `drm_exec`. Since the first lock is held without a= `ww_acquire_ctx` (NULL) and the second attempts to lock with a `drm_exec` = context, the same thread deadlocks on the `ww_mutex`. The fix =E2=80=94 unreserve root before calling `svm_range_restore_pages`, = then re-acquire via `amdgpu_vm_lock_by_pasid` if needed =E2=80=94 is the co= rrect minimal approach. The unlock/relock window is properly guarded by the= re-validation in `amdgpu_vm_lock_by_pasid` (which re-checks the pasid=E2= =86=92vm mapping and verifies `vm->root.bo` still matches). **Verdict: The patch is correct and should be safe to apply.** One minor co= ncern noted below about a missing `Cc: stable` tag. --- Generated by Claude Code Patch Reviewer