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/sysfb: simpledrm: Use __clk_disable_unprepare_counts_only() Date: Thu, 28 May 2026 12:34:29 +1000 Message-ID: In-Reply-To: <20260527094811.116977-3-johannes.goede@oss.qualcomm.com> References: <20260527094811.116977-1-johannes.goede@oss.qualcomm.com> <20260527094811.116977-3-johannes.goede@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Normal teardown path =E2=80=94 correct:** The change in `simpledrm_device_release_clocks()` is the core fix and is co= rrect. When simpledrm is being replaced by the real display driver, clocks = should stay on: ```c for (i =3D 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 =E2=80=94 questionable:** The error cleanup in `simpledrm_device_init_clocks()` is also changed to co= unts-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_g= et()` / `clk_prepare_enable()` fails. In this scenario simpledrm never full= y initialized and will not be providing a framebuffer =E2=80=94 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 co= unts-only here means clocks that simpledrm actually turned on (if the firmw= are hadn't already) will be left running with zero refcount. Consider keeping `clk_disable_unprepare()` in the error path, since the "do= n't touch hardware during handoff" rationale doesn't apply when init is fai= ling. --- Generated by Claude Code Patch Reviewer