From: sashiko-bot@kernel.org
To: "Dave Airlie" <airlied@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/6] nouveau/gsp: make libos init per-gsp version.
Date: Wed, 29 Jul 2026 04:32:44 +0000 [thread overview]
Message-ID: <20260729043244.F240A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260729041653.3985549-3-airlied@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [Medium] DMA buffers for GSP logging (`gsp->libos`) and boot firmware (`gsp->boot.fw`) are leaked on the initialization error path.
--
--- Patch [2]: [PATCH 2/6] nouveau/gsp: make libos init per-gsp version. ---
commit 85ebb9d2d6335df98fac564dbbe77909c7d38c2b
Author: Dave Airlie <airlied@redhat.com>
nouveau/gsp: make libos init per-gsp version.
This makes libos initialization a per-gsp version feature. It adds r570 as a
copy of r535 for now, with enhancements to r570 expected next.
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
> index 996941c668ba9..64011430f4c0a 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
[ ... ]
> @@ -205,8 +205,76 @@ r570_gsp_set_rmargs(struct nvkm_gsp *gsp, bool resume)
[ ... ]
> +/**
> + * r570_gsp_libos_init() -- create the libos arguments structure
> + * @gsp: gsp pointer
> + */
> +static int
> +r570_gsp_libos_init(struct nvkm_gsp *gsp)
> +{
> + LibosMemoryRegionInitArgument *args;
> + int ret;
> +
> + ret = nvkm_gsp_mem_ctor(gsp, 0x1000, &gsp->libos);
[Severity: Medium]
This is a pre-existing issue, but does this leak the gsp->libos and
gsp->boot.fw DMA buffers on the initialization error path?
If GSP initialization fails after libos_init is called but before postinit
executes (for example, if set_system_info or RPC registry configuration
fails), the initialization falls back to tearing down the subdevice via
r535_gsp_dtor().
While postinit frees these buffers on a successful boot, r535_gsp_dtor()
appears to skip freeing gsp->libos and gsp->boot.fw when cleaning up on
the error path.
> + if (ret)
> + return ret;
> +
> + args = gsp->libos.data;
> +
> + ret = gsp_fill_libos_entry(gsp, &args[0], 0x10000, &gsp->loginit, "LOGINIT");
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260729041653.3985549-1-airlied@gmail.com?part=2
next prev parent reply other threads:[~2026-07-29 4:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 4:15 nouveau/gsp: some r570 additions and refactoring Dave Airlie
2026-07-29 4:15 ` [PATCH 1/6] nouveau/gsp: refactor libos entry handling for r535 Dave Airlie
2026-07-29 4:15 ` [PATCH 2/6] nouveau/gsp: make libos init per-gsp version Dave Airlie
2026-07-29 4:32 ` sashiko-bot [this message]
2026-07-29 4:15 ` [PATCH 3/6] nouveau/gsp: add logging entries for r570 Dave Airlie
2026-07-29 4:33 ` sashiko-bot
2026-07-29 4:15 ` [PATCH 4/6] nouveau/gsp: refactor the chan allocation arguments into a struct Dave Airlie
2026-07-29 4:15 ` [PATCH 5/6] nouveau/gsp: add some more fields to r570 system info Dave Airlie
2026-07-29 4:29 ` sashiko-bot
2026-07-29 4:15 ` [PATCH 6/6] nouveau: set wpr boost flags like open driver does Dave Airlie
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=20260729043244.F240A1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--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.