public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/adreno: fix userspace-triggered crash on a2xx-a4xx
Date: Sun, 12 Apr 2026 08:59:46 +1000	[thread overview]
Message-ID: <review-patch1-20260411-adreno-fix-ubwc-v3-1-4983156f3f80@oss.qualcomm.com> (raw)
In-Reply-To: <20260411-adreno-fix-ubwc-v3-1-4983156f3f80@oss.qualcomm.com>

Patch Review

**Problem analysis:** Confirmed correct. The kernel source tree shows:
- `a5xx_gpu.c` sets `adreno_gpu->ubwc_config = &adreno_gpu->_ubwc_config` (line 1778)
- `a6xx_gpu.c` sets `gpu->ubwc_config = &gpu->_ubwc_config` (line 807)
- `a2xx_gpu.c`, `a3xx_gpu.c`, `a4xx_gpu.c` never touch `ubwc_config` — the pointer remains NULL from `kzalloc`

Since `MSM_PARAM_HIGHEST_BANK_BIT` (0x10), `MSM_PARAM_UBWC_SWIZZLE` (0x12), and `MSM_PARAM_MACROTILE_MODE` (0x13) are all UAPI params, any userspace program can query them and trigger the NULL dereference on pre-a5xx hardware.

**Code review:**

The three guard clauses are identical in structure and correct:

```c
case MSM_PARAM_HIGHEST_BANK_BIT:
	if (!adreno_gpu->ubwc_config)
		return UERR(ENOENT, drm, "no UBWC on this platform");
	*value = adreno_gpu->ubwc_config->highest_bank_bit;
	return 0;
```

- The `UERR(ENOENT, ...)` macro expands to `DRM_DEV_DEBUG_DRIVER(...)` followed by returning `-ENOENT`. This is appropriate — `ENOENT` signals "this parameter doesn't exist on this hardware" which is semantically correct and matches the review feedback.
- The debug message is helpful for userspace developers without being noisy (it's `DEBUG_DRIVER` level, not a warning).
- All three UBWC-related params are covered: `HIGHEST_BANK_BIT`, `UBWC_SWIZZLE`, and `MACROTILE_MODE`. No UBWC-related params are missed.

**No issues found.** The patch is minimal, correct, has proper `Fixes:` tag, and addresses the review feedback from v1/v2. 

Reviewed-by worthy.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-04-11 22:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-11 14:59 [PATCH v3] drm/msm/adreno: fix userspace-triggered crash on a2xx-a4xx Dmitry Baryshkov
2026-04-11 15:22 ` Rob Clark
2026-04-11 22:59 ` Claude review: " Claude Code Review Bot
2026-04-11 22:59 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-07  3:23 [PATCH v2] " Dmitry Baryshkov
2026-04-12  4:10 ` Claude review: " Claude Code Review Bot
2026-04-12  4:10 ` Claude Code Review Bot
2026-04-06 22:14 [PATCH] " Dmitry Baryshkov
2026-04-12  4:17 ` Claude review: " Claude Code Review Bot
2026-04-12  4:17 ` 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-patch1-20260411-adreno-fix-ubwc-v3-1-4983156f3f80@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