Re: [PATCH v2] drm/nouveau/therm: mask the update bit when reading back the fan PWM duty

From: Danilo Krummrich

Date: Sat Dec 05 2026 - 16:56:00 EST


On Thu Oct 29, 2026 at 2:00 PM CET, Alex wrote:
> Fixes: cb9fa62671ac ("drm/nv50/pm: add support for pwm fan control")
> Fixes: bc79202f4c8f ("nvd0/therm: implement more appropriate pwm fan control functions")

<snip>

> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c
> index 684aff7..f56e763 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gf119.c
> @@ -74,7 +74,11 @@ gf119_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty)
> else if (indx < 2) {
> if (nvkm_rd32(device, 0x00d610 + (line * 0x04)) & 0x00000040) {
> *divs = nvkm_rd32(device, 0x00e114 + (indx * 8));
> - *duty = nvkm_rd32(device, 0x00e118 + (indx * 8));
> + /*
> + * Bit 31 is the update trigger set by pwm_set();
> + * it can still read back as set after a write.
> + */
> + *duty = nvkm_rd32(device, 0x00e118 + (indx * 8)) & 0x7fffffff;
> return 0;
> }
> } else if (indx == 2) {
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c
> index 9cf16a7..9272256 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/nv50.c
> @@ -72,7 +72,11 @@ nv50_fan_pwm_get(struct nvkm_therm *therm, int line, u32 *divs, u32 *duty)
>
> if (nvkm_rd32(device, ctrl) & (1 << line)) {
> *divs = nvkm_rd32(device, 0x00e114 + (id * 8));
> - *duty = nvkm_rd32(device, 0x00e118 + (id * 8));
> + /*
> + * Bit 31 is the update trigger set by pwm_set();
> + * it can still read back as set after a write.
> + */
> + *duty = nvkm_rd32(device, 0x00e118 + (id * 8)) & 0x7fffffff;
> return 0;
> }

Those should be two separate patches, can you please split this one up and
resend?

Thanks,
Danilo