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: Tue, 05 May 2026 08:41:52 +1000 [thread overview]
Message-ID: <review-patch2-20260503163842.213489-3-clamor95@gmail.com> (raw)
In-Reply-To: <20260503163842.213489-3-clamor95@gmail.com>
Patch Review
**Assessment: Good, one typo and one observation.**
This patch does three things in both gr2d.c and gr3d.c:
1. Adds `pm_runtime_enable()`, `pm_runtime_use_autosuspend()`, `pm_runtime_set_autosuspend_delay()` to `gr*d_probe()`.
2. Removes the same three calls from `gr*d_runtime_resume()`.
3. Removes `pm_runtime_dont_use_autosuspend()` and `pm_runtime_force_suspend()` from `gr*d_exit()`.
This is the correct standard pattern. The current code has `pm_runtime_enable()` inside the runtime resume callback, which is architecturally circular — the PM core can only call the runtime resume callback if runtime PM is already enabled. On a second system suspend/resume cycle, `pm_runtime_enable()` gets called again with `disable_depth == 0`, triggering a kernel warning and PM state corruption.
**Typo in commit message:**
> The current power management configuration causes GR2G/GR3D to malfunction after resume.
`GR2G` should be `GR2D`.
**Observation — removal of `pm_runtime_force_suspend()` from `exit()`:**
The patch removes these lines from `gr2d_exit()` / `gr3d_exit()`:
```c
pm_runtime_dont_use_autosuspend(client->dev);
pm_runtime_force_suspend(client->dev);
```
This means during driver teardown, the hardware won't be explicitly suspended by `exit()`. The sequence becomes:
1. `remove()`: `pm_runtime_disable()` — disables PM tracking
2. `remove()`: `host1x_client_unregister()` → triggers `exit()` → frees channels/syncpts/IOMMU
3. devm cleanup releases clocks and resets
Since `pm_runtime_disable()` is called before `exit()`, and `gr*d_runtime_suspend()` won't be invoked (PM is disabled), the channel won't be explicitly stopped via `host1x_channel_stop()` that normally runs in `gr*d_runtime_suspend()`. The clocks and resets are devm-managed so they'll be cleaned up automatically, but skipping `host1x_channel_stop()` during teardown is a behavioral change worth being aware of. In practice this is likely fine since all users have been torn down by this point, but it's worth confirming with the Tegra maintainers.
**Error path:** `pm_runtime_enable()` is placed as the last operation before `return 0` in both probe functions, so there's no failure path that needs a corresponding `pm_runtime_disable()` — this is correct.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-04 22:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 16:38 [PATCH v2 0/2] drm/tegra: gr2d/gr3d: Move pm_runtime_enable to gr*d_probe Svyatoslav Ryhel
2026-05-03 16:38 ` [PATCH v2 1/2] drm/tegra: gr2d/gr3d: Initialize address register map before HOST1X client is registered Svyatoslav Ryhel
2026-05-04 22:41 ` Claude review: " Claude Code Review Bot
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-03 18:36 ` Svyatoslav Ryhel
2026-05-04 22:41 ` Claude Code Review Bot [this message]
2026-05-04 22:41 ` Claude review: drm/tegra: gr2d/gr3d: Move pm_runtime_enable to gr*d_probe 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-20260503163842.213489-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