Skip to content

Commit 216fe0d

Browse files
superm1bp3tk0v
authored andcommitted
platform/x86/amd: hfi: Set ITMT priority from ranking data
The static ranking data that is read at module load should be used to set up the priorities for the cores relative to the performance values. Signed-off-by: Mario Limonciello <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Gautham R. Shenoy <[email protected]> Acked-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/[email protected]
1 parent bfea2b3 commit 216fe0d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/platform/x86/amd/hfi/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ config AMD_HFI
77
bool "AMD Hetero Core Hardware Feedback Driver"
88
depends on ACPI
99
depends on CPU_SUP_AMD
10+
depends on SCHED_MC_PRIO
1011
help
1112
Select this option to enable the AMD Heterogeneous Core Hardware
1213
Feedback Interface. If selected, hardware provides runtime thread

drivers/platform/x86/amd/hfi/hfi.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ static DEFINE_PER_CPU(struct amd_hfi_cpuinfo, amd_hfi_cpuinfo) = {.class_index =
114114

115115
static DEFINE_MUTEX(hfi_cpuinfo_lock);
116116

117+
static void amd_hfi_sched_itmt_work(struct work_struct *work)
118+
{
119+
sched_set_itmt_support();
120+
}
121+
static DECLARE_WORK(sched_amd_hfi_itmt_work, amd_hfi_sched_itmt_work);
122+
117123
static int find_cpu_index_by_apicid(unsigned int target_apicid)
118124
{
119125
int cpu_index;
@@ -238,6 +244,8 @@ static int amd_set_hfi_ipcc_score(struct amd_hfi_cpuinfo *hfi_cpuinfo, int cpu)
238244
WRITE_ONCE(hfi_cpuinfo->ipcc_scores[i],
239245
hfi_cpuinfo->amd_hfi_classes[i].perf);
240246

247+
sched_set_itmt_core_prio(hfi_cpuinfo->ipcc_scores[0], cpu);
248+
241249
return 0;
242250
}
243251

@@ -459,6 +467,8 @@ static int amd_hfi_probe(struct platform_device *pdev)
459467
if (ret < 0)
460468
return ret;
461469

470+
schedule_work(&sched_amd_hfi_itmt_work);
471+
462472
return 0;
463473
}
464474

0 commit comments

Comments
 (0)