From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/panfrost: Add bus_ace optional clock support for RZ/G2L Date: Thu, 05 Mar 2026 13:22:27 +1000 Message-ID: In-Reply-To: <20260304134845.267030-4-biju.das.jz@bp.renesas.com> References: <20260304134845.267030-1-biju.das.jz@bp.renesas.com> <20260304134845.267030-4-biju.das.jz@bp.renesas.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This patch adds a `bus_ace_clock` optional clock, wiring it into init, fini, and runtime suspend/resume. **Bug: Duplicate `err = PTR_ERR(...)` assignment.** In `panfrost_clk_init()`: ```c + if (IS_ERR(pfdev->bus_ace_clock)) { + err = PTR_ERR(pfdev->bus_ace_clock); + dev_err(pfdev->base.dev, "get bus_ace_clock failed %ld\n", + PTR_ERR(pfdev->bus_ace_clock)); + err = PTR_ERR(pfdev->bus_ace_clock); + goto disable_bus_clock; + } ``` The `err = PTR_ERR(pfdev->bus_ace_clock)` is assigned twice (lines before and after the `dev_err`). This is harmless but clearly a copy-paste error. The first assignment should be removed (keeping it after `dev_err` for consistency with the existing `bus_clock` error block pattern), or the second one removed. **Inconsistency with bus_clock init pattern.** The existing `bus_clock` init code has a `if (pfdev->bus_clock)` guard around `clk_prepare_enable()` (line 64-71 in the applied code), which also prints the clock rate. The new `bus_ace_clock` code calls `clk_prepare_enable()` unconditionally (which is fine since the clk API handles NULL), but this creates an inconsistency within the same function. Consider either: (a) also removing the NULL guard from the `bus_clock` block for consistency, or (b) matching the existing pattern. This is minor since the API handles NULL, but consistency aids readability. **Runtime resume error path nesting.** The `clk_enable(pfdev->bus_ace_clock)` call and its error label `err_bus_ace_clk` are placed *inside* the `if (pfdev->comp->pm_features & BIT(GPU_PM_RT))` block, but the error label itself is *outside* the block: ```c if (pfdev->comp->pm_features & BIT(GPU_PM_RT)) { ... ret = clk_enable(pfdev->bus_ace_clock); if (ret) goto err_bus_ace_clk; } ... return 0; err_bus_ace_clk: if (pfdev->comp->pm_features & BIT(GPU_PM_RT)) clk_disable(pfdev->bus_clock); ``` This works because the goto only fires when `GPU_PM_RT` is set, and the error handlers re-check the flag. This matches the existing pattern for `err_bus_clk` and `err_clk`, so it's fine. --- Generated by Claude Code Patch Reviewer