mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu.dudau@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: Karunika Choo <karunika.choo@arm.com>,
	nd@arm.com, Steven Price <steven.price@arm.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/panthor: Simplify FW fast reset path
Date: Tue, 19 Nov 2024 16:41:14 +0000	[thread overview]
Message-ID: <Zzy_qhXTZZrPwhHk@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <20241119152525.6579b438@collabora.com>

On Tue, Nov 19, 2024 at 03:25:25PM +0100, Boris Brezillon wrote:
> On Tue, 19 Nov 2024 13:50:29 +0000
> Karunika Choo <karunika.choo@arm.com> wrote:
> 
> > Stop checking the FW halt_status as MCU_STATUS should be sufficient.
> > This should make the check for successful FW halt and subsequently
> > setting fast_reset to true more robust.
> > 
> > We should also clear GLB_REQ.GLB_HALT bit only on post-reset prior
> > to starting the FW and only if we're doing a fast reset, because
> > the slow reset will re-initialize all FW sections, including the
> > global interface.
> > 
> > Signed-off-by: Karunika Choo <karunika.choo@arm.com>
> 
> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
> 
> and I think you forgot to add Liviu's R-b

I've fixed the commit and pushed it without compile testing it because I did
it for the patch before it. Obviously it doesn't compile because glb_iface is
not defined :(

Adding a new patch, can you guys R-b this?

diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
index 4bc52b1b1a286..c807b6ce71bd4 100644
--- a/drivers/gpu/drm/panthor/panthor_fw.c
+++ b/drivers/gpu/drm/panthor/panthor_fw.c
@@ -1133,6 +1133,7 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
                 * This is not needed on a slow reset because FW sections are
                 * re-initialized.
                 */
+               struct panthor_fw_global_iface *glb_iface = panthor_fw_get_glb_iface(ptdev);
                panthor_fw_update_reqs(glb_iface, req, 0, GLB_HALT);
 
                ret = panthor_fw_start(ptdev);


Best regards,
Liviu

> 
> > ---
> > v2:
> > - clarify comments and commit message with regards to when to clear the
> >   GLB_HALT flag.
> > 
> >  drivers/gpu/drm/panthor/panthor_fw.c | 15 ++++++++-------
> >  1 file changed, 8 insertions(+), 7 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/panthor/panthor_fw.c b/drivers/gpu/drm/panthor/panthor_fw.c
> > index ecca5565ce41..4bc52b1b1a28 100644
> > --- a/drivers/gpu/drm/panthor/panthor_fw.c
> > +++ b/drivers/gpu/drm/panthor/panthor_fw.c
> > @@ -1098,17 +1098,11 @@ void panthor_fw_pre_reset(struct panthor_device *ptdev, bool on_hang)
> >  		panthor_fw_update_reqs(glb_iface, req, GLB_HALT, GLB_HALT);
> >  		gpu_write(ptdev, CSF_DOORBELL(CSF_GLB_DOORBELL_ID), 1);
> >  		if (!readl_poll_timeout(ptdev->iomem + MCU_STATUS, status,
> > -					status == MCU_STATUS_HALT, 10, 100000) &&
> > -		    glb_iface->output->halt_status == PANTHOR_FW_HALT_OK) {
> > +					status == MCU_STATUS_HALT, 10, 100000)) {
> >  			ptdev->fw->fast_reset = true;
> >  		} else {
> >  			drm_warn(&ptdev->base, "Failed to cleanly suspend MCU");
> >  		}
> > -
> > -		/* The FW detects 0 -> 1 transitions. Make sure we reset
> > -		 * the HALT bit before the FW is rebooted.
> > -		 */
> > -		panthor_fw_update_reqs(glb_iface, req, 0, GLB_HALT);
> >  	}
> >  
> >  	panthor_job_irq_suspend(&ptdev->fw->irq);
> > @@ -1134,6 +1128,13 @@ int panthor_fw_post_reset(struct panthor_device *ptdev)
> >  	 * the FW sections. If it fails, go for a full reset.
> >  	 */
> >  	if (ptdev->fw->fast_reset) {
> > +		/* The FW detects 0 -> 1 transitions. Make sure we reset
> > +		 * the HALT bit before the FW is rebooted.
> > +		 * This is not needed on a slow reset because FW sections are
> > +		 * re-initialized.
> > +		 */
> > +		panthor_fw_update_reqs(glb_iface, req, 0, GLB_HALT);
> > +
> >  		ret = panthor_fw_start(ptdev);
> >  		if (!ret)
> >  			goto out;
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

      reply	other threads:[~2024-11-19 16:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-19 13:50 Karunika Choo
2024-11-19 14:25 ` Boris Brezillon
2024-11-19 16:41   ` Liviu Dudau [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=Zzy_qhXTZZrPwhHk@e110455-lin.cambridge.arm.com \
    --to=liviu.dudau@arm.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=karunika.choo@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nd@arm.com \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.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

all inboxes | Powered by JetHome®