From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: Re: [PATCH v2 6/7] drm/panfrost: Fix PM usage_count mishandling Date: Fri, 05 Jun 2026 06:16:25 +1000 Message-ID: In-Reply-To: <20260604175050.A09181F00893@smtp.kernel.org> References: <20260604-claude-fixes-v2-0-57c6bd4c1655@collabora.com> <20260604175050.A09181F00893@smtp.kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Verdict: This is the key bug fix. Looks correct.** The fix adds `pm_runtime_get_noresume()` after `pm_runtime_enable()` to increment the usage count (since the device is already active), then adds `pm_runtime_put_autosuspend()` after `drm_dev_register()` to allow eventual autosuspend. ```c pm_runtime_set_active(pfdev->base.dev); pm_runtime_mark_last_busy(pfdev->base.dev); pm_runtime_enable(pfdev->base.dev); pm_runtime_get_noresume(pfdev->base.dev); // NEW: count=1, device stays active ... drm_dev_register(&pfdev->base, 0); ... pm_runtime_put_autosuspend(pfdev->base.dev); // NEW: count=0, autosuspend starts ``` The error path adds `pm_runtime_put_noidle` to balance the `get_noresume`. In `panfrost_remove`, the reordering is: ```c pm_runtime_get_sync(pfdev->base.dev); // count=1 panfrost_device_fini(pfdev); // teardown while device is active pm_runtime_put_noidle(pfdev->base.dev); // count=0 pm_runtime_disable(pfdev->base.dev); // disable PM ``` This is correct. Previously `pm_runtime_disable` was called before `panfrost_device_fini`, which could leave the device in an inconsistent state if the fini path needed PM. The new ordering ensures the device is powered on during teardown and the put is balanced before disable. The commit message clearly explains the symptoms (devfreq OPP notifications, first tiler heap job timeout) and root cause. --- --- Generated by Claude Code Patch Reviewer