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: Create common SMU interfaces for AIE2 and AIE4 Date: Tue, 31 Mar 2026 17:05:09 +1000 Message-ID: In-Reply-To: <20260330163705.3153647-6-lizhi.hou@amd.com> References: <20260330163705.3153647-1-lizhi.hou@amd.com> <20260330163705.3153647-6-lizhi.hou@amd.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review Moves SMU code from `aie2_smu.c` to `aie_smu.c` with a new `smu_device` abs= traction. **Issue 1 =E2=80=94 Non-angle-bracket include:** ```c +#include "drm/amdxdna_accel.h" ``` Should be `` (angle brackets for installed headers). **Issue 2 =E2=80=94 Unnecessary include:** ```c +#include ``` `aie_smu.c` doesn't use any gpu_scheduler APIs. This was carried over from = the old `aie2_smu.c`. **Issue 3 =E2=80=94 `aie2_smu_fini` wraps two operations but `aie_smu_fini`= only does one:** ```c // Old: void aie2_smu_fini(struct amdxdna_dev_hdl *ndev) { ndev->priv->hw_ops.set_dpm(ndev, 0); // Reset DPM first aie2_smu_exec(ndev, AIE2_SMU_POWER_OFF, ...); } // New wrapper in aie2_pci.c: static void aie2_smu_fini(struct amdxdna_dev_hdl *ndev) { ndev->priv->hw_ops.set_dpm(ndev, 0); aie_smu_fini(ndev->aie.smu_hdl); } ``` The DPM reset is kept in the wrapper. This is fine but means AIE4 callers m= ust remember to reset DPM themselves before calling `aie_smu_fini()` or the= power-off happens at whatever DPM level was active. The patch 6 AIE4 path = calls `aie_smu_fini()` directly without a DPM reset =E2=80=94 need to confi= rm this is intentional. **Issue 4 =E2=80=94 `npu1_set_dpm` moved to `npu1_regs.c`:** The `npu1_set_dpm` function was `extern` declared in `aie2_pci.h` but is no= w a `static` function in `npu1_regs.c`. However, `npu4_set_dpm` remains ext= ern. The header still has: ```c int npu4_set_dpm(struct amdxdna_dev_hdl *ndev, u32 dpm_level); ``` But `npu1_set_dpm` declaration is removed. This works because `npu1_set_dpm= ` is referenced only via function pointer in `npu1_regs.c`, but the asymmet= ry is confusing. --- Generated by Claude Code Patch Reviewer