Re: [PATCH 1/2] thermal: tegra: soctherm-fuse: Fix shifted_cp extension
From: Mikko Perttunen
Date: Thu Nov 26 2026 - 03:13:59 EST
On Saturday, November 7, 2026 5:31 AM Patrick Fischer via B4 Relay wrote:
> From: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
>
> The shifted_cp value in tegra_calc_shared_calib() should be passed to
> sign_extend32() similarly to how shifted_ft is handled. This omission
> caused malfunctions in the GPU and memory thermal zones, which was
> observed on the Tegratab.
>
> Tegra124, Tegra132 and Tegra210 are not affected: SHIFT_CP is in the
> low six bits of their fuse word, so sign-extending the whole word gives
> the same result. Only Tegra114 has SHIFT_CP in bits [15:10].
>
> Fixes: 48fc33b95159 ("thermal/drivers/tegra/soctherm-fuse: Prepare calibration for Tegra114 support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Svyatoslav Ryhel <clamor95@xxxxxxxxx>
> Signed-off-by: Patrick Fischer <admin@xxxxxxxxxxxxxxxxxx>
> ---
> drivers/thermal/tegra/soctherm-fuse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/tegra/soctherm-fuse.c b/drivers/thermal/tegra/soctherm-fuse.c
> index 8d37cd8c9122..2de1d0cb676e 100644
> --- a/drivers/thermal/tegra/soctherm-fuse.c
> +++ b/drivers/thermal/tegra/soctherm-fuse.c
> @@ -102,7 +102,7 @@ int tegra_calc_shared_calib(const struct tegra_soctherm_fuse *tfuse,
>
> shifted_cp = (val & tfuse->fuse_shift_cp_mask) >>
> tfuse->fuse_shift_cp_shift;
> - shifted_cp = sign_extend32(val, 5);
> + shifted_cp = sign_extend32(shifted_cp, 5);
>
> shared->actual_temp_cp = 2 * NOMINAL_CALIB_CP + shifted_cp;
> shared->actual_temp_ft = 2 * tfuse->nominal_calib_ft + shifted_ft;
>
> --
> 2.56.0
>
>
>
Reviewed-by: Mikko Perttunen <mperttunen@xxxxxxxxxx>