From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/a6xx: Append SEL regs to dyn pwrup reglist
Date: Sat, 16 May 2026 10:50:11 +1000 [thread overview]
Message-ID: <review-patch15-20260514134052.361771-16-robin.clark@oss.qualcomm.com> (raw)
In-Reply-To: <20260514134052.361771-16-robin.clark@oss.qualcomm.com>
Patch Review
This is the key patch for IFPC support - it appends SEL register values to the dynamic pwrup reglist so they're restored on IFPC exit.
**`cpu_gpu_lock::regs[62]` -> `regs[]` flex array change.** This is a structural change to a shared-memory structure between CPU and GPU firmware (SQE). The `regs[62]` was presumably sized to fit within a page with the header. Changing to flex array is fine for the C side since the allocation is already `PAGE_SIZE` (now `2 * PAGE_SIZE`), but the firmware side needs to agree on the maximum size. The doubling of `pwrup_reglist` allocation in patch 14 provides the space. This should be safe as long as SQE reads `dynamic_list_len` to determine how many entries to process (which it does).
**Memory barrier usage is correct.** The code properly uses `wmb()` between writing the SEL entries and updating `dynamic_list_len`, and separately between clearing `dynamic_list_len` and writing new entries. The comment about the race with SQE on IFPC exit is well-reasoned.
**Issue: No bounds checking on reglist writes.** The `perfcntr_select()` function writes to `*reglist` without checking that it stays within the `2 * PAGE_SIZE` allocation. In practice, the number of counters should be well within bounds, but a defensive check would be prudent. The comment in patch 14 mentions ~190 counters on gen8 with the old PAGE_SIZE. With 2 pages (8192 bytes minus header), and each entry being 3 * 4 = 12 bytes, that's ~680 entries, which should be more than enough. But a `WARN_ON_ONCE` if approaching the limit would be useful.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 0:50 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 13:39 [PATCH v6 00/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-14 13:39 ` [PATCH v6 01/16] drm/msm: Remove obsolete perf infrastructure Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 02/16] drm/msm: Allow CAP_PERFMON for setting SYSPROF Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 03/16] drm/msm/adreno: Sync registers from mesa Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 04/16] drm/msm/registers: Sync gen_header.py " Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 05/16] drm/msm/registers: Add perfcntr json Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 06/16] drm/msm: Add a6xx+ perfcntr tables Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 07/16] drm/msm: Add sysprof accessors Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 08/16] drm/msm/a6xx: Add yield & flush helper Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 09/16] drm/msm: Add per-context perfcntr state Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 10/16] drm/msm: Add basic perfcntr infrastructure Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:39 ` [PATCH v6 11/16] drm/msm/a6xx+: Add support to configure perfcntrs Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:40 ` [PATCH v6 12/16] drm/msm/a8xx: Add perfcntr flush sequence Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:40 ` [PATCH v6 13/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:40 ` [PATCH v6 14/16] drm/msm/a6xx: Increase pwrup_reglist size Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-14 13:40 ` [PATCH v6 15/16] drm/msm/a6xx: Append SEL regs to dyn pwrup reglist Rob Clark
2026-05-16 0:50 ` Claude Code Review Bot [this message]
2026-05-14 13:40 ` [PATCH v6 16/16] drm/msm/a6xx: Allow IFPC with perfcntr stream Rob Clark
2026-05-16 0:50 ` Claude review: " Claude Code Review Bot
2026-05-16 0:50 ` Claude review: drm/msm: Add PERFCNTR_CONFIG ioctl Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-11 12:59 [PATCH v5 00/16] " Rob Clark
2026-05-11 12:59 ` [PATCH v5 15/16] drm/msm/a6xx: Append SEL regs to dyn pwrup reglist Rob Clark
2026-05-16 5:20 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 [PATCH v3 00/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-06 17:10 ` [PATCH v4 15/16] drm/msm/a6xx: Append SEL regs to dyn pwrup reglist Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-04 19:06 [PATCH v3 00/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-04 19:06 ` [PATCH v3 15/16] drm/msm/a6xx: Append SEL regs to dyn pwrup reglist Rob Clark
2026-05-04 22:06 ` Claude review: " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch15-20260514134052.361771-16-robin.clark@oss.qualcomm.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox