linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>
Subject: Re: [PATCH 04/13] intel_rapl: introduce struct rapl_private
Date: Wed, 03 Jul 2019 16:14:02 +0800	[thread overview]
Message-ID: <1562141642.3256.6.camel@intel.com> (raw)
In-Reply-To: <CAJZ5v0he3Qs_nZmTN9fcgVAnurwXOb+Dj+NnTvUqT8TCH3oNHQ@mail.gmail.com>

On 二, 2019-07-02 at 23:44 +0200, Rafael J. Wysocki wrote:
> On Fri, Jun 28, 2019 at 7:50 AM Zhang Rui <rui.zhang@intel.com>
> wrote:
> > 
> > 
> > Introduce a new structure, rapl_private, to save the private data
> > for different RAPL Interface.
> The new structure is called rapl_priv in the patch.
> 
> Besides, I would call it rapl_if_priv to indicate that this related
> to
> an interface.
> 
> Also, IMO there should be a kerneldoc comment for it.
> 
okay.
> > 
> > Signed-off-by: Zhang Rui <rui.zhang@intel.com>
> > ---
> >  drivers/powercap/intel_rapl.c | 58 +++++++++++++++++++++--------
> > --------------
> >  include/linux/intel_rapl.h    |  7 ++++++
> >  2 files changed, 35 insertions(+), 30 deletions(-)
> > 
> > diff --git a/drivers/powercap/intel_rapl.c
> > b/drivers/powercap/intel_rapl.c
> > index adb35ec..a804370 100644
> > --- a/drivers/powercap/intel_rapl.c
> > +++ b/drivers/powercap/intel_rapl.c
> > @@ -75,6 +75,8 @@ enum unit_type {
> >         TIME_UNIT,
> >  };
> > 
> > +static struct rapl_priv rapl_msr_priv;
> Please add a comment describing this variable and its role.
> 
> BTW, I'd rather call it rapl_if_msr.
> 
> > 
> > +
> >  /* per domain data, some are optional */
> >  #define NR_RAW_PRIMITIVES (NR_RAPL_PRIMITIVES - 2)
> > 
> > @@ -155,17 +157,14 @@ static const char * const rapl_domain_names[]
> > = {
> >         "psys",
> >  };
> > 
> > -static struct powercap_control_type *control_type; /* PowerCap
> > Controller */
> > -static struct rapl_domain *platform_rapl_domain; /* Platform
> > (PSys) domain */
> Why do these things need to go into rapl_priv?
> 
different RAPL interface may have its own control_type,
"intel_rapl_msr" vs. "intel_rapl_mmio".

MMIO RAPL interface does not have platform rapl domain so far, but
given that the current platform rapl domain uses
MSR_PLATFORM_POWER_LIMIT and MSR_PLATFORM_ENERGY_STATUS.
I made it part of MSR RAPL interface driver.

thanks,
rui

  reply	other threads:[~2019-07-03  8:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  5:50 [PATCH 00/13] intel_rapl: RAPL abstraction and MMIO RAPL support Zhang Rui
2019-06-28  5:50 ` [PATCH 01/13] intel_rapl: use reg instead of msr Zhang Rui
2019-06-28  5:50 ` [PATCH 02/13] intel_rapl: remove hardcoded register index Zhang Rui
2019-06-28  5:50 ` [PATCH 03/13] intel_rapl: introduce intel_rapl.h Zhang Rui
2019-07-02 22:01   ` Rafael J. Wysocki
2019-07-02 22:13     ` Pandruvada, Srinivas
2019-07-02 23:26       ` Rafael J. Wysocki
2019-06-28  5:50 ` [PATCH 04/13] intel_rapl: introduce struct rapl_private Zhang Rui
2019-07-02 21:44   ` Rafael J. Wysocki
2019-07-03  8:14     ` Zhang Rui [this message]
2019-06-28  5:50 ` [PATCH 05/13] intel_rapl: abstract register address Zhang Rui
2019-06-28  5:50 ` [PATCH 06/13] intel_rapl: abstract register access operations Zhang Rui
2019-07-02 21:56   ` Rafael J. Wysocki
2019-07-03  8:14     ` Zhang Rui
2019-06-28  5:50 ` [PATCH 07/13] intel_rapl: cleanup some functions Zhang Rui
2019-06-28  5:50 ` [PATCH 08/13] intel_rapl: cleanup hardcoded MSR access Zhang Rui
2019-06-28  5:50 ` [PATCH 09/13] intel_rapl: abstract RAPL common code Zhang Rui
2019-07-02 21:59   ` Rafael J. Wysocki
2019-07-03  8:23     ` Zhang Rui
2019-07-03  9:02       ` Rafael J. Wysocki
2019-07-02 22:45   ` Pandruvada, Srinivas
2019-06-28  5:50 ` [PATCH 10/13] intel_rapl: support 64 bit register Zhang Rui
2019-06-28  5:50 ` [PATCH 11/13] intel_rapl: support two power limits for every RAPL domain Zhang Rui
2019-06-28  5:50 ` [PATCH 12/13] int340X/processor_thermal_device: add support for MMIO RAPL Zhang Rui
2019-06-28  5:50 ` [PATCH 13/13] intel_rapl: Fix module autoloading issue Zhang Rui
  -- strict thread matches above, loose matches on Subject: below --
2019-06-25 15:16 [PATCH 00/13] intel_rapl: RAPL abstraction and MMIO RAPL support Zhang Rui
2019-06-25 15:16 ` [PATCH 04/13] intel_rapl: introduce struct rapl_private Zhang Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1562141642.3256.6.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).