If CPU-zone temp reads a lot higher than PLL-zone in a transient
scenario, we would program a huge hotspot offset value which would
cause spuriously high temperatures when we actually switch to
PLL-TSOSC. In the issue described in the bug, this seems to cause a
spurious shutdown.
We fix this by capping the dynamic hotspot offset to the maximum
defined by specification. Also use signed vars to work with -ve temps.
Bug
1511045
Change-Id: Ia5803103e951105382c937de8c75f82e4f166b16
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/407794
Reviewed-by: Edward Riegelsberger <eriegels@nvidia.com>
{
u32 r, s;
int i;
- unsigned long ztemp, pll_temp, diff;
+ long ztemp, pll_temp, diff;
bool low_voltage;
if (soctherm_suspended)
else
diff = 0;
+ /* cap hotspot offset to max offset from pdata */
+ if (diff > plat_data.therm[tz].hotspot_offset)
+ diff = plat_data.therm[tz].hotspot_offset;
+
/* Program hotspot offsets per <tz> ~ PLL diff */
r = soctherm_readl(TS_HOTSPOT_OFF);
if (tz == THERM_CPU)