Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ae09259 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging:
  x86/hwmon: pkgtemp has no dependency on PCI
  MAINTAINERS: Update hwmon entry
  x86/hwmon: register alternate sibling upon CPU removal
  x86/hwmon: fix initialization of pkgtemp
  x86/hwmon: fix initialization of coretemp
  x86/hwmon: don't leak device attribute file from pkgtemp_probe() and pkgtemp_remove()
  x86/hwmon: avoid deadlock on CPU removal in pkgtemp
  x86/hwmon: fix module init for hotplug-but-no-device-found case
  hwmon: (lis3) Fix Oops with NULL platform data
parents fd194e64 0eae7799
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2668,6 +2668,8 @@ M: Guenter Roeck <guenter.roeck@ericsson.com>
L:	lm-sensors@lm-sensors.org
L:	lm-sensors@lm-sensors.org
W:	http://www.lm-sensors.org/
W:	http://www.lm-sensors.org/
T:	quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/
T:	quilt kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/
T:	quilt kernel.org/pub/linux/kernel/people/groeck/linux-staging/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
S:	Maintained
S:	Maintained
F:	Documentation/hwmon/
F:	Documentation/hwmon/
F:	drivers/hwmon/
F:	drivers/hwmon/
+1 −0
Original line number Original line Diff line number Diff line
@@ -168,6 +168,7 @@
#define X86_FEATURE_XSAVEOPT	(7*32+ 4) /* Optimized Xsave */
#define X86_FEATURE_XSAVEOPT	(7*32+ 4) /* Optimized Xsave */
#define X86_FEATURE_PLN		(7*32+ 5) /* Intel Power Limit Notification */
#define X86_FEATURE_PLN		(7*32+ 5) /* Intel Power Limit Notification */
#define X86_FEATURE_PTS		(7*32+ 6) /* Intel Package Thermal Status */
#define X86_FEATURE_PTS		(7*32+ 6) /* Intel Package Thermal Status */
#define X86_FEATURE_DTS		(7*32+ 7) /* Digital Thermal Sensor */


/* Virtualization flags: Linux defined, word 8 */
/* Virtualization flags: Linux defined, word 8 */
#define X86_FEATURE_TPR_SHADOW  (8*32+ 0) /* Intel TPR Shadow */
#define X86_FEATURE_TPR_SHADOW  (8*32+ 0) /* Intel TPR Shadow */
+1 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
	const struct cpuid_bit *cb;
	const struct cpuid_bit *cb;


	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
	static const struct cpuid_bit __cpuinitconst cpuid_bits[] = {
		{ X86_FEATURE_DTS,		CR_EAX, 0, 0x00000006, 0 },
		{ X86_FEATURE_IDA,		CR_EAX, 1, 0x00000006, 0 },
		{ X86_FEATURE_IDA,		CR_EAX, 1, 0x00000006, 0 },
		{ X86_FEATURE_ARAT,		CR_EAX, 2, 0x00000006, 0 },
		{ X86_FEATURE_ARAT,		CR_EAX, 2, 0x00000006, 0 },
		{ X86_FEATURE_PLN,		CR_EAX, 4, 0x00000006, 0 },
		{ X86_FEATURE_PLN,		CR_EAX, 4, 0x00000006, 0 },
+1 −1
Original line number Original line Diff line number Diff line
@@ -409,7 +409,7 @@ config SENSORS_CORETEMP


config SENSORS_PKGTEMP
config SENSORS_PKGTEMP
	tristate "Intel processor package temperature sensor"
	tristate "Intel processor package temperature sensor"
	depends on X86 && PCI && EXPERIMENTAL
	depends on X86 && EXPERIMENTAL
	help
	help
	  If you say yes here you get support for the package level temperature
	  If you say yes here you get support for the package level temperature
	  sensor inside your CPU. Check documentation/driver for details.
	  sensor inside your CPU. Check documentation/driver for details.
+32 −24
Original line number Original line Diff line number Diff line
@@ -423,9 +423,18 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
	int err;
	int err;
	struct platform_device *pdev;
	struct platform_device *pdev;
	struct pdev_entry *pdev_entry;
	struct pdev_entry *pdev_entry;
#ifdef CONFIG_SMP
	struct cpuinfo_x86 *c = &cpu_data(cpu);
	struct cpuinfo_x86 *c = &cpu_data(cpu);
#endif

	/*
	 * CPUID.06H.EAX[0] indicates whether the CPU has thermal
	 * sensors. We check this bit only, all the early CPUs
	 * without thermal sensors will be filtered out.
	 */
	if (!cpu_has(c, X86_FEATURE_DTS)) {
		printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
		       " has no thermal sensor.\n", c->x86_model);
		return 0;
	}


	mutex_lock(&pdev_list_mutex);
	mutex_lock(&pdev_list_mutex);


@@ -482,14 +491,22 @@ exit:


static void coretemp_device_remove(unsigned int cpu)
static void coretemp_device_remove(unsigned int cpu)
{
{
	struct pdev_entry *p, *n;
	struct pdev_entry *p;
	unsigned int i;

	mutex_lock(&pdev_list_mutex);
	mutex_lock(&pdev_list_mutex);
	list_for_each_entry_safe(p, n, &pdev_list, list) {
	list_for_each_entry(p, &pdev_list, list) {
		if (p->cpu == cpu) {
		if (p->cpu != cpu)
			continue;

		platform_device_unregister(p->pdev);
		platform_device_unregister(p->pdev);
		list_del(&p->list);
		list_del(&p->list);
		mutex_unlock(&pdev_list_mutex);
		kfree(p);
		kfree(p);
		}
		for_each_cpu(i, cpu_sibling_mask(cpu))
			if (i != cpu && !coretemp_device_add(i))
				break;
		return;
	}
	}
	mutex_unlock(&pdev_list_mutex);
	mutex_unlock(&pdev_list_mutex);
}
}
@@ -527,30 +544,21 @@ static int __init coretemp_init(void)
	if (err)
	if (err)
		goto exit;
		goto exit;


	for_each_online_cpu(i) {
	for_each_online_cpu(i)
		struct cpuinfo_x86 *c = &cpu_data(i);
		/*
		 * CPUID.06H.EAX[0] indicates whether the CPU has thermal
		 * sensors. We check this bit only, all the early CPUs
		 * without thermal sensors will be filtered out.
		 */
		if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))
		coretemp_device_add(i);
		coretemp_device_add(i);
		else {

			printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
#ifndef CONFIG_HOTPLUG_CPU
				" has no thermal sensor.\n", c->x86_model);
		}
	}
	if (list_empty(&pdev_list)) {
	if (list_empty(&pdev_list)) {
		err = -ENODEV;
		err = -ENODEV;
		goto exit_driver_unreg;
		goto exit_driver_unreg;
	}
	}
#endif


	register_hotcpu_notifier(&coretemp_cpu_notifier);
	register_hotcpu_notifier(&coretemp_cpu_notifier);
	return 0;
	return 0;


exit_driver_unreg:
#ifndef CONFIG_HOTPLUG_CPU
#ifndef CONFIG_HOTPLUG_CPU
exit_driver_unreg:
	platform_driver_unregister(&coretemp_driver);
	platform_driver_unregister(&coretemp_driver);
#endif
#endif
exit:
exit:
Loading