Skip to content

Commit

Permalink
[AArch64] Workaround to Package discrete voltage: the highest Vcore
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Jul 9, 2024
1 parent 4c4e5c7 commit 9235fb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 9 additions & 1 deletion aarch64/corefreqd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,7 @@ REASON_CODE Core_Manager(REF *Ref)
];

PFlip->Thermal.Temp = 0;
PFlip->Voltage.VID.CPU = 0;
/* Reset the averages & the max frequency */
RO(Shm)->Proc.Avg.Turbo = 0;
RO(Shm)->Proc.Avg.C0 = 0;
Expand Down Expand Up @@ -1799,7 +1800,11 @@ REASON_CODE Core_Manager(REF *Ref)
if (CFlop->Thermal.Temp > PFlip->Thermal.Temp)
PFlip->Thermal.Temp = CFlop->Thermal.Temp;
}

/* Workaround to a Package discrete voltage: the highest Vcore */
if (!RO(Proc)->PowerThermal.VID.CPU) {
if (CFlop->Voltage.VID > PFlip->Voltage.VID.CPU)
PFlip->Voltage.VID.CPU = CFlop->Voltage.VID;
}
/* Workaround to RAPL Package counter: sum of all Cores */
Pkg_ComputePowerFormula(RW(Proc), CFlop);

Expand Down Expand Up @@ -1908,7 +1913,10 @@ REASON_CODE Core_Manager(REF *Ref)
Pkg_ComputeThermalFormula(PFlip, SProc);
}
/* Package Voltage formulas */
if (RO(Proc)->PowerThermal.VID.CPU)
{
PFlip->Voltage.VID.CPU = RO(Proc)->PowerThermal.VID.CPU;
}
PFlip->Voltage.VID.SOC = RO(Proc)->PowerThermal.VID.SOC;

Pkg_ComputeVoltageFormula(PFlip);
Expand Down
7 changes: 0 additions & 7 deletions aarch64/corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -3406,13 +3406,6 @@ static enum hrtimer_restart Cycle_GenericMachine(struct hrtimer *pTimer)
case FORMULA_SCOPE_NONE:
break;
}
if (((PUBLIC(RO(Proc))->Features.Hybrid)
&& (Core->Bind == PUBLIC(RO(Proc))->Service.Hybrid))
|| (Core->Bind == PUBLIC(RO(Proc))->Service.Core))
{
PUBLIC(RO(Proc))->PowerThermal.VID.CPU = \
PRIVATE(OF(Core, AT(Core->Bind)))->OPP[index].VID;
}
}
#endif /* CONFIG_PM_OPP */
BITSET(LOCKLESS, PUBLIC(RW(Core, AT(cpu)))->Sync.V, NTFY);
Expand Down

0 comments on commit 9235fb3

Please sign in to comment.