Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Baihui Liang" <liangbaihui@linux.spacemit.com>
To: "Gyeyoung Baek" <gye976@gmail.com>
Cc: "alessio.belle" <alessio.belle@imgtec.com>,
	"luigi.santivetti" <luigi.santivetti@imgtec.com>,
	"maarten.lankhorst" <maarten.lankhorst@linux.intel.com>,
	"mripard" <mripard@kernel.org>,
	"tzimmermann" <tzimmermann@suse.de>,
	"airlied" <airlied@gmail.com>, "simona" <simona@ffwll.ch>,
	"dlan" <dlan@kernel.org>,
	"troy.mitchell" <troy.mitchell@linux.spacemit.com>,
	"pjw" <pjw@kernel.org>, "palmer" <palmer@dabbelt.com>,
	"aou" <aou@eecs.berkeley.edu>, "alex" <alex@ghiti.fr>,
	"imagination" <imagination@lists.freedesktop.org>,
	"dri-devel" <dri-devel@lists.freedesktop.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	"linux-riscv" <linux-riscv@lists.infradead.org>,
	"spacemit" <spacemit@lists.linux.dev>
Subject: Re: [PATCH v2] drm/imagination: re-check firmware idle state before runtime suspend
Date: Mon, 23 Nov 2026 18:08:54 +0800	[thread overview]
Message-ID: <DN2IAQ05SK22.2BFO0AZF4IAH6@linux.spacemit.com> (raw)
In-Reply-To: <CAKbEzntsUc4D3Nvxfphy5yApWG+sGsx7VF1cYd3SLSoZKhiteA@mail.gmail.com>

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@linux.spacemit.com> 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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2026-11-23 10:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  9:26 [PATCH v2] drm/imagination: re-check firmware idle state before runtime suspend Baihui Liang
2026-11-21 17:57 ` Gyeyoung Baek
2026-11-23 10:08   ` Baihui Liang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN2IAQ05SK22.2BFO0AZF4IAH6@linux.spacemit.com \
    --to=liangbaihui@linux.spacemit.com \
    --cc=airlied@gmail.com \
    --cc=alessio.belle@imgtec.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=dlan@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gye976@gmail.com \
    --cc=imagination@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=luigi.santivetti@imgtec.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=spacemit@lists.linux.dev \
    --cc=troy.mitchell@linux.spacemit.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox