From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove
Date: Mon, 18 May 2026 16:14:38 +1000 [thread overview]
Message-ID: <review-patch2-20260517091450.46728-3-clamor95@gmail.com> (raw)
In-Reply-To: <20260517091450.46728-3-clamor95@gmail.com>
Patch Review
**Assessment: Correct fix with minor observations.**
This patch makes two changes:
1. **Moves `pm_runtime_enable()`, `pm_runtime_use_autosuspend()`, and `pm_runtime_set_autosuspend_delay()` from `gr*d_runtime_resume()` into `gr*d_probe()`.** Having `pm_runtime_enable()` inside the runtime_resume callback was fundamentally wrong — the PM core needs runtime PM to be enabled *before* it can call the resume callback through normal runtime PM operations. Every resume would also redundantly re-configure autosuspend. Moving this to probe is correct.
2. **Removes `pm_runtime_dont_use_autosuspend()` and `pm_runtime_force_suspend()` from `gr*d_exit()`.** The exit callback no longer manages PM lifecycle; this is handled by `pm_runtime_disable()` in `gr*d_remove()`.
**Observations:**
- **Typo in commit message:** `"GR2G/GR3D"` should be `"GR2D/GR3D"`.
- **Ordering relative to other tegra drivers:** The patches place `pm_runtime_enable()` *before* `host1x_client_register()`, which is the safer ordering (avoids a race where userspace submits before PM is enabled). However, the sibling drivers `nvdec.c` and `vic.c` do the opposite — they call `host1x_client_register()` first, then `pm_runtime_enable()`. The new ordering in gr2d/gr3d is arguably more correct, but the inconsistency across the tegra driver family is worth being aware of.
- **Missing `pm_runtime_dont_use_autosuspend()` in remove:** The patch removes `pm_runtime_dont_use_autosuspend()` from `gr*d_exit()` but doesn't add it to `gr*d_remove()` before `pm_runtime_disable()`. The common pattern for drivers using autosuspend is to call `pm_runtime_dont_use_autosuspend()` then `pm_runtime_disable()` in the remove path, to cancel any pending autosuspend timer. In practice, `pm_runtime_disable()` handles cancellation internally, so this is not a bug — just a deviation from the typical pattern. The pre-existing `gr*d_remove()` also lacked it, so this is not a regression.
- **No explicit suspend on removal:** The original `gr*d_exit()` called `pm_runtime_force_suspend()` to ensure the hardware was powered down when the client was torn down. After this patch, if the device is runtime-active when `gr*d_remove()` is called, `pm_runtime_disable()` leaves it active — the clocks stay enabled until devm cleanup. This is acceptable for driver removal but is a minor change in teardown behavior worth noting.
- **Error path in probe:** The error path for `host1x_client_register()` failure correctly calls `pm_runtime_disable()`, which is good:
```c
err = host1x_client_register(&gr2d->client.base);
if (err < 0) {
pm_runtime_disable(dev);
...
}
```
Overall, this is a well-structured fix for a real resume regression. The minor items above are observations, not blockers.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-18 6:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 9:14 [PATCH v3 0/2] drm/tegra: gr2d/gr3d: Move pm_runtime_enable to gr*d_probe Svyatoslav Ryhel
2026-05-17 9:14 ` [PATCH v3 1/2] drm/tegra: gr2d/gr3d: Initialize address register map before HOST1X client is registered Svyatoslav Ryhel
2026-05-18 6:14 ` Claude review: " Claude Code Review Bot
2026-05-17 9:14 ` [PATCH v3 2/2] drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove Svyatoslav Ryhel
2026-05-18 6:14 ` Claude Code Review Bot [this message]
2026-05-18 6:14 ` Claude review: drm/tegra: gr2d/gr3d: Move pm_runtime_enable to gr*d_probe Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-05-03 16:38 [PATCH v2 0/2] " Svyatoslav Ryhel
2026-05-03 16:38 ` [PATCH v2 2/2] drm/tegra: gr2d/gr3d: Contain PM in the gr*d_probe/gr*d_remove Svyatoslav Ryhel
2026-05-04 22:41 ` 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-20260517091450.46728-3-clamor95@gmail.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