[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8517db8d-c755-4fa0-8d8e-fd477060d033@amd.com>
Date: Tue, 3 Dec 2024 14:27:46 -0600
From: Mario Limonciello <mario.limonciello@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Borislav Petkov <bp@...en8.de>, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H . Peter Anvin" <hpa@...or.com>, "Rafael J . Wysocki" <rafael@...nel.org>,
"Gautham R . Shenoy" <gautham.shenoy@....com>,
Perry Yuan <perry.yuan@....com>, Brijesh Singh <brijesh.singh@....com>,
Li RongQing <lirongqing@...du.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>, "open list:ACPI"
<linux-acpi@...r.kernel.org>,
"open list:AMD PSTATE DRIVER" <linux-pm@...r.kernel.org>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Shyam Sundar S K <Shyam-sundar.S-k@....com>
Subject: Re: [PATCH v7 04/12] platform/x86: hfi: Introduce AMD Hardware
Feedback Interface Driver
On 12/2/2024 05:35, Peter Zijlstra wrote:
> On Sat, Nov 30, 2024 at 08:06:55AM -0600, Mario Limonciello wrote:
>
>> +/**
>> + * struct amd_hfi_cpuinfo - HFI workload class info per CPU
>> + * @cpu: cpu index
>> + * @cpus: mask of cpus associated with amd_hfi_cpuinfo
>> + * @class_index: workload class ID index
>> + * @nr_class: max number of workload class supported
>> + * @amd_hfi_classes: current cpu workload class ranking data
>> + *
>> + * Parameters of a logical processor linked with hardware feedback class
>> + */
>> +struct amd_hfi_cpuinfo {
>> + int cpu;
>> + cpumask_var_t cpus;
>
> This appears unused.
>
>> + s16 class_index;
>> + u8 nr_class;
>> + struct amd_hfi_classes *amd_hfi_classes;
>> +};
>> +
>> +static DEFINE_PER_CPU(struct amd_hfi_cpuinfo, amd_hfi_cpuinfo) = {.class_index = -1};
>> +
>> +static int amd_hfi_alloc_class_data(struct platform_device *pdev)
>> +{
>> + struct amd_hfi_cpuinfo *hfi_cpuinfo;
>> + struct device *dev = &pdev->dev;
>> + int idx;
>> + int nr_class_id;
>> +
>> + nr_class_id = cpuid_eax(AMD_HETERO_CPUID_27);
>> + if (nr_class_id < 0 || nr_class_id > 255) {
>> + dev_err(dev, "failed to get number of supported classes: %d\n",
>> + nr_class_id);
>> + return -EINVAL;
>> + }
>> +
>> + for_each_present_cpu(idx) {
>
> This uses present, but does not have means of handling changes to
> present. Does this want to be possible?
>
Thanks, I'll adjust this to *_possible().
I think the *_present() calls make sense for the other consumers in
suspend/resume though. Agree?
Powered by blists - more mailing lists