[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1375892797.2424.126.camel@joe-AO722>
Date: Wed, 07 Aug 2013 09:26:37 -0700
From: Joe Perches <joe@...ches.com>
To: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, gregkh@...uxfoundation.org,
rjw@...k.pl, arjan@...ux.intel.com, len.brown@...el.com,
jacob.jun.pan@...ux.intel.com, corbet@....net
Subject: Re: [RFC v02 5/5] Introduce Intel RAPL power capping driver
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists