mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Jacob Pan <jacob.jun.pan@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	Matthew Garrett <matthew.garrett@nebula.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Rafael Wysocki <rafael.j.wysocki@intel.com>,
	Len Brown <len.brown@intel.com>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH v4 1/1] Introduce Intel RAPL cooling device driver
Date: Tue, 09 Apr 2013 17:01:17 -0700	[thread overview]
Message-ID: <1365552077.18072.28.camel@joe-AO722> (raw)
In-Reply-To: <1365551209-14392-2-git-send-email-jacob.jun.pan@linux.intel.com>

On Tue, 2013-04-09 at 16:46 -0700, Jacob Pan wrote:
> RAPL(Running Average Power Limit) interface provides platform software
> with the ability to monitor, control, and get notifications on SOC
> power consumptions.

yet more trivia and style quibbles.

> diff --git a/drivers/platform/x86/intel_rapl.c b/drivers/platform/x86/intel_rapl.c
[]
> +static int rapl_get_max_state(struct thermal_cooling_device *cdev,
> +			unsigned long *state)
> +{
> +	int ret;
> +	u64 val;
> +
> +	struct rapl_domain *rd = (struct rapl_domain *)cdev->devdata;

Don't need to cast void *

	struct rapl_domain *rd = cdev->devdata;

is just fine.

> +static int rapl_get_cur_state(struct thermal_cooling_device *cdev, unsigned long
> +			     *state)
> +{
> +	struct rapl_domain *rd = (struct rapl_domain *)cdev->devdata;

etc

> +static void set_pkg_thermal_irq(bool enable)
> +{
[]
> +	if (boot_cpu_has(X86_FEATURE_PTS))
> +		rdmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);
> +	else
> +		return;

	if (!boot_cpu_has(X86_FEATURE_PTS))
		return;

	rdmsc(etc...)

> +
> +	if (enable == false)

Don't test for == false

> +		l &= ~PACKAGE_THERM_INT_PLN_ENABLE;
> +	else
> +		l |= PACKAGE_THERM_INT_PLN_ENABLE;
> +
> +	if (boot_cpu_has(X86_FEATURE_PLN))
> +		wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);

	if (boot_cpu_has(X86_FEATURE_PTS)) {
		if (enable)
			l |= PACKAGE_THERM_INT_PLN_ENABLE;
		else
			l &= ~PACKAGE_THERM_INT_PLN_ENABLE;
		wrmsr(MSR_IA32_PACKAGE_THERM_INTERRUPT, l, h);
	}



      parent reply	other threads:[~2013-04-10  0:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 23:46 [PATCH v4 0/1] RAPL (Running Average Power Limit) driver Jacob Pan
2013-04-09 23:46 ` [PATCH v4 1/1] Introduce Intel RAPL cooling device driver Jacob Pan
2013-04-09 23:52   ` Greg Kroah-Hartman
2013-04-10  0:01   ` Joe Perches [this message]

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=1365552077.18072.28.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=arjan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jacob.jun.pan@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.zhang@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®