Re: [PATCH 04/15] powercap/intel_rapl: Support per Interface primitive information

From: Zhang, Rui
Date: Sun Apr 02 2023 - 03:43:15 EST


On Thu, 2023-03-30 at 19:56 +0200, Rafael J. Wysocki wrote:
> On Thu, Mar 16, 2023 at 4:42 PM Zhang Rui <rui.zhang@xxxxxxxxx>
> wrote:
> > RAPL primitive information is Interface specific.
> >
> > Although current MSR and MMIO Interface share the same RAPL
> > primitives,
> > new Interface like TPMI has its own RAPL primitive information.
> >
> > Save the primitive information in the Interface private structure.
> >
> > Plus, using variant name "rp" for struct rapl_primitive_info is
> > confusing because "rp" is also used for struct rapl_package.
> > Use "rpi" as the variant name for struct rapl_primitive_info, and
> > rename
> > the previous rpi[] array to avoid conflict.
> >
> > No functional change.
> >
> > Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
> > ---
> > drivers/powercap/intel_rapl_common.c | 50 ++++++++++++++++++----
> > ------
> > include/linux/intel_rapl.h | 2 ++
> > 2 files changed, 35 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/powercap/intel_rapl_common.c
> > b/drivers/powercap/intel_rapl_common.c
> > index 56e8af2a1e6f..898238285188 100644
> > --- a/drivers/powercap/intel_rapl_common.c
> > +++ b/drivers/powercap/intel_rapl_common.c
> > @@ -654,7 +654,7 @@ static u64 rapl_unit_xlate(struct rapl_domain
> > *rd, enum unit_type type,
> > }
> >
> > /* in the order of enum rapl_primitives */
> > -static struct rapl_primitive_info rpi[] = {
> > +static struct rapl_primitive_info rpis_default[] = {
>
> What does the 's' in the name stand for?

'rpi' stands for rapl_primitive_info, so I use 'rpis' for a series of
rapl_primitive_info.

thanks,
rui