summaryrefslogtreecommitdiff
path: root/drivers/hwmon/via-cputemp.c
AgeCommit message (Collapse)Author
2018-03-30hwmon: (via-cputemp) support new centaur CPUsdavidwang
New centaur CPUs (Familiy == 7) also support this cpu temperature sensor. Signed-off-by: David Wang <davidwang@zhaoxin.com> [groeck: Dropped changelog, updated subject] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2017-01-02hwmon: (via-cputemp) use permission-specific DEVICE_ATTR variantsJulia Lawall
Use DEVICE_ATTR_RO for read-only attributes. This simplifies the source code, improves readbility, and reduces the chance of inconsistencies. The conversion was done automatically using coccinelle. It was validated by compiling both the old and the new source code and comparing its text, data, and bss size. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> [groeck: Updated description] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-12-09hwmon: (via-cputemp) Convert to hotplug state machineSebastian Andrzej Siewior
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. When the hotplug state is unregistered the cleanup function is called for each cpu. So both cpu loops in init() and exit() are not longer required. Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Cc: linux-hwmon@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2016-12-02hwmon: (via-cputemp) Remove pointless CPU check on each CPUThomas Gleixner
The check loop for the cpu type is pointless as we already have a cpu model match before that. The only thing which is not covered by that check would be a smp system with two different cores. Not likely to happen. Cc: Jean Delvare <jdelvare@suse.com> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2014-10-20hwmon: drop owner assignment from platform_driversWolfram Sang
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-03-20hwmon, via-cputemp: Fix CPU hotplug callback registrationSrivatsa S. Bhat
Subsystems that want to register CPU hotplug callbacks, as well as perform initialization for the CPUs that are already online, often do it as shown below: get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu); register_cpu_notifier(&foobar_cpu_notifier); put_online_cpus(); This is wrong, since it is prone to ABBA deadlocks involving the cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently with CPU hotplug operations). Instead, the correct and race-free way of performing the callback registration is: cpu_notifier_register_begin(); for_each_online_cpu(cpu) init_cpu(cpu); /* Note the use of the double underscored version of the API */ __register_cpu_notifier(&foobar_cpu_notifier); cpu_notifier_register_done(); Fix the hwmon via-cputemp code by using this latter form of callback registration. Cc: Jean Delvare <jdelvare@suse.de> Cc: Ingo Molnar <mingo@kernel.org> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2013-07-14hwmon: delete __cpuinit usage from all hwmon filesPaul Gortmaker
The __cpuinit type of throwaway sections might have made sense some time ago when RAM was more constrained, but now the savings do not offset the cost and complications. For example, the fix in commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time") is a good example of the nasty type of bugs that can be created with improper use of the various __init prefixes. After a discussion on LKML[1] it was decided that cpuinit should go the way of devinit and be phased out. Once all the users are gone, we can then finally remove the macros themselves from linux/init.h. This removes all the drivers/hwmon uses of the __cpuinit macros from all C files. [1] https://lkml.org/lkml/2013/5/20/589 Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: lm-sensors@lm-sensors.org Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-11-28hwmon: remove use of __devexitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28hwmon: remove use of __devinitBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28hwmon: remove use of __devexit_pBill Pemberton
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Alistair John Strachan <alistair@devzero.co.uk> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Andreas Herrmann <herrmann.der.user@googlemail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Jim Cromie <jim.cromie@gmail.com> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Roger Lucas <vt8231@hiddenengine.co.uk> Acked-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-23hwmon: (via-cputemp) Convert to use devm_ functionsGuenter Roeck
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-09-23hwmon: (via-cputemp) Use get_online_cpus to avoid races involving CPU hotplugSilas Boyd-Wickizer
via_cputemp_init loops with for_each_online_cpu, adding platform_devices, then calls register_hotcpu_notifier. If a CPU is offlined between the loop and register_hotcpu_notifier, then later onlined, via_cputemp_device_add will attempt to add platform devices with the same ID. A similar race occurs during via_cputemp_exit, after the module calls unregister_hotcpu_notifier, a CPU might offline and a device will exist for a CPU that is offline. This fix surrounds for_each_online_cpu and register_hotcpu_notifier with get_online_cpus+put_online_cpus; and surrounds unregister_hotcpu_notifier and device unregistering with get_online_cpus+put_online_cpus. Build tested. Signed-off-by: Silas Boyd-Wickizer <sbw@mit.edu> Acked-by: Harald Welte <laforge@gnumonks.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-07-30hwmon: struct x86_cpu_id arrays can be __initconstJan Beulich
... as being referenced from __init code only. Signed-off-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2012-01-26HWMON: Convert via-cputemp to x86 cpuid autoprobingAndi Kleen
Use the new x86 cpuid autoprobe interface. Cc: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Thomas Renninger <trenn@suse.de> Acked-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-25hwmon: (via-cputemp) Add VID reporting supportJean Delvare
At least VIA family 6 model D CPU report the VID settings in a MSR, so expose the value to user-space. Not sure about model A. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Tested-by: Jeff Rickman <jrickman@myamigos.us>
2011-01-08hwmon: (via-cputemp) sync hotplug handling with coretemp/pkgtempJan Beulich
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2011-01-08hwmon: (via-cputemp) Use pr_fmt and pr_<level>Joe Perches
Added #define pr_fmt KBUILD_MODNAME ": " fmt Converted printks to pr_<level> Coalesced any long formats Removed prefixes from formats Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-25hwmon: ({core, pkg, via-cpu}temp) remove unnecessary CONFIG_HOTPLUG_CPU ifdefsChen Gong
CONFIG_HOTPLUG_CPU is used too much in some drivers. This patch clean them up. Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-25x86/hwmon: remove inclusion of unnecessary headers from {core, pkg, ↵Jan Beulich
via-cpu}temp.c These likely originate from these drivers being clones of one another and/or other drivers which actually needed these includes. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-10-25x86/hwmon: {core, pkg, via}cpu_temp_device_remove() can all be __cpuinitJan Beulich
... as they're being called only from a __cpuinit function. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2010-08-14hwmon: (via-cputemp) Remove bogus "SHOW" global variableH. Peter Anvin
The via-cputemp hwmon driver was probably intending "typedef enum { ... } SHOW;", but the "typedef" was missing creating a global variable named "SHOW". There is absolutely no reason to have this in the global namespace. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Acked-by: Harald Welte <HaraldWelte@viatech.com> Cc: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-16hwmon: Add driver for VIA CPU core temperatureHarald Welte
This is a driver for the on-die digital temperature sensor of VIA's recent CPU models. [JD: Misc clean-ups.] Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Cc: Juerg Haefliger <juergh@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Adam Nielsen <a.nielsen@shikadi.net>