Messages in this thread |  | | From | "Yuan, Perry" <> | Subject | RE: [PATCH v8 01/13] ACPI: CPPC: Add AMD pstate energy performance preference cppc control | Date | Sun, 25 Dec 2022 16:41:47 +0000 |
| |
[AMD Official Use Only - General]
> -----Original Message----- > From: Huang, Ray <Ray.Huang@amd.com> > Sent: Friday, December 23, 2022 5:06 PM > To: Yuan, Perry <Perry.Yuan@amd.com> > Cc: rafael.j.wysocki@intel.com; Limonciello, Mario > <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Sharma, Deepak > <Deepak.Sharma@amd.com>; Fontenot, Nathan > <Nathan.Fontenot@amd.com>; Deucher, Alexander > <Alexander.Deucher@amd.com>; Huang, Shimmer > <Shimmer.Huang@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; Meng, > Li (Jassmine) <Li.Meng@amd.com>; Karny, Wyes <Wyes.Karny@amd.com>; > linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v8 01/13] ACPI: CPPC: Add AMD pstate energy > performance preference cppc control > > On Fri, Dec 23, 2022 at 11:19:57AM +0800, Yuan, Perry wrote: > > [AMD Official Use Only - General] > > > > > > > > > -----Original Message----- > > > From: Huang, Ray <Ray.Huang@amd.com> > > > Sent: Friday, December 23, 2022 10:16 AM > > > To: Yuan, Perry <Perry.Yuan@amd.com> > > > Cc: rafael.j.wysocki@intel.com; Limonciello, Mario > > > <Mario.Limonciello@amd.com>; viresh.kumar@linaro.org; Sharma, > Deepak > > > <Deepak.Sharma@amd.com>; Fontenot, Nathan > <Nathan.Fontenot@amd.com>; > > > Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Shimmer > > > <Shimmer.Huang@amd.com>; Du, Xiaojian <Xiaojian.Du@amd.com>; > Meng, > > > Li (Jassmine) <Li.Meng@amd.com>; Karny, Wyes > <Wyes.Karny@amd.com>; > > > linux-pm@vger.kernel.org; linux-kernel@vger.kernel.org > > > Subject: Re: [PATCH v8 01/13] ACPI: CPPC: Add AMD pstate energy > > > performance preference cppc control > > > > > > On Mon, Dec 19, 2022 at 02:40:30PM +0800, Yuan, Perry wrote: > > > > From: Perry Yuan <Perry.Yuan@amd.com> > > > > > > > > Add support for setting and querying EPP preferences to the > > > > generic CPPC driver. This enables downstream drivers such as > > > > amd-pstate to discover and use these values > > > > > > > > Downstream drivers that want to use the new symbols > > > > cppc_get_epp_caps and cppc_set_epp_perf for querying and setting > > > > EPP preferences will need to call cppc_set_epp_perf to enable the EPP > function firstly. > > > > > > > > Signed-off-by: Perry Yuan <Perry.Yuan@amd.com> > > > > --- > > > > drivers/acpi/cppc_acpi.c | 76 > > > > +++++++++++++++++++++++++++++++++++++--- > > > > include/acpi/cppc_acpi.h | 12 +++++++ > > > > 2 files changed, 83 insertions(+), 5 deletions(-) > > > > > > > > diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c > > > > index 093675b1a1ff..81081eb899ea 100644 > > > > --- a/drivers/acpi/cppc_acpi.c > > > > +++ b/drivers/acpi/cppc_acpi.c > > > > @@ -1093,6 +1093,9 @@ static int cppc_get_perf(int cpunum, enum > > > > cppc_regs reg_idx, u64 *perf) { > > > > struct cpc_desc *cpc_desc = per_cpu(cpc_desc_ptr, cpunum); > > > > struct cpc_register_resource *reg; > > > > + int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum); > > > > + struct cppc_pcc_data *pcc_ss_data = NULL; > > > > + int ret = -EINVAL; > > > > > > > > if (!cpc_desc) { > > > > pr_debug("No CPC descriptor for CPU:%d\n", cpunum); @@ > > > -1102,10 > > > > +1105,6 @@ static int cppc_get_perf(int cpunum, enum cppc_regs > > > > +reg_idx, > > > u64 *perf) > > > > reg = &cpc_desc->cpc_regs[reg_idx]; > > > > > > > > if (CPC_IN_PCC(reg)) { > > > > - int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpunum); > > > > - struct cppc_pcc_data *pcc_ss_data = NULL; > > > > - int ret = 0; > > > > - > > > > > > Do you have any specific reason to move this piece out of if-condition? > > > > Move the declaration ahead of the If conditions like other functions did. > > It looks more reasonable and no functions impact. > > > > If one platform doesn't have any CPC registers, it even won't need define > these variables like pcc_ss_id, pcc_ss_data, and it will save more time. > > Thanks, > Ray
Make sense , get it fixed in V9
|  |