]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (coretemp) Simplify sibling management
authorThomas Gleixner <tglx@linutronix.de>
Tue, 22 Nov 2016 17:42:02 +0000 (17:42 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 10 Dec 2016 05:54:07 +0000 (21:54 -0800)
commite1b370b64031a01bb0c4158ce250073a88921fe1
treed35a9a417f318f1f474f083398c760019d8523c3
parent723f573433b2900f1d4539b8eb0d24cd17a42c65
hwmon: (coretemp) Simplify sibling management

The coretemp driver provides a sysfs interface per physical core. If
hyperthreading is enabled and one of the siblings goes offline the sysfs
interface is removed and then immeditately created again for the
sibling. The only difference of them is the target cpu for the
rdmsr_on_cpu() in the sysfs show functions.

It's way simpler to keep a cpumask of cpus which are active in a package
and only remove the interface when the last sibling goes offline. Otherwise
just move the target cpu for the sysfs show functions to the still online
sibling.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/coretemp.c