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 v2 1/4] Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware"
Date: Mon, 29 Jun 2026 22:56:29 +0000	[thread overview]
Message-ID: <20260629225630.33A791F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260629224350.2870201-2-lyude@redhat.com>

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

Pre-existing issues:
- [High] Failing to restore hardware state if `r570_fbsr_suspend` encounters an error midway through execution.
--

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

Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware"

This reverts commit 8302d0afeaec0bc57d951dd085e0cffe997d4d18. It turns out
this looked like the right fix on some systems, but it causes runtime PM to
actually fail on many laptops.

> 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 8ef8b4f655883..2945d5b4e5707 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
[ ... ]
> @@ -92,7 +92,7 @@ r570_fbsr_init(struct nvkm_gsp *gsp, struct sg_table *sgt, u64 size, bool runtim
>  }
>  
>  static int
> -r570_fbsr_suspend(struct nvkm_gsp *gsp, bool runtime)
> +r570_fbsr_suspend(struct nvkm_gsp *gsp)
>  {
>  	struct nvkm_subdev *subdev = &gsp->subdev;
>  	struct nvkm_device *device = subdev->device;

[Severity: High]
This is a pre-existing issue, but does r570_fbsr_suspend() need to
unwind hardware state changes if an error occurs?

Looking at the function body, hardware state is mutated upfront:

r570_fbsr_suspend() {
        ...
        /* Stop channel scheduling. */
        r570_fbsr_suspend_channels(gsp, true);

        /* Save BAR2 allocations to system memory. */
        list_for_each_entry(iobj, &imem->list, head) {
                if (iobj->preserve) {
                        ret = nvkm_instobj_save(iobj);
                        if (ret)
                                return ret;
                }
        }
        ...
        /* Disable BAR2 access. */
        device->bar->bar2 = false;
        ...
}

If a failure occurs (such as memory allocation failure in nvkm_instobj_save()
or later in nvkm_gsp_sg()), the function returns an error without reverting
these hardware changes.

The error propagates to nvkm_subdev_fini(), returning early without setting
subdev->use.enabled to false. During a suspend abort recovery,
nvkm_device_fini() attempts to restart failed devices via nvkm_subdev_init().

However, because use.enabled is still true, the restart is skipped, meaning
the device's init and resume callbacks are never executed.

Could this leave the GPU permanently unusable with suspended channels and
disabled BAR2 access if a failure happens during suspend?

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

  reply	other threads:[~2026-06-29 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29 22:42 [PATCH v2 0/4] drm/nouveau/gsp/r570: Fix runtime PM Lyude Paul
2026-06-29 22:42 ` Lyude Paul
2026-06-29 22:42 ` [PATCH v2 1/4] Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware" Lyude Paul
2026-06-29 22:42   ` Lyude Paul
2026-06-29 22:56   ` sashiko-bot [this message]
2026-06-30 11:53   ` Andy Shevchenko
2026-06-30 11:53     ` Andy Shevchenko
2026-06-30 16:05     ` Danilo Krummrich
2026-06-30 16:05       ` Danilo Krummrich
2026-07-01 18:16       ` lyude
2026-07-01 18:16         ` lyude
2026-06-29 22:42 ` [PATCH v2 2/4] drm/nouveau/gsp/r570: Never enter Gcoff state Lyude Paul
2026-06-29 22:42   ` Lyude Paul
2026-06-29 22:56   ` sashiko-bot
2026-06-29 22:42 ` [PATCH v2 3/4] drm/nouveau/gsp/r570: Set oldLevel correctly in GSP resume arguments Lyude Paul
2026-06-29 22:42   ` Lyude Paul
2026-06-29 22:42 ` [PATCH v2 4/4] drm/nouveau/gsp/r570: Add missing state flags to " Lyude Paul
2026-06-29 22:42   ` Lyude Paul
2026-06-30 11:50 ` [PATCH v2 0/4] drm/nouveau/gsp/r570: Fix runtime PM Andy Shevchenko
2026-06-30 11:50   ` Andy Shevchenko
2026-07-01 18:05   ` lyude
2026-07-01 18:05     ` lyude

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=20260629225630.33A791F000E9@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.