From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/sysfb: simpledrm: Use __clk_disable_unprepare_counts_only()
Date: Thu, 28 May 2026 12:34:29 +1000 [thread overview]
Message-ID: <review-patch2-20260527094811.116977-3-johannes.goede@oss.qualcomm.com> (raw)
In-Reply-To: <20260527094811.116977-3-johannes.goede@oss.qualcomm.com>
Patch Review
**Normal teardown path — correct:**
The change in `simpledrm_device_release_clocks()` is the core fix and is correct. When simpledrm is being replaced by the real display driver, clocks should stay on:
```c
for (i = 0; i < sdev->clk_count; ++i) {
if (sdev->clks[i]) {
__clk_disable_unprepare_counts_only(sdev->clks[i]);
clk_put(sdev->clks[i]);
}
}
```
**Error path during init — questionable:**
The error cleanup in `simpledrm_device_init_clocks()` is also changed to counts-only:
```c
while (i) {
--i;
if (sdev->clks[i]) {
__clk_disable_unprepare_counts_only(sdev->clks[i]);
clk_put(sdev->clks[i]);
}
}
```
This error path runs when `devm_add_action_or_reset()` or a later `of_clk_get()` / `clk_prepare_enable()` fails. In this scenario simpledrm never fully initialized and will not be providing a framebuffer — the clocks it enabled should arguably be properly disabled via `clk_disable_unprepare()`, since simpledrm is aborting, not handing off to a real driver. Using counts-only here means clocks that simpledrm actually turned on (if the firmware hadn't already) will be left running with zero refcount.
Consider keeping `clk_disable_unprepare()` in the error path, since the "don't touch hardware during handoff" rationale doesn't apply when init is failing.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-28 2:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 9:48 [PATCH 0/3] clk: Add __clk_disable_unprepare_counts_only() and use this in simple[fb|drm] Hans de Goede
2026-05-27 9:48 ` [PATCH 1/3] clk: Add __clk_disable_unprepare_counts_only() helper Hans de Goede
2026-05-28 2:34 ` Claude review: " Claude Code Review Bot
2026-05-27 9:48 ` [PATCH 2/3] drm/sysfb: simpledrm: Use __clk_disable_unprepare_counts_only() Hans de Goede
2026-05-28 2:34 ` Claude Code Review Bot [this message]
2026-05-27 9:48 ` [PATCH 3/3] fbdev: simplefb: " Hans de Goede
2026-05-28 2:34 ` Claude review: " Claude Code Review Bot
2026-05-27 12:04 ` [PATCH 0/3] clk: Add __clk_disable_unprepare_counts_only() and use this in simple[fb|drm] Maxime Ripard
2026-05-27 12:21 ` Hans de Goede
2026-05-27 12:48 ` Maxime Ripard
2026-05-27 15:09 ` Hans de Goede
2026-05-27 23:03 ` Brian Masney
2026-05-28 2:34 ` 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-patch2-20260527094811.116977-3-johannes.goede@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