Re: [PATCH v2] drm/imagination: re-check firmware idle state before runtime suspend
From: Gyeyoung Baek
Date: Sat Nov 21 2026 - 12:58:03 EST
Hi Baihui,
On Wed, Nov 11, 2026 at 6:29 PM Baihui Liang
<liangbaihui@xxxxxxxxxxxxxxxxxx> wrote:
>
> pvr_power_device_idle() rejects runtime suspend while the firmware
> hasn't reached ROGUE_FWIF_POW_IDLE. The PM core doesn't reschedule
> idle notification after rejection, so no further pm_runtime_put()
> arrives on an idle GPU and the device stays powered indefinitely.
>
> Move the idle check into pvr_power_device_suspend() and return -EBUSY
> after pm_runtime_mark_last_busy() so the PM core reschedules the
> autosuspend timer and retries until the firmware is idle.
My understanding of Sashiko's point (correct me if I'm wrong):
- pvr_remove(): must power off unconditionally
- runtime suspend: power off only once idle (-EBUSY otherwise)
Since remove goes through the suspend callback, it can now skip the
power-off on -EBUSY.
Moving the idle check into runtime suspend looks right to me, so how
about keeping just the power-off logic in a common helper, called by
runtime suspend after the idle check and by remove directly? Roughly:
pvr_power_device_off() /* fw_disable + power_off */
pvr_remove()
pm_runtime_disable();
if (!pm_runtime_status_suspended()) {
pvr_power_device_off();
pm_runtime_set_suspended();
}
pm_runtime_enable(); /* balance devm_pm_runtime_enable() */
--
Thanks,
Gyeyoung