From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/imagination: Access FW initialised state with READ/WRITE_ONCE
Date: Sat, 16 May 2026 14:11:26 +1000 [thread overview]
Message-ID: <review-patch4-20260512-b4-context_reset-v1-4-439bee96ed83@imgtec.com> (raw)
In-Reply-To: <20260512-b4-context_reset-v1-4-439bee96ed83@imgtec.com>
Patch Review
**Verdict: Reasonable, minor question**
Using `READ_ONCE`/`WRITE_ONCE` for `fw_dev->initialised` is appropriate since this bool is accessed from multiple contexts (IRQ handler, watchdog worker, suspend/resume, init/fini) without a common lock. This prevents compiler optimizations like repeated loads or store tearing.
The changes are straightforward and mechanical.
**Minor note:** `READ_ONCE`/`WRITE_ONCE` alone do not guarantee ordering with respect to the operations that the `initialised` flag guards. For example, in `pvr_fw_init()`:
```c
WRITE_ONCE(fw_dev->initialised, true);
```
There's no barrier ensuring that the FW initialization steps are visible to other CPUs before `initialised` becomes `true`. If ordering matters (i.e., if another CPU could check `initialised` and then access FW structures), a `smp_store_release()`/`smp_load_acquire()` pair would be more appropriate. The commit message says "ensure atomicity of operation" — but `READ_ONCE`/`WRITE_ONCE` don't provide atomicity guarantees in the hardware sense; they just prevent compiler issues. Worth clarifying the intent.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-16 4:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 6:47 [PATCH 0/4] drm/imagination: Multiple enhancement Brajesh Gupta
2026-05-12 6:47 ` [PATCH 1/4] drm/imagination: Populate FW common context ID before passing to the FW Brajesh Gupta
2026-05-16 4:11 ` Claude review: " Claude Code Review Bot
2026-05-12 6:47 ` [PATCH 2/4] drm/imagination: Don't timeout job if its fence has been signaled Brajesh Gupta
2026-05-16 4:11 ` Claude review: " Claude Code Review Bot
2026-05-12 6:47 ` [PATCH 3/4] drm/imagination: Rename FW booted to FW initialised Brajesh Gupta
2026-05-16 4:11 ` Claude review: " Claude Code Review Bot
2026-05-12 6:47 ` [PATCH 4/4] drm/imagination: Access FW initialised state with READ/WRITE_ONCE Brajesh Gupta
2026-05-16 4:11 ` Claude Code Review Bot [this message]
2026-05-16 4:11 ` Claude review: drm/imagination: Multiple enhancement 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-patch4-20260512-b4-context_reset-v1-4-439bee96ed83@imgtec.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