Skip to content

Commit e653d7a

Browse files
committed
[Intel] Check if the Turbo Activation Ratio is within bounds
* Check if the Lock bit is disabled * Raise the COMPUTE notification
1 parent b8f8672 commit e653d7a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

corefreqk.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6566,7 +6566,7 @@ void Intel_Turbo_TDP_Config(CORE_RO *Core)
65666566

65676567
RDMSR(TurboActivation, MSR_TURBO_ACTIVATION_RATIO);
65686568

6569-
if ((!TurboActivation.Ratio_Lock) && (Turbo_Activation_Ratio >= 0)
6569+
if (!TurboActivation.Ratio_Lock && (Turbo_Activation_Ratio >= 0)
65706570
&& (Turbo_Activation_Ratio != TurboActivation.MaxRatio))
65716571
{
65726572
const short MaxRatio = \
@@ -15556,9 +15556,12 @@ static long CoreFreqK_ioctl( struct file *filp,
1555615556

1555715557
case COREFREQ_IOCTL_CONFIG_TDP: {
1555815558
CLOCK_ARG clockMod = {.sllong = arg};
15559+
const short MaxRatio = MAXCLOCK_TO_RATIO(short, \
15560+
PUBLIC(RO(Core,AT(PUBLIC(RO(Proc))->Service.Core))->Clock.Hz));
15561+
1555915562
switch (clockMod.NC) {
1556015563
case CLOCK_MOD_ACT:
15561-
if (clockMod.Ratio >= 0)
15564+
if ((clockMod.Ratio >= 0)&&(clockMod.Ratio <= MaxRatio))
1556215565
{
1556315566
Controller_Stop(1);
1556415567
Turbo_Activation_Ratio = clockMod.Ratio;

0 commit comments

Comments
 (0)