aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon/via-cputemp.c
AgeCommit message (Collapse)AuthorFilesLines
2020-03-24hwmon: Convert to new X86 CPU match macrosThomas Gleixner1-4/+4
The new macro set has a consistent namespace and uses C99 initializers instead of the grufty C89 ones. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 164Thomas Gleixner1-14/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 12 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-02-18hwmon: (via-cputemp) Use permission specific SENSOR[_DEVICE]_ATTR variantsGuenter Roeck1-8/+7
Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readability, and to reduce the chance of inconsistencies. Also replace any remaining S_<PERMS> in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck <[email protected]>
2018-03-30hwmon: (via-cputemp) support new centaur CPUsdavidwang1-13/+18
New centaur CPUs (Familiy == 7) also support this cpu temperature sensor. Signed-off-by: David Wang <[email protected]> [groeck: Dropped changelog, updated subject] Signed-off-by: Guenter Roeck <[email protected]>
2017-01-02hwmon: (via-cputemp) use permission-specific DEVICE_ATTR variantsJulia Lawall1-3/+3
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 <[email protected]> [groeck: Updated description] Signed-off-by: Guenter Roeck <[email protected]>
2016-12-09hwmon: (via-cputemp) Convert to hotplug state machineSebastian Andrzej Siewior1-46/+17
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 <[email protected]> Cc: Guenter Roeck <[email protected]> Cc: [email protected] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2016-12-02hwmon: (via-cputemp) Remove pointless CPU check on each CPUThomas Gleixner1-15/+1
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 <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2014-10-20hwmon: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-03-20hwmon, via-cputemp: Fix CPU hotplug callback registrationSrivatsa S. Bhat1-7/+7
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 <[email protected]> Cc: Ingo Molnar <[email protected]> Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Srivatsa S. Bhat <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2013-07-14hwmon: delete __cpuinit usage from all hwmon filesPaul Gortmaker1-4/+4
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 <[email protected]> Cc: [email protected] Acked-by: Guenter Roeck <[email protected]> Signed-off-by: Paul Gortmaker <[email protected]>
2012-11-28hwmon: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28hwmon: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Alistair John Strachan <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: Juerg Haefliger <[email protected]> Cc: Andreas Herrmann <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Jim Cromie <[email protected]> Cc: "Mark M. Hoffman" <[email protected]> Cc: Roger Lucas <[email protected]> Acked-by: Guenter Roeck <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-23hwmon: (via-cputemp) Convert to use devm_ functionsGuenter Roeck1-16/+7
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: (via-cputemp) Use get_online_cpus to avoid races involving CPU hotplugSilas Boyd-Wickizer1-0/+5
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 <[email protected]> Acked-by: Harald Welte <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2012-07-30hwmon: struct x86_cpu_id arrays can be __initconstJan Beulich1-1/+1
... as being referenced from __init code only. Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2012-01-26HWMON: Convert via-cputemp to x86 cpuid autoprobingAndi Kleen1-5/+11
Use the new x86 cpuid autoprobe interface. Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Thomas Renninger <[email protected]> Acked-by: H. Peter Anvin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2011-07-25hwmon: (via-cputemp) Add VID reporting supportJean Delvare1-5/+39
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 <[email protected]> Acked-by: Guenter Roeck <[email protected]> Tested-by: Jeff Rickman <[email protected]>
2011-01-08hwmon: (via-cputemp) sync hotplug handling with coretemp/pkgtempJan Beulich1-14/+11
Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2011-01-08hwmon: (via-cputemp) Use pr_fmt and pr_<level>Joe Perches1-5/+5
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 <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2010-10-25hwmon: ({core, pkg, via-cpu}temp) remove unnecessary CONFIG_HOTPLUG_CPU ifdefsChen Gong1-6/+1
CONFIG_HOTPLUG_CPU is used too much in some drivers. This patch clean them up. Signed-off-by: Chen Gong <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2010-10-25x86/hwmon: remove inclusion of unnecessary headers from {core, pkg, ↵Jan Beulich1-2/+0
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 <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2010-10-25x86/hwmon: {core, pkg, via}cpu_temp_device_remove() can all be __cpuinitJan Beulich1-1/+1
... as they're being called only from a __cpuinit function. Signed-off-by: Jan Beulich <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2010-08-14hwmon: (via-cputemp) Remove bogus "SHOW" global variableH. Peter Anvin1-1/+1
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 <[email protected]> Acked-by: Harald Welte <[email protected]> Cc: Juerg Haefliger <[email protected]> Signed-off-by: Jean Delvare <[email protected]>
2009-12-16hwmon: Add driver for VIA CPU core temperatureHarald Welte1-0/+356
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 <[email protected]> Cc: Juerg Haefliger <[email protected]> Signed-off-by: Jean Delvare <[email protected]> Tested-by: Adam Nielsen <[email protected]>