From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/a6xx: Allow IFPC with perfcntr stream
Date: Thu, 07 May 2026 13:19:07 +1000 [thread overview]
Message-ID: <review-patch16-20260506171127.133572-17-robin.clark@oss.qualcomm.com> (raw)
In-Reply-To: <20260506171127.133572-17-robin.clark@oss.qualcomm.com>
Patch Review
**Status: Looks good with observation**
Changes `sysprof_setup()` signature to take a `force_on` bool, then uses it in `sample_worker()` to briefly inhibit IFPC only while reading counters. This is a nice optimization: IFPC can stay active between samples, with SEL regs restored by the GMU via the pwrup reglist.
The approach of calling `sysprof_setup(gpu, true)` before reading and `sysprof_setup(gpu, false)` after is clean. The `msm_gpu_sysprof_no_ifpc()` is now decoupled from the perfcntr stream check, which is the correct semantic separation.
**Observation:** `sample_worker()` runs as kthread_work and calls `sysprof_setup()` which touches GMU registers. This should be safe since the GPU is powered (the timer/work are cancelled in suspend), but the function doesn't hold `gpu->lock`. If `sysprof_setup()` races with other GMU state changes, that could be problematic. In practice, the GMU IFPC disable/enable should be idempotent enough that this is okay, but worth verifying.
---
**Summary of key items for the author:**
1. **bufsz_shift validation** (patch 13) -- shift before bounds check is UB for large values
2. **group_stride overflow** (patch 13) -- `copy_from_user` with `args->group_stride > sizeof(g)` overflows stack
3. **msm_perfcntr_cleanup crash** (patch 10) -- called before `gpu->perfcntrs` is assigned in init error path
4. **No reglist bounds checking** (patch 15) -- pwrup reglist writes aren't bounds-checked
5. **Missing O_CLOEXEC** (patch 13) -- fd leak risk across exec
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-07 3:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 17:10 [PATCH v3 00/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-06 17:10 ` [PATCH v4 01/16] drm/msm: Remove obsolete perf infrastructure Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 02/16] drm/msm: Allow CAP_PERFMON for setting SYSPROF Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 04/16] drm/msm/registers: Sync gen_header.py from mesa Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 05/16] drm/msm/registers: Add perfcntr json Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 06/16] drm/msm: Add a6xx+ perfcntr tables Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 07/16] drm/msm: Add sysprof accessors Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 08/16] drm/msm/a6xx: Add yield & flush helper Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 09/16] drm/msm: Add per-context perfcntr state Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 10/16] drm/msm: Add basic perfcntr infrastructure Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 11/16] drm/msm/a6xx+: Add support to configure perfcntrs Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 12/16] drm/msm/a8xx: Add perfcntr flush sequence Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 13/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
2026-05-06 17:10 ` [PATCH v4 14/16] drm/msm/a6xx: Increase pwrup_reglist size Rob Clark
2026-05-07 3:19 ` Claude review: " Claude Code Review Bot
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-06 17:10 ` [PATCH v4 16/16] drm/msm/a6xx: Allow IFPC with perfcntr stream Rob Clark
2026-05-07 3:19 ` Claude Code Review Bot [this message]
2026-05-07 3:19 ` Claude review: drm/msm: Add PERFCNTR_CONFIG ioctl Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-14 13:39 [PATCH v6 00/16] " Rob Clark
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-11 12:59 [PATCH v5 00/16] drm/msm: Add PERFCNTR_CONFIG ioctl Rob Clark
2026-05-11 12:59 ` [PATCH v5 16/16] drm/msm/a6xx: Allow IFPC with perfcntr stream Rob Clark
2026-05-16 5:20 ` 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 16/16] drm/msm/a6xx: Allow IFPC with perfcntr stream 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-patch16-20260506171127.133572-17-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