Re: [PATCH v2] drm/imagination: re-check firmware idle state before runtime suspend

From: Baihui Liang

Date: Mon Nov 23 2026 - 05:10:31 EST


On Sun Nov 22, 2026 at 1:57 AM CST, Gyeyoung Baek wrote:
> 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.

Exactly right.

> 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() */

Agreed — that's the shape I ended up with: a common power-off helper called from runtime suspend after the idle check, and from pvr_remove() with runtime PM disabled around it.

Thanks,
Baihui