All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lyude Paul" <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/nouveau/gsp/r570: Never enter Gcoff state
Date: Thu, 25 Jun 2026 23:25:52 +0000	[thread overview]
Message-ID: <20260625232553.4FD591F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260625231252.89684-3-lyude@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Missing rollback of hardware state in suspend paths when operations fail, leaving the device hung.
--

commit ed5c98b04aafc61a13ebb42fe49a1f15121c1b4d
Author: Lyude Paul <lyude@redhat.com>

drm/nouveau/gsp/r570: Never enter Gcoff state

It turns out that the only reason our previous fixes looked like they
worked for this was because we would occasionally set the Gcoff state to 0
in the normal S3 path, which fixed suspend/resume on desktops - but not on
machines using runtime suspend.

The proper fix is to just never set this flag. Our current guess for the
reasoning behind this is that Gcoff likely coincides with GC6, and not
literally power off.

> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c
> index 2945d5b4e5707..af5aa5065c3dd 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c
> @@ -81,7 +81,7 @@ r570_fbsr_init(struct nvkm_gsp *gsp, struct sg_table *sgt, u64 size)
>  	ctrl->hClient = gsp->internal.client.object.handle;
>  	ctrl->hSysMem = memlist.handle;
>  	ctrl->sysmemAddrOfSuspendResumeData = gsp->sr.meta.addr;
> -	ctrl->bEnteringGcoffState = 1;
> +	ctrl->bEnteringGcoffState = 0;
>  
>  	ret = nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl);
>  	if (ret)

[Severity: High]
This is a pre-existing issue, but I have a question about the suspend path's
error handling.

If nvkm_gsp_rm_ctrl_wr() fails here, r570_fbsr_init() returns an error back to
r570_fbsr_suspend():

drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c:r570_fbsr_suspend() {
    ...
    r570_fbsr_suspend_channels(gsp, true);
    ...
    device->bar->bar2 = false;
    ...
    ret = r570_fbsr_init(gsp, &gsp->sr.fbsr, size);
    if (ret) {
        nvkm_gsp_sg_free(device, &gsp->sr.fbsr);
        return ret;
    }
}

The same error path exists earlier in r570_fbsr_suspend() if
nvkm_instobj_save() or nvkm_gsp_sg() fail.

Since the PM core doesn't call the resume callback for devices that fail to
suspend, does this leave the GPU hung with suspended channels and BAR2
disabled?

Would it make sense to restore the channel and BAR state on error paths
in r570_fbsr_suspend() before returning?

>  		return ret;
>  
>  	nvkm_gsp_rm_free(&memlist);
>  	return 0;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260625231252.89684-1-lyude@redhat.com?part=2

  reply	other threads:[~2026-06-25 23:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 23:10 [PATCH 0/2] drm/nouveau: Fix runtime suspend on R570 Lyude Paul
2026-06-25 23:10 ` Lyude Paul
2026-06-25 23:10 ` [PATCH 1/2] Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware" Lyude Paul
2026-06-25 23:10   ` Lyude Paul
2026-06-25 23:27   ` sashiko-bot
2026-06-26 12:31   ` Andy Shevchenko
2026-06-26 12:31     ` Andy Shevchenko
2026-06-25 23:10 ` [PATCH 2/2] drm/nouveau/gsp/r570: Never enter Gcoff state Lyude Paul
2026-06-25 23:10   ` Lyude Paul
2026-06-25 23:25   ` sashiko-bot [this message]
2026-06-26 12:32   ` Andy Shevchenko
2026-06-26 12:32     ` Andy Shevchenko

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=20260625232553.4FD591F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.