From: sashiko-bot@kernel.org
To: "Mahdi Salimi" <mahdisalimikingmallo@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/nouveau/fb/ramnv50: Fixed DDR2 reclocking on NV50 architectures
Date: Tue, 24 Nov 2026 21:06:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-232015@kernel.org> (raw)
In-Reply-To: <20261125-ramnv50-ddr2-reclock-v1-1-64f046c1c95d@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/nouveau/fb: nv50_ram_calc() does not write calculated
DDR2 mr[0]
--
commit 2fb9a17101350a18953857e40ee356852e576655
Author: Jonathan Fouquart <jfouquart@hotmail.fr>
drm/nouveau/fb/ramnv50: Fixed DDR2 reclocking on NV50 architectures
This commit adds the NVKM_RAM_TYPE_DDR2 case to nv50_ram_calc() to call
nvkm_sddr2_calc() when calculating DDR2 mode register values during
memory reclocking.
Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/23
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
> index be15519d0c969..d013a2fd2b2e7 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c
> @@ -288,6 +288,9 @@ nv50_ram_calc(struct nvkm_ram *base, u32 freq)
> ram->base.mr[2] = ram_rd32(hwsq, mr[2]);
>
> switch (ram->base.type) {
> + case NVKM_RAM_TYPE_DDR2:
> + ret = nvkm_sddr2_calc(&ram->base);
> + break;
> case NVKM_RAM_TYPE_GDDR3:
> ret = nvkm_gddr3_calc(&ram->base);
> break;
[Severity: Medium]
Should the second switch on ram->base.type in nv50_ram_calc() also write
ram->base.mr[0] to mr[0] for NVKM_RAM_TYPE_DDR2?
nvkm_sddr2_calc() updates the CL and WR fields in ram->base.mr[0], and
nv50_ram_calc() later writes ram->base.mr[1] and the new memory
controller timing registers, but the MR0 update for DDR2 still uses a
no-op mask:
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv50.c:nv50_ram_calc() {
...
switch (ram->base.type) {
case NVKM_RAM_TYPE_DDR2:
ram_nuke(hwsq, mr[0]); /* force update */
ram_mask(hwsq, mr[0], 0x000, 0x000);
break;
case NVKM_RAM_TYPE_GDDR3:
ram_nuke(hwsq, mr[1]); /* force update */
ram_wr32(hwsq, mr[1], ram->base.mr[1]);
ram_nuke(hwsq, mr[0]); /* force update */
ram_wr32(hwsq, mr[0], ram->base.mr[0]);
break;
...
}
Because ram_mask(hwsq, mr[0], 0x000, 0x000) re-emits the pre-reclock
value cached in hwsq->r_mr[0].data rather than ram->base.mr[0],
reclocking between performance states with different CL or WR values
leaves the DDR2 chips programmed with the old MR0 timings while the
memory controller uses the new timings, which can corrupt VRAM or hang
the GPU.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-ramnv50-ddr2-reclock-v1-1-64f046c1c95d@gmail.com?part=1
prev parent reply other threads:[~2026-11-24 21:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 20:58 [PATCH] drm/nouveau/fb/ramnv50: Fixed DDR2 reclocking on NV50 architectures Mahdi Salimi
2026-11-24 20:58 ` Mahdi Salimi via B4 Relay
2026-11-24 21:06 ` sashiko-bot [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=sashiko-outbox-232015@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mahdisalimikingmallo@gmail.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.