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/msm: Add PERFCNTR_CONFIG ioctl Date: Sat, 16 May 2026 10:50:07 +1000 Message-ID: In-Reply-To: <20260514134052.361771-1-robin.clark@oss.qualcomm.com> References: <20260514134052.361771-1-robin.clark@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: drm/msm: Add PERFCNTR_CONFIG ioctl Author: Rob Clark Patches: 17 Reviewed: 2026-05-16T10:50:07.754640 --- This is a well-structured 16-patch series by Rob Clark that adds a new `PERFCNTR_CONFIG` ioctl to the MSM/Adreno DRM driver, enabling both global GPU performance counter streaming (for system profilers, restricted to `perfmon_capable()`) and local per-context counter reservation (for UMD per-draw profiling). The series is at v6, has accumulated reviews from Dmitry Baryshkov and Anna Maniscalco, and shows a mature design that has evolved through multiple iterations addressing real issues (null pointer deref on older gens, FIFO size limits, loop counter fixes, IFPC support). **Strengths:** - Clean separation: removes old dead perf infrastructure first, then builds new subsystem incrementally - Sensible UABI design: fd-based stream lifetime, group-name-based counter identification, extensible via flags/stride - Thoughtful concurrency: global vs. local counter conflict detection, proper ordering of IFPC pwrup reglist updates, per-context reservation model - Good use of `__free(kfree)` cleanup guards in the ioctl path **Concerns (detailed per-patch below):** - A few locking/ordering issues in the ioctl error paths - The `msm_perfcntrs_stream_read()` does not handle wrap-around properly (only returns up to end of buffer) - The `regs[62]` -> `regs[]` flex array change in `cpu_gpu_lock` may need coordinated size validation - Minor UABI nit: `group_stride` could allow future extension but also allows reading less than the struct size Overall this is solid work from an experienced kernel developer. The issues I found are minor and the design is sound. With the few items below addressed, this looks ready. --- Generated by Claude Code Patch Reviewer