From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: accel/amdxdna: Fix dead lock for suspend and resume Date: Wed, 11 Feb 2026 16:16:32 +1000 Message-ID: In-Reply-To: <20260210191626.311976-1-lizhi.hou@amd.com> References: <20260210191626.311976-1-lizhi.hou@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Overall Series Review Subject: accel/amdxdna: Fix dead lock for suspend and resume Author: Lizhi Hou Patches: 1 Reviewed: 2026-02-11T16:16:32.498103 --- This single-patch series addresses a **critical deadlock** in the amdxdna accelerator driver that occurs during power management operations. The deadlock scenario is: 1. IOCTL path: holds `dev_lock` → calls `pm_runtime_resume_and_get()` → waits for suspend to complete 2. Suspend path: tries to acquire `dev_lock` → blocks waiting for IOCTL to release it **Deadlock: ABBA lock ordering problem** (dev_lock vs PM subsystem internal locks) The fix introduces `amdxdna_pm_resume_get_locked()` helper that temporarily drops `dev_lock` before calling into PM runtime, then reacquires it. The suspend/resume callbacks now also explicitly take `dev_lock`. **Concerns:** - **Race conditions**: Dropping and reacquiring locks creates windows where device state could change - **Inconsistent locking**: Not all PM callsites converted (only some use `_locked` variant) - **Unprotected hardware access**: Code between unlock/lock may execute with device in inconsistent state - **Missing validation**: After reacquiring lock, no checks if device state changed - **SRCU removal**: Unrelated cleanup removing SRCU protection without justification **Severity: HIGH** - This fixes a deadlock but introduces potential race conditions that could cause use-after-free or hardware corruption. --- --- Generated by Claude Code Patch Reviewer