Skip to content

Commit

Permalink
[AMD][Zen] Inject threshold events when thermal is out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Aug 6, 2024
1 parent ff50d18 commit 68ee040
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions x86_64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -16217,12 +16217,25 @@ static void Core_AMD_Zen_Filter_Temp( CORE_RO *Core, unsigned int CurTmp,
*/
Core->PowerThermal.Sensor = CurTmp;

if ((scaleRangeSel == true)
&& (Core->PowerThermal.Sensor >= (49 << 3)))
{
if (scaleRangeSel == true) {
if (Core->PowerThermal.Sensor >= (49 << 3))
{
Core->PowerThermal.Param.Offset[THERMAL_OFFSET_P1] = 49;

if (Core->PowerThermal.Sensor > (255 << 3)) {
Core->PowerThermal.Events[eLOG] |= EVENT_THOLD2_LOG;
}
} else {
Core->PowerThermal.Param.Offset[THERMAL_OFFSET_P1] = 0;

Core->PowerThermal.Events[eLOG] |= EVENT_THOLD1_LOG;
}
} else {
Core->PowerThermal.Param.Offset[THERMAL_OFFSET_P1] = 0;

if (Core->PowerThermal.Sensor > (225 << 3)) {
Core->PowerThermal.Events[eLOG] |= EVENT_THOLD2_LOG;
}
}
}

Expand Down

0 comments on commit 68ee040

Please sign in to comment.