From: Svyatoslav Ryhel 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@vger.kernel.org Signed-off-by: Svyatoslav Ryhel Signed-off-by: Patrick Fischer --- 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