All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
	rjw@sisk.pl, arjan@linux.intel.com, len.brown@intel.com,
	jacob.jun.pan@linux.intel.com, corbet@lwn.net
Subject: Re: [RFC v02 5/5] Introduce Intel RAPL power capping driver
Date: Wed, 07 Aug 2013 09:26:37 -0700	[thread overview]
Message-ID: <1375892797.2424.126.camel@joe-AO722> (raw)
In-Reply-To: <1375891965-6921-6-git-send-email-srinivas.pandruvada@linux.intel.com>

On Wed, 2013-08-07 at 09:12 -0700, Srinivas Pandruvada wrote:
> RAPL(Running Average Power Limit) interface provides platform software
> with the ability to monitor, control, and get notifications on SOC
> power consumptions.

trivial notes:

> diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c
[]
> +#define POWER_LIMIT1_MASK       0x7FFF
> +#define POWER_LIMIT1_ENABLE     BIT(15)
> +#define POWER_LIMIT1_CLAMP      BIT(16)
> +
> +#define POWER_LIMIT2_MASK       (0x7FFFULL<<32)
> +#define POWER_LIMIT2_ENABLE     (0x1ULL<<47)
> +#define POWER_LIMIT2_CLAMP      (0x1ULL<<48)
> +#define POWER_PKG_LOCK          (0x1ULL<<63)

Maybe it's time add a generic bitops.h macro

#define BIT_ULL(nr)	(1ULL << (nr))

[]

> +/* called after domain detection and package level data are set */
> +static void rapl_init_domains(struct rapl_pkg *rp)
> +{
> +	int i;
> +	struct rapl_domain *rd = rp->domains;
> +
> +	for (i = 0; i < RAPL_DOMAIN_MAX; i++) {
> +		unsigned int mask = rp->domain_map & (1 << i);
> +		switch (mask) {
> +		case 1 << RAPL_DOMAIN_PKG:

Maybe use defines or BIT(RAPL_DOMAIN_PKG)

Other than that the code seems to read pretty easily.


  reply	other threads:[~2013-08-07 16:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-07 16:12 [RFC v02 0/5] Power Capping Framework and RAPL Driver Srinivas Pandruvada
2013-08-07 16:12 ` [RFC v02 1/5] PowerCap: Documentation Srinivas Pandruvada
2013-08-08 13:43   ` Rob Landley
2013-08-08 15:17     ` Srinivas Pandruvada
2013-08-07 16:12 ` [RFC v02 2/5] PowerCap: Add class driver Srinivas Pandruvada
2013-08-07 16:12 ` [RFC v02 3/5] PowerCap: Added to drivers build Srinivas Pandruvada
2013-08-07 16:12 ` [RFC v02 4/5] x86/msr: add 64bit _on_cpu access functions Srinivas Pandruvada
2013-08-07 16:12 ` [RFC v02 5/5] Introduce Intel RAPL power capping driver Srinivas Pandruvada
2013-08-07 16:26   ` Joe Perches [this message]
2013-08-10  0:39 ` [RFC v02 0/5] Power Capping Framework and RAPL Driver Srinivas Pandruvada
2013-08-08 15:23 Srinivas Pandruvada
2013-08-08 15:23 ` [RFC v02 5/5] Introduce Intel RAPL power capping driver Srinivas Pandruvada

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=1375892797.2424.126.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=arjan@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=srinivas.pandruvada@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.