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/a6xx+: Add support to configure perfcntrs Date: Thu, 23 Apr 2026 09:13:16 +1000 Message-ID: In-Reply-To: <20260420222621.417276-12-robin.clark@oss.qualcomm.com> References: <20260420222621.417276-1-robin.clark@oss.qualcomm.com> <20260420222621.417276-12-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 Patch Review Adds `a6xx_perfcntr_configure()` to program SEL registers via the ringbuffer with proper pipe switching. **Critical Bug -- wrong loop variable**: At line 5605: ```c for (unsigned s = 0; i < ARRAY_SIZE(counter->slice_select_regs); s++) { ``` The condition checks `i` (the **outer** loop variable) but increments `s`. When `i < 2` (i.e., for the first two groups), this loop will never terminate -- `s` increments forever while `i` never changes. This will overflow `counter->slice_select_regs[s]` (array of 2), read garbage, and write arbitrary amounts into the ringbuffer, causing ringbuffer corruption and likely a GPU hang or worse. Fix: change `i` to `s`: ```c for (unsigned s = 0; s < ARRAY_SIZE(counter->slice_select_regs); s++) { ``` --- Generated by Claude Code Patch Reviewer