From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/v3d: Wait for pending L2T flush before cleaning caches
Date: Thu, 04 Jun 2026 15:23:15 +1000 [thread overview]
Message-ID: <review-patch1-20260530-v3d-fix-rpi4-freezes-v1-1-c2c8307da6ce@igalia.com> (raw)
In-Reply-To: <20260530-v3d-fix-rpi4-freezes-v1-1-c2c8307da6ce@igalia.com>
Patch Review
**Purpose:** On pre-V3D 7.1 hardware, `v3d_clean_caches()` writes to `V3D_CTL_L2TCACTL` without first checking if a prior L2T flush (`V3D_L2TCACTL_L2TFLS`) is still in flight. This can clobber bits in the register and cause cache inconsistencies.
**Code added in `v3d_gem.c:209-215`:**
```c
/* GFXH-1897: Ensure pending flushes complete before writing L2TCACTL */
if (v3d->ver < V3D_GEN_71) {
if (wait_for(!(V3D_CORE_READ(core, V3D_CTL_L2TCACTL) &
V3D_L2TCACTL_L2TFLS), 100)) {
drm_err(dev, "Timeout waiting for L2T clean\n");
}
}
```
**Analysis:**
- The GFXH-1897 workaround reference is good practice for hardware errata.
- The version guard (`v3d->ver < V3D_GEN_71`) is appropriate — the comment in `v3d_flush_l2t()` at line 179 already notes the L2TFLS busy-bit behavior, and this new wait ensures the previous flush has drained before a clean overwrites the register.
- The 100ms timeout is consistent with all other `wait_for` calls in this file.
- The placement before the `V3D_L2TCACTL_TMUWCF` write is correct — it protects the first write to L2TCACTL.
- The Fixes tag points to the original compute dispatch commit that introduced `v3d_clean_caches`, which is correct — this is a pre-existing bug independent of PM.
- The `Cc: stable@vger.kernel.org` is appropriate.
**Minor note:** The error message "Timeout waiting for L2T clean" could be confused with the identical message at line 231 (the later L2TFLS clean wait). Consider making this one distinct, e.g., "Timeout waiting for pending L2T flush" — but this is cosmetic and not blocking.
**Verdict: Looks correct.**
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-06-04 5:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 18:37 [PATCH 0/4] drm/v3d: Fix RPi 4 system hangs from stale cache and MMU state Maíra Canal
2026-05-30 18:37 ` [PATCH 1/4] drm/v3d: Wait for pending L2T flush before cleaning caches Maíra Canal
2026-06-04 5:23 ` Claude Code Review Bot [this message]
2026-05-30 18:37 ` [PATCH 2/4] drm/v3d: Flush MMU TLB and cache during runtime resume Maíra Canal
2026-06-04 5:23 ` Claude review: " Claude Code Review Bot
2026-05-30 18:37 ` [PATCH 3/4] drm/v3d: Clean caches before runtime suspend Maíra Canal
2026-06-04 5:23 ` Claude review: " Claude Code Review Bot
2026-05-30 18:37 ` [PATCH 4/4] drm/v3d: Reduce PM runtime autosuspend delay Maíra Canal
2026-06-04 5:23 ` Claude review: " Claude Code Review Bot
2026-06-04 5:23 ` Claude review: drm/v3d: Fix RPi 4 system hangs from stale cache and MMU state 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-20260530-v3d-fix-rpi4-freezes-v1-1-c2c8307da6ce@igalia.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