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 v3 3/5] drm/nouveau/gsp/r570: Add comp mode workaround from issue #3172217
Date: Wed, 16 Sep 2026 00:34:03 +0000	[thread overview]
Message-ID: <20260916003404.732E61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916001603.22394-4-lyude@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/nouveau/gsp: wrong RM object in r570_memsys_enable_raw_comp_mode()
--

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

drm/nouveau/gsp/r570: Add comp mode workaround from issue #3172217

This commit adds a workaround to temporarily disable raw compression mode
on the GPU before initiating FBSR during suspend, and re-enable it during
resume. This addresses an issue on Ampere and Ada GPUs where restore
operations could otherwise corrupt compressed surfaces.

> 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 af5aa5065c3dd..fe618a94461dc 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
[ ... ]
> @@ -26,6 +26,35 @@ r570_fbsr_suspend_channels(struct nvkm_gsp *gsp, bool suspend)
>  	return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl);
>  }
>  
> +static int
> +r570_memsys_enable_raw_comp_mode(struct nvkm_gsp *gsp, bool enable)
> +{
> +	NV2080_CTRL_INTERNAL_MEMSYS_PROGRAM_RAW_COMPRESSION_MODE_PARAMS *ctrl;
> +	int ret;
> +
> +	ctrl = nvkm_gsp_rm_ctrl_get(&gsp->internal.device.object,
> +				    NV2080_CTRL_CMD_INTERNAL_MEMSYS_PROGRAM_RAW_COMPRESSION_MODE,
> +				    sizeof(*ctrl));

[Severity: High]
Should this use &gsp->internal.device.subdevice instead of .object?

The command being allocated is an 0x2080 Subdevice command
(NV2080_CTRL_CMD_INTERNAL_MEMSYS_PROGRAM_RAW_COMPRESSION_MODE). If this is
requested against the Device object instead of the Subdevice object, the GSP RM
will reject the control command with an error because the target object does
not match the command's expected class.

> +	if (IS_ERR(ctrl))
> +		return PTR_ERR(ctrl);
> +
> +	ctrl->bRawMode = enable;
> +
> +	ret = nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.object, ctrl);

[Severity: High]
Similarly, should this write be issued to the subdevice? 

Since r570_fbsr_suspend() propagates the return value of this function on GA100
and AD100 GPUs, an RM validation failure resulting from the class mismatch will
abort the suspend sequence entirely.

> +	if (!ret)
> +		nvkm_debug(&gsp->subdev, "memsys: Raw compression mode %s\n",
> +			   str_enabled_disabled(enable));
> +
> +	return ret;
> +}

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

  reply	other threads:[~2026-09-16  0:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  0:09 [PATCH v3 0/5] drm/nouveau/gsp/r570: Follow OpenRM's runtime PM process more closely Lyude Paul
2026-09-16  0:09 ` Lyude Paul
2026-09-16  0:09 ` [PATCH v3 1/5] drm/nouveau/gsp/r535: Add support for INTERNAL_GCX_ENTRY_PREREQUISITE Lyude Paul
2026-09-16  0:09   ` Lyude Paul
2026-09-16  0:40   ` sashiko-bot
2026-09-16  0:42   ` David Airlie
2026-09-16  0:42     ` David Airlie
2026-09-16 21:13     ` lyude
2026-09-16 21:13       ` lyude
2026-09-16  0:09 ` [PATCH v3 2/5] drm/nouveau/gsp/r535: Add support for MEMSYS_GET_STATIC_CONFIG Lyude Paul
2026-09-16  0:09   ` Lyude Paul
2026-09-16  0:35   ` sashiko-bot
2026-09-16  0:44   ` David Airlie
2026-09-16  0:44     ` David Airlie
2026-09-16  0:09 ` [PATCH v3 3/5] drm/nouveau/gsp/r570: Add comp mode workaround from issue #3172217 Lyude Paul
2026-09-16  0:09   ` Lyude Paul
2026-09-16  0:34   ` sashiko-bot [this message]
2026-09-16  0:09 ` [PATCH v3 4/5] drm/nouveau/gsp/r570: Start saving comptag backing stores Lyude Paul
2026-09-16  0:09   ` Lyude Paul
2026-09-16  0:09 ` [PATCH v3 5/5] drm/nouveau/gsp/r570: Enable Gcoff in fbsr again Lyude Paul
2026-09-16  0:09   ` Lyude Paul

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=20260916003404.732E61F000FF@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.