mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] thermal: tegra: Fix SOC_THERM temperatures on Tegra114
@ 2026-11-06 20:31 Patrick Fischer via B4 Relay
  2026-11-06 20:31 ` [PATCH 1/2] thermal: tegra: soctherm-fuse: Fix shifted_cp extension Patrick Fischer via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Patrick Fischer via B4 Relay @ 2026-11-06 20:31 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Thierry Reding, Jonathan Hunter
  Cc: Svyatoslav Ryhel, Mikko Perttunen, linux-pm, linux-tegra,
	linux-kernel, stable, Patrick Fischer

On the NVIDIA Tegra Note 7 (Tegra114) all four SOC_THERM zones read 0 C
with mainline, in idle and under load, so throttling and thermtrip have
no effect on this SoC. There are two separate causes:

1. tegra_calc_shared_calib() sign-extends the whole fuse word instead of
   the SHIFT_CP field. On Tegra114, where SHIFT_CP is not in the low
   bits, this distorts the calibration of every sensor.

2. The hardware calculates THERMA * capture in 24 bits and discards the
   result above 2^24 (TCALC_OVER set, TEMP_VALID cleared). With the
   calibration in 0.5 C units a Tegra114 sensor is only valid for
   T < (2048 + THERMB) / 2, which is far below the thermtrip
   temperature. Patch 2 switches Tegra114 to 1 C units, as the
   downstream driver does. The fuse calibration stays in 0.5 C units,
   as discussed in the review of the Tegra114 series [1].

Patch 1 is Svyatoslav's fix, unchanged apart from the Fixes and stable
tags and a sentence on why the other SoCs are not affected. Without
patch 2 it gives three zones that work only up to about 45-53 C on this
device.

Zone temperatures on a Tegra Note 7 (P1640) in C, idle / after 60 s of
load on all four cores:

               mainline   patch 1      patches 1+2
  cpu           0 / 0     41.5 / 55.5*   43 / 63
  gpu           0 / 0      0   / 0       39 / 55
  pllx          0 / 0     44   / 52.5*   43 / 62
  mem           0 / 0     39   / 50.5    39 / 53
  thermistor      -       34   / 39      34 / 42

  * the sensors behind the zone were already invalid, the zone stayed
    below the real temperature

"thermistor" is the board thermistor on the PMIC GPADC, as a
reference. With both patches all eight sensors stay valid and thermtrip,
throttle and trip thresholds are programmed as 102, 100 and 90 C.

Tested with v7.3 on the Tegra Note 7 P1640 (me) and P1988 (Svyatoslav,
all four zones work; tags to follow from him on the list). The series
is unchanged on top of thermal/linux-next, but only build tested there.
Thermtrip and the hardware throttle were not provoked on purpose, the
highest temperature seen was 98 C. Suspend/resume was not tested.

The series is independent of "thermal/drivers/tegra/soctherm: Program
throttrip with hot trip temperature" [2], which is still pending; they
apply in either order.

Tool use (see Documentation/process/generated-content.rst): patch 2,
its changelog and this cover letter were prepared with an LLM coding
assistant (Claude Code). It evaluated the SOC_THERM register dumps from
the device, recalculated the calibration from the fuse values, wrote
the code change and drafted the texts from my measurements and
instructions. I reviewed the change and ran all tests on the device.
Patch 1 is Svyatoslav's own work.

[1] https://lore.kernel.org/all/22816196.EfDdHjke4D@senjougahara/
[2] https://lore.kernel.org/all/20261020-upstream-soctherm-throttrip-v1-1-c67f8a02ec3b@tsv-stahl-riesa.de/

---
Patrick Fischer (1):
      thermal/drivers/tegra: Avoid SOC_THERM calculation overflow on Tegra114

Svyatoslav Ryhel (1):
      thermal: tegra: soctherm-fuse: Fix shifted_cp extension

 drivers/thermal/tegra/soctherm-fuse.c     | 17 +++++++++++++----
 drivers/thermal/tegra/soctherm.c          | 21 +++++++++++++--------
 drivers/thermal/tegra/soctherm.h          |  6 ++++++
 drivers/thermal/tegra/tegra114-soctherm.c |  4 +++-
 4 files changed, 35 insertions(+), 13 deletions(-)
---
base-commit: 32cb06b34701827db0ff34244d84fc74e40ca350
change-id: 20261023-upstream-soctherm-t114-9591c6b779d6

Best regards,
--  
Patrick Fischer <admin@tsv-stahl-riesa.de>



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-26 10:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 20:31 [PATCH 0/2] thermal: tegra: Fix SOC_THERM temperatures on Tegra114 Patrick Fischer via B4 Relay
2026-11-06 20:31 ` [PATCH 1/2] thermal: tegra: soctherm-fuse: Fix shifted_cp extension Patrick Fischer via B4 Relay
2026-11-26  8:13   ` Mikko Perttunen
2026-11-06 20:31 ` [PATCH 2/2] thermal/drivers/tegra: Avoid SOC_THERM calculation overflow on Tegra114 Patrick Fischer via B4 Relay
2026-11-07 10:17   ` Svyatoslav Ryhel
2026-11-26 10:27   ` Mikko Perttunen
2026-11-22 10:21 ` [PATCH 0/2] thermal: tegra: Fix SOC_THERM temperatures " Patrick Fischer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®