lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 09 Apr 2013 17:01:17 -0700
From:	Joe Perches <joe@...ches.com>
To:	Jacob Pan <jacob.jun.pan@...ux.intel.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Platform Driver <platform-driver-x86@...r.kernel.org>,
	Matthew Garrett <matthew.garrett@...ula.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Zhang Rui <rui.zhang@...el.com>,
	Rafael Wysocki <rafael.j.wysocki@...el.com>,
	Len Brown <len.brown@...el.com>,
	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	Arjan van de Ven <arjan@...ux.intel.com>
Subject: Re: [PATCH v4 1/1] Introduce Intel RAPL cooling device driver

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);
	}


--
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