public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/msm/a6xx: Limit GXPD votes to recovery in A8x
Date: Tue, 28 Apr 2026 15:05:24 +1000	[thread overview]
Message-ID: <review-patch6-20260427-gfx-clk-fixes-v2-6-797e54b3d464@oss.qualcomm.com> (raw)
In-Reply-To: <20260427-gfx-clk-fixes-v2-6-797e54b3d464@oss.qualcomm.com>

Patch Review

**Author:** Akhil P Oommen

This is the largest and most complex patch. It introduces `a6xx_gmu_gxpd_get()` and `a6xx_gmu_gxpd_put()` helpers that behave differently for A8x vs older generations.

**`a6xx_gmu_gxpd_get()`:**
```c
+	if (adreno_gpu->info->family >= ADRENO_8XX_GEN1)
+		return 0;
+	return pm_runtime_get_sync(gmu->gxpd);
```

For A8x, this is a no-op. For older gens, it does the existing `pm_runtime_get_sync()`.

**`a6xx_gmu_gxpd_put()`:**
```c
+	if (adreno_gpu->info->family < ADRENO_8XX_GEN1)
+		return pm_runtime_put_sync(gmu->gxpd);
+
+	if (adreno_gpu->funcs->gx_is_on(adreno_gpu)) {
+		pm_runtime_get_sync(gmu->gxpd);
+		dev_pm_genpd_synced_poweroff(gmu->gxpd);
+		pm_runtime_put_sync(gmu->gxpd);
+	}
```

For A8x during the "put" path, if GX is still on, it does a get/synced_poweroff/put sequence to force-collapse the GDSC.

**Issue 1 -- Asymmetric get/put for A8x:** On A8x, `gxpd_get()` is a no-op but `gxpd_put()` may do `pm_runtime_get_sync() + pm_runtime_put_sync()`. This is fine from a refcount perspective since the get/put pair is balanced within `gxpd_put()` itself, but the naming is misleading. The function isn't really a "put" for A8x -- it's "force-collapse GX if it's still on". Consider a comment or renaming.

**Issue 2 -- Error path in `a6xx_gmu_resume()`:** The error path at `rpm_put:` now calls:
```c
+	a6xx_gmu_gxpd_put(gmu);
```
For A8x, if GX happens to be on during this error path, `gxpd_put()` will do a `pm_runtime_get_sync()` + `dev_pm_genpd_synced_poweroff()` + `pm_runtime_put_sync()`. This seems overly aggressive for a probe/resume error path. In the original code, this error path called `pm_runtime_put(gmu->gxpd)` which just dropped the refcount obtained earlier. Since `gxpd_get()` is now a no-op on A8x, the error path should also be a no-op -- the force-collapse logic is only appropriate for the `a6xx_gmu_stop()` shutdown path. This could cause unexpected behavior on the error path.

**Issue 3 -- Return value of `a6xx_gmu_gxpd_get()`:** On pre-A8x, `pm_runtime_get_sync()` can return a positive value on success or a negative error. The existing code at the call site in `a6xx_gmu_resume()` doesn't check the return value (it didn't before either), so this is a pre-existing issue, not introduced by this patch.

**Issue 4 -- Removed blank line:** There's a removed blank line between the end of `gdsc_gx_do_nothing_enable` export and the new functions:
```c
 }
 EXPORT_SYMBOL_GPL(gdsc_gx_do_nothing_enable);
+
+static int a6xx_gmu_gxpd_get(...)
```
Wait, that's in gdsc.c (patch 1). In patch 6, there's also a stray blank line removal:
```c
-
 
 int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
```
This looks like an extra blank line was removed, which is fine.

**Issue 5 -- Stop path change:** In `a6xx_gmu_stop()`, the original code had:
```c
	if (!IS_ERR_OR_NULL(gmu->gxpd))
		pm_runtime_put_sync(gmu->gxpd);
```
The new `a6xx_gmu_gxpd_put()` already checks `IS_ERR_OR_NULL(gmu->gxpd)`, so this is functionally equivalent for pre-A8x. For A8x, the stop path now does the force-collapse dance, which is the intended behavior during recovery (since `a6xx_gmu_stop()` is called from the recovery path when `gmu->hung` is true).

Overall the design intent is sound, but the error-path behavior in resume deserves closer attention to ensure `gxpd_put()` on A8x doesn't do the force-collapse when it shouldn't.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-04-28  5:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  6:38 [PATCH v2 0/6] qcom: Refactor GPU GX GDSC handling and IFPC behavior on A8x GPUs Taniya Das
2026-04-27  6:38 ` [PATCH v2 1/6] clk: qcom: gdsc: Add custom disable callback for GX GDSC Taniya Das
2026-04-27 13:13   ` Konrad Dybcio
2026-04-28  5:05   ` Claude review: " Claude Code Review Bot
2026-04-27  6:38 ` [PATCH v2 2/6] clk: qcom: gxclkctl: Use custom disable callback for gx_gdsc Taniya Das
2026-04-28  5:05   ` Claude review: " Claude Code Review Bot
2026-04-27  6:38 ` [PATCH v2 3/6] clk: qcom: common: ensure runtime PM suspend completes on probe Taniya Das
2026-04-27 13:17   ` Konrad Dybcio
2026-04-28  5:05   ` Claude review: " Claude Code Review Bot
2026-04-27  6:38 ` [PATCH v2 4/6] clk: qcom: gxclkctl: Remove GX/GMxC rail votes to align with IFPC Taniya Das
2026-04-27 13:14   ` Konrad Dybcio
2026-04-28  5:05   ` Claude review: " Claude Code Review Bot
2026-04-27  6:38 ` [PATCH v2 5/6] drm/msm/a8xx: Make a8xx_recover IFPC safe Taniya Das
2026-04-28  5:05   ` Claude review: " Claude Code Review Bot
2026-04-27  6:39 ` [PATCH v2 6/6] drm/msm/a6xx: Limit GXPD votes to recovery in A8x Taniya Das
2026-04-27 13:17   ` Konrad Dybcio
2026-04-28  5:05   ` Claude Code Review Bot [this message]
2026-04-28  5:05 ` Claude review: qcom: Refactor GPU GX GDSC handling and IFPC behavior on A8x GPUs Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-04-07  9:30 [PATCH 0/6] " Taniya Das
2026-04-07  9:30 ` [PATCH 6/6] drm/msm/a6xx: Limit GXPD votes to recovery in A8x Taniya Das
2026-04-12  3:46   ` 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-patch6-20260427-gfx-clk-fixes-v2-6-797e54b3d464@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