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: replace PASID IDR with XArray Date: Wed, 01 Apr 2026 07:43:13 +1000 Message-ID: In-Reply-To: <20260331142127.52796-1-mikhail.v.gavrilov@gmail.com> References: <20260331142127.52796-1-mikhail.v.gavrilov@gmail.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: replace PASID IDR with XArray Author: Mikhail Gavrilov Patches: 4 Reviewed: 2026-04-01T07:43:13.815301 --- This is a single patch (v7) replacing the PASID IDR with XArray. The conver= sion is well-motivated =E2=80=94 it addresses a real IRQ safety issue in `a= mdgpu_pasid_free()` which can be called from hardirq context. The code is c= lean and the approach is correct in principle. However, **the patch has a c= ritical bug: it uses the wrong XArray API functions**. The commit message claims that `XA_FLAGS_LOCK_IRQ` makes "all xa operations= use IRQ-safe locking internally", but this is **incorrect**. The `XA_FLAGS= _LOCK_IRQ` flag only affects the lock type stored in the xarray (so that `x= a_lock()`/`xa_unlock()` resolve to the right primitive internally), but the= convenience wrappers `xa_alloc_cyclic()` and `xa_erase()` use plain `xa_lo= ck()`/`xa_unlock()` =E2=80=94 **not** `xa_lock_irq()`/`xa_unlock_irq()`. Th= e IRQ-safe convenience wrappers are separate functions: `xa_alloc_cyclic_ir= q()` and `xa_erase_irq()`. This means the patch **does not actually fix the IRQ safety issue** it clai= ms to fix. `amdgpu_pasid_free()` calling `xa_erase()` from hardirq context = is still unsafe, exactly as the original `spin_lock()` was. --- Generated by Claude Code Patch Reviewer