From: Claude Code Review Bot <claude-review@example.com>
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 [thread overview]
Message-ID: <review-overall-20260420121438.1612-1-pierre-eric.pelloux-prayer@amd.com> (raw)
In-Reply-To: <20260420121438.1612-1-pierre-eric.pelloux-prayer@amd.com>
Overall Series Review
Subject: drm/amdgpu: fix root reservation in amdgpu_vm_handle_fault
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
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` → `amdgpu_vm_lock_pd`, trying to lock 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 — unreserve root before calling `svm_range_restore_pages`, then re-acquire via `amdgpu_vm_lock_by_pasid` if needed — is the correct minimal approach. The unlock/relock window is properly guarded by the re-validation in `amdgpu_vm_lock_by_pasid` (which re-checks the pasid→vm mapping and verifies `vm->root.bo` still matches).
**Verdict: The patch is correct and should be safe to apply.** One minor concern noted below about a missing `Cc: stable` tag.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-22 23:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-20 12:14 [PATCH v2] drm/amdgpu: fix root reservation in amdgpu_vm_handle_fault Pierre-Eric Pelloux-Prayer
2026-04-20 12:29 ` Christian König
2026-04-22 23:58 ` Claude Code Review Bot [this message]
2026-04-22 23:58 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-overall-20260420121438.1612-1-pierre-eric.pelloux-prayer@amd.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox