[go: nahoru, domu]

History log of /drivers/hwmon/coretemp.c
Revision Date Author Comments
c0940e95f7a78be0525c8d31df0b1f71e149e57e 30-Apr-2014 Guenter Roeck <linux@roeck-us.net> Revert "hwmon: (coretemp) Refine TjMax detection"

This reverts commit 9fb6c9c73b11bef65ba80a362547fd116c1e1c9d.

Tjmax on some Intel CPUs is below 85 degrees C. One known example is
L5630 with Tjmax of 71 degrees C. There are other Xeon processors with
Tjmax of 70 or 80 degrees C. Also, the Intel IA32 System Programming
document states that the temperature target is in bits 23:16 of MSR 0x1a2
(MSR_TEMPERATURE_TARGET), which is 8 bits, not 7.

So even if turbostat uses similar checks to validate Tjmax, there is no
evidence that the checks are actually required. On the contrary, the
checks are known to cause problems and therefore need to be removed.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75071.

Fixes: 9fb6c9c hwmon: (coretemp) Refine TjMax detection
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Cc: stable@vger.kernel.org # 3.14+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
3289705fe2b429569f37730ecf660719b8924420 10-Mar-2014 Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> hwmon, coretemp: Fix CPU hotplug callback registration

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 coretemp code by using this latter form of callback
registration.

Cc: Fenghua Yu <fenghua.yu@intel.com>
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>
d72d19c26c417d514787ae85b197af34de286c0a 17-Feb-2014 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Convert to use devm_hwmon_device_register_with_groups

Simplify code, reduce code size, and attach sysfs attributes to hwmon device.

For this driver, the only attribute created is the name attribute.
Other attributes are still created and removed dynamically as cores
are added or removed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
c503a811e44f4a861e3db0540dd7d4f2146a10f2 17-Feb-2014 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Allocate platform data with devm_kzalloc

This simplifies error handling.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
1075305de47d8ebf909acd3d52cade78b9e8f160 16-Feb-2014 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Use sysfs_create_group to create sysfs attributes

Instead of creating each attribute individually, use sysfs_create_group
to create all attributes for one core with a single call.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
bf6ea084ebb54cf8e1d6e60aac3c727cf45bf6c7 20-Nov-2013 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Do not return -EAGAIN for low temperatures

Some Intel CPUs do not set the 'valid' bit in IA32_THERM_STATUS if the
temperature is too low to be measured. This condition will not change until
the CPU is hot enough for its temperature to be measured. Returning an error
in such conditions is not very useful. Drop checking the valid bit and just
return the reported temperature instead.

Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
9fb6c9c73b11bef65ba80a362547fd116c1e1c9d 09-Nov-2013 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Refine TjMax detection

Intel's turbostat code uses only 7 bits from MSR_IA32_TEMPERATURE_TARGET to
read TjMax, and also only accepts it if the reported temperature is at least
85 degrees C. Play safe and do the same.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
347c16cfdecf9b4cfb94137b47bf6a05b3ff57d5 27-May-2013 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Add PCI device ID for CE41x0 CPUs

Since we now have to use PCI IDs to detect CPU types anyway, use this mechanism
to detect CE41x0 CPUs. Advantage is that it only requires a single entry and
covers all variants of CE41x0, including those unknown to us.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
14513ee696a0cd12a19318e433b75a786808adc3 27-May-2013 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Use PCI host bridge ID to identify CPU if necessary

Atom S12x0 CPUs are identified by the CPU host bridge ID. Add an override
table based on PCI IDs as well as code to detect it.

PCI access functions can now be called with PCI disabled, so unlike previous
attempts to use PCI IDs, the code no longer depends on it. If PCI is disabled,
the CPU will not be identified correctly. Since it is unlikely that anything
will work in this case, this is an acceptable limitation.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
3f9aec7610b39521c7c69d754de7265f6994c194 14-Jan-2014 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Fix truncated name of alarm attributes

When the core number exceeds 9, the size of the buffer storing the
alarm attribute name is insufficient and the attribute name is
truncated. This causes libsensors to skip these attributes as the
truncated name is not recognized.

Reported-by: Andreas Hollmann <hollmann@in.tum.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1c2faa22472fedf2c420041033700c700a1dfc96 27-May-2013 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Atom CPUs don't support TjMax; no warning needed

Display warning "Unable to read TjMax from CPU x" only if the CPU
is supposed to support it. This is not the case for the various Atom CPUs.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
d23e2ae1aae52bb80bd90525179375817db99809 19-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> hwmon: delete __cpuinit usage from all hwmon files

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>
807f730105e986b3b2da711cfd94f22b92532f79 03-May-2013 Sachin Kamat <sachin.kamat@linaro.org> hwmon: (coretemp) Remove redundant platform_set_drvdata()

Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
b55f375725ff85aada394da488802b0a3cc99e88 10-Jan-2013 Guenter Roeck <linux@roeck-us.net> hwmon: Fix checkpatch warning 'quoted string split across lines'

Cc: Corentin Labbe <corentin.labbe@geomatys.fr>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Juerg Haefliger <juergh@gmail.com>
Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Jim Cromie <jim.cromie@gmail.com>
Cc: Roger Lucas <vt8231@hiddenengine.co.uk>
Cc: Marc Hulsman <m.hulsman@tudelft.nl>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
9e3970fba9ea43bc2c215f71f78bcf766c1775e7 17-Nov-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Document and add support for additional CPU models

Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
3e280ba08ad69e8c3ac7e5b0468c24d5be98c3fd 09-Oct-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Drop N4xx, N5xx, D4xx, D5xx CPUs from tjmax table

Since N4xx, N5xx, D4xx, and D5xx are now reliably detected using the model ID
and the stepping/mask, drop the respective entries from tjmax_table.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
2fa5222efeb4a76597ceace21c0435d49a34715e 09-Oct-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Use model table instead of if/else to identify CPU models

Make the code easier to extend and easier to adjust by using a model table
listing CPU models, stepping/mask, and associated TjMax.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
72cbdddcc158fa52056619b81624df0cd9125a26 09-Oct-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Drop dependency on PCI for TjMax detection on Atom CPUs

So far, we use the NM10 Express Chipset PCI chip ID to detect TjMax for
Atom CPUs with model 0x1c. As it turns out, we can use the CPU stepping
(x86_mask) for the same purpose; stepping is 10 for all model 0x1c CPUs
with TjMax of 100 degrees C. This was verified by checking the output of
/proc/cpuinfo for the respective CPUs (D4xx, D5xx, N4xx, N5xx).

Other CPUs currently covered by the same code (Exx, Z6xx, Z2460) are not
supported by the NM10 Express Chipset. Most of those CPUs have TjMax of 90
degrees C, except for E6xxT models which have a TjMax of 110 degrees C.
E6xxT CPUs can however not be detected by software.

Calculate TjMax for Atom CPUs as follows. Note that the listed values are not
correct in some cases (230, 330). tjmax_table is used for those to override
the default values.

ID Stepping TjMax Models
0x1c 10 100 D4xx, N4xx, D5xx, N5xx
0x1c not 10 90 Z5xx, N2xx, 230, 330, others
0x26 - 90 Atom Tunnel Creek (Exx),
Lincroft (Z6xx)
0x27 - 90 Atom Medfield (Z2460)
0x36 - 100 Atom Cedar Trail (N2xxx, D2xxx)

Also drop the module dependency on PCI.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
281dfd0b6ed5403f5b9b1669f2a37a4f8cfc11c1 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> hwmon: remove use of __devexit

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>
6c931ae1c09a9618852c9619dac71f1f77776e3b 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> hwmon: remove use of __devinit

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>
9e5e9b7a92e4e2e4ac1f0d6aa181639637660e45 19-Nov-2012 Bill Pemberton <wfp5p@virginia.edu> hwmon: remove use of __devexit_p

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>
1102dcab849313bd5a340b299b5cf61b518fbc0f 09-Oct-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Add support for Atom CE4110/4150/4170

TjMax for the CE4100 series of Atom CPUs was previously reported to be
110 degrees C.

cpuinfo logs on the web show existing CPU types CE4110, CE4150, and CE4170,
reported as "model name : Intel(R) Atom(TM) CPU CE41{1|5|7}0 @ 1.{2|6}0GHz"
with model 28 (0x1c) and stepping 10 (0x0a). Add the three known variants
to the tjmax table.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
cc: stable@vger.kernel.org
Acked-by: Jean Delvare <khali@linux-fr.org>
641f14560035bbb86500ea4b3a27ad27f034725b 23-Sep-2012 Silas Boyd-Wickizer <sbw@mit.edu> hwmon: (coretemp) Use get_online_cpus to avoid races involving CPU hotplug

coretemp_init loops with for_each_online_cpu, adding platform_devices
and sysfs interfaces, then calls register_hotcpu_notifier. There is a
race if a CPU is offlined or onlined after the loop, but before
register_hotcpu_notifier. The race might result in the absence of a
platform_device+sysfs interface for an online CPU, or the presence of
a platform_device+sysfs interface for an offline CPU. A similar race
occurs during coretemp_exit, after the module calls
unregister_hotcpu_notifier, but before it unregisters all devices, a
CPU might offline and a device for an offline CPU will exist for a
short while.

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>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
64f503076f9921fc714a2c79fb0fa520869d2c08 18-Aug-2012 Andi Kleen <ak@linux.intel.com> sections: Fix section conflicts in drivers/hwmon

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
e273bd98c9170c33456c948df878a1d696ede959 30-Jul-2012 Jan Beulich <JBeulich@suse.com> hwmon: struct x86_cpu_id arrays can be __initconst

... as being referenced from __init code only.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
4ad33411308596f2f918603509729922a1ec4411 22-Jun-2012 H. Peter Anvin <hpa@linux.intel.com> x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERM

It makes sense to label "Digital Thermal Sensor" as "DTS", but
unfortunately the string "dts" was already used for "Debug Store", and
/proc/cpuinfo is a user space ABI.

Therefore, rename this to "dtherm".

This conflict went into mainline via the hwmon tree without any x86
maintainer ack, and without any kind of hint in the subject.

a4659053 x86/hwmon: fix initialization of coretemp

Reported-by: Jean Delvare <khali@linux-fr.org>
Link: http://lkml.kernel.org/r/4FE34BCB.5050305@linux.intel.com
Cc: Jan Beulich <JBeulich@suse.com>
Cc: <stable@vger.kernel.org> v2.6.36..v3.4
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1268a172cdb00353f107e6cc964dccff29047077 17-Jun-2012 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Drop needless initialization

The value is overridden a few lines later.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
41e58a1f2b90c88d94b4bd84beb9927a4c2704e9 17-Jun-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Improve support for TjMax detection on Atom CPUs

Atom CPUs don't have a register to retrieve TjMax. Detection so far was
incomplete. Use the X86 model ID to improve it.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
5592906f8b01282ea3c2acaf641fd067ad4bb3dc 17-Jun-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Add support for Atom D2000 and N2000 series CPU models

Document the Atom series D2000 and N2000 (Cedar Trail) as being supported.
List and set TjMax for those series.

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fcc14ac1a86931f38da047cf8fb634c6db7b58bc 17-Jun-2012 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Improve support of recent Atom CPU models

Document the new Atom series (Tunnel Creek and Medfield) as being
supported, and list TjMax for the Atom E600 series.

Also enable the Atom tjmax heuristic for these Atom CPU models.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Reviewed-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
bdc71c9a87b898e4c380c23b2e3e18071312ecde 01-May-2012 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Increase CPU core limit

CPU core ID is used to index the core_data[] array. The core ID is, however, not
sequential; 10-core CPUS can have a core ID as high as 25. Increase the limit to
32 to be able to deal with current CPUs.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@vger.kernel.org # 3.0+
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
b704871124b477807966f06789c2b32f2de58bf7 30-Apr-2012 Kirill A. Shutemov <kirill.shutemov@linux.intel.com> hwmon: (coretemp) fix oops on cpu unplug

coretemp tries to access core_data array beyond bounds on cpu unplug if
core id of the cpu if more than NUM_REAL_CORES-1.

BUG: unable to handle kernel NULL pointer dereference at 000000000000013c
IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
PGD 673e5a067 PUD 66e9b3067 PMD 0
Oops: 0000 [#1] SMP
CPU 79
Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile]

Pid: 3315, comm: set-cpus Tainted: G W 3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R
RIP: 0010:[<ffffffffa00159af>] [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP: 0018:ffff880472fb3d48 EFLAGS: 00010246
RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff
RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246
RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001
R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800
R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000
FS: 00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000)
Stack:
ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005
0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14
ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034
Call Trace:
[<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70
[<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10
[<ffffffff81059d30>] __cpu_notify+0x20/0x40
[<ffffffff815fa251>] _cpu_down+0x81/0x270
[<ffffffff815fa477>] cpu_down+0x37/0x50
[<ffffffff815fd6a3>] store_online+0x63/0xc0
[<ffffffff813c7078>] dev_attr_store+0x18/0x30
[<ffffffff811f02cf>] sysfs_write_file+0xef/0x170
[<ffffffff81180443>] vfs_write+0xb3/0x180
[<ffffffff8118076a>] sys_write+0x4a/0x90
[<ffffffff816236a9>] system_call_fastpath+0x16/0x1b
Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28
RIP [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP <ffff880472fb3d48>
CR2: 000000000000013c

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: stable@vger.kernel.org # 3.0+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
780affe0e9162bd6aec8acdb6255d61e4b04abba 20-Jan-2012 Guenter Roeck <linux@roeck-us.net> hwmon: (coretemp) Fix checkpatch error

Fix:
ERROR: Macros with complex values should be enclosed in parenthesis

Cc: Fenghua Yu <fenghua.yu@intel.com>
Acked-By: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
9b38096fde5f9b93c3657911c3be7892cc155cbd 26-Jan-2012 Andi Kleen <ak@linux.intel.com> HWMON: Convert coretemp to x86 cpuid autoprobing

Use the new x86 cpuid autoprobe interface for the Intel coretemp
driver.

Cc: Fenghua Yu <fenghua.yu@intel.com>
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>
d6db23c7ce8d02896197394c1d741bdffe58ac54 16-Jan-2012 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Add missing section annotations

Many functions in the coretemp driver lack a proper section
annotation. Add them to let the kernel free the memory after
initialization when possible.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
141168c36cdee3ff23d9c7700b0edc47cb65479f 21-Dec-2011 Kevin Winchester <kjwinchester@gmail.com> x86: Simplify code by removing a !SMP #ifdefs from 'struct cpuinfo_x86'

Several fields in struct cpuinfo_x86 were not defined for the
!SMP case, likely to save space. However, those fields still
have some meaning for UP, and keeping them allows some #ifdef
removal from other files. The additional size of the UP kernel
from this change is not significant enough to worry about
keeping up the distinction:

text data bss dec hex filename
4737168 506459 972040 6215667 5ed7f3 vmlinux.o.before
4737444 506459 972040 6215943 5ed907 vmlinux.o.after

for a difference of 276 bytes for an example UP config.

If someone wants those 276 bytes back badly then it should
be implemented in a cleaner way.

Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
Cc: Steffen Persvold <sp@numascale.com>
Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2aba6cac2a84f3b80e11a680c34d55e7739b474d 06-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Fix for non-SMP builds

The definition of TO_ATTR_NO in the non-SMP case is wrong. As the SMP
definition resolves to the correct value, just use this for both
cases.

Without this fix the temperature attributes are named temp0_* instead
of temp2_*, so libsensors won't pick them. Broken since kernel 3.0.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Phil Sutter <phil@nwl.cc>
Cc: stable@kernel.org
Acked-by: Durgadoss R <Durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
ca8bc8dc044793ee4d59ff7fe40138eee27d0325 13-Oct-2011 Andi Kleen <ak@linux.intel.com> coretemp: Get microcode revision from cpu_data

Now that the ucode revision is available in cpu_data remove
the existing code in coretemp.c to query it manually. Read the
ucode revision from cpu_data instead

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: jbeulich@novell.com
Cc: fenghua.yu@intel.com
Cc: khali@linux-fr.org
Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
20ecb499f64a7e8e7fe03f6098ab25c71b7a6481 25-Sep-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Avoid leaving around dangling pointer

Storing the struct temp_data pointer allocated from create_core_data()
when returning an error has the potential of leaving around a pointer
to freed memory. Reset it to NULL for error returns.

Reported-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
0eb9782ad9b1bd496ba61cd5ea27ccb8db21e885 28-Sep-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Fixup platform device ID change

With recent change "hwmon: (coretemp) don't use kernel assigned CPU
number as platform device ID", the microcode check is now running on
random CPU. Fix that by checking the microcode before creating the
platform device rather than at probe time.

Also avoid calling TO_PHYS_ID(cpu) twice in the same function, it's
expensive.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
2f1c3db0a6adcfd12d556afa3605d4923658b307 23-Sep-2011 Jan Beulich <JBeulich@suse.com> hwmon: (coretemp) remove struct platform_data * parameter from create_core_data()

The only caller of the function obtained the pointer solely for the
purpose of passing it to this function, while it can be easily
determined from the struct platform_device * parameter also passed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
e3204ed3a4a78ca4d10eee8b661b94429bd38da8 23-Sep-2011 Jan Beulich <JBeulich@suse.com> hwmon: (coretemp) constify static data

These arrays won't ever be written to, so protect them from
unintentional modification.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
b3a242a6e4b8c09dbb466ab7a9d2c724e75faa67 23-Sep-2011 Jan Beulich <JBeulich@suse.com> hwmon: (coretemp) don't use kernel assigned CPU number as platform device ID

... as that has the potential to conflict with (particularly soft) CPU
hot removal and re-adding.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
[guenter.roeck@ericsson.com: use platform device ID as physical CPU id]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
f4af6fd6e21792ca4deca3d29c113a575594078e 20-Sep-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Don't use threshold registers for tempX_max

With commit c814a4c7c4aad795835583344353963a0a673eb0, the meaning of tempX_max
was changed. It no longer returns the value of bits 8:15 of
MSR_IA32_TEMPERATURE_TARGET, but instead returns the value of CPU threshold
register T1. tempX_max_hyst was added to reflect the value of temperature
threshold register T0.

As it turns out, T0 and T1 are used on some systems, presumably by the BIOS.
Also, T0 and T1 don't have a well defined meaning. The thresholds may be used
as upper or lower limits, and it is not guaranteed that T0 <= T1. Thus, the new
attribute mapping does not reflect the actual usage of the threshold registers.
Also, register contents are changed during runtime by an entity other than the
hwmon driver, meaning the values cached by the driver do not reflect actual
register contents.

Revert most of c814a4c7c4aad795835583344353963a0a673eb0 to address the problem.
Support for T0 and T1 will be added back in with a separate commit, using new
attribute names.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
a45a8c8571c0be6a6bd72ae5a14255c26b14b504 16-Sep-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Let the user force TjMax

On old CPUs (and even some recent Atom CPUs) TjMax can't be read from
the CPU registers, so it is guessed by the driver using a complex
heuristic which isn't reliable. So let users who know their CPU's
TjMax pass it as a module parameter.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
6bf9e9b09c3abb5447bbbf16c2d0cbe721e44f3f 16-Sep-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Drop duplicate function get_pkg_tjmax

Function get_pkg_tjmax is a simplified copy of get_tjmax. Drop it and
always use get_tjmax, result is the same and this avoids code
duplication.

Also make get_tjmax less verbose: don't warn about MSR read failure
when failure was expected, and don't report TjMax in the logs unless
debugging is enabled.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
cd5bd3df1a6e7a68454734fb109c409101c20f42 14-Sep-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Initialize tmin

ttarget is initialized when the driver is loaded, but tmin is not.
As a result, tempX_max_hyst attributes read 0. Fix this.

Also use THERM_*_THRESHOLD* constants in these initializations instead
of hard-coding the constants.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: "R, Durgadoss" <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
c814a4c7c4aad795835583344353963a0a673eb0 12-Jul-2011 Durgadoss R <durgadoss.r@intel.com> hwmon: (coretemp) Add core/pkg threshold support to Coretemp

This patch adds the core and pkg support to coretemp.
These thresholds can be configured via the sysfs interfaces tempX_max
and tempX_max_hyst. An interrupt is generated when CPU temperature reaches
or crosses above tempX_max OR drops below tempX_max_hyst.

This patch is based on the documentation in IA Manual vol 3A, that can be
downloaded from here:
http://download.intel.com/design/processor/manuals/253668.pdf

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
808b4e639eb00394de9989fabca23196c337ee75 07-Jun-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Drop unused struct members

pdev_entry.cpu and pdev_entry.cpu_core_id aren't used anywhere in the
driver code so we can drop these struct members.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
bb9973e4e73f43bd86698483d0c3f7a362ff94ce 01-Jun-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Further relax temperature range checks

Further relax temperature range checks after reading the IA32_TEMPERATURE_TARGET
register. If the register returns a value other than 0 in bits 16..32, assume
that the returned value is correct.

This change applies to both packet and core temperature limits.

Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
4f5f71a7abe329bdad81ee6a8e4545054a7cc30a 31-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Fix TjMax detection for older CPUs

Commit a321cedb12904114e2ba5041a3673ca24deb09c9 excludes CPU models 0xe, 0xf,
0x16, and 0x1a from TjMax temperature adjustment, even though several of those
CPUs are known to have TiMax other than 100 degrees C, and even though the code
in adjust_tjmax() explicitly handles those CPUs and points to a Web document
listing several of the affected CPU IDs.

Reinstate original TjMax adjustment if TjMax can not be determined using the
IA32_TEMPERATURE_TARGET register.

https://bugzilla.kernel.org/show_bug.cgi?id=32582

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Huaxu Wan <huaxu.wan@linux.intel.com>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Yong Wang <yong.y.wang@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Tested-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Cc: <stable@kernel.org> # .35.x .36.x .37.x .38.x .39.x
4c6e0f8101e62d8b2d01dc94b835a98b191a1454 31-May-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Relax target temperature range check

The current temperature range check of MSR_IA32_TEMPERATURE_TARGET
seems too strict to me, some TjMax values documented in
Documentation/hwmon/coretemp wouldn't pass. Relax the check so that
all the documented values pass.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
582e1b270f6db93007f9af86d4f28fdad3da0505 26-May-2011 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Fix section mismatch

chk_ucode_version() is only called from coretemp_probe() which is
__devinit, so it can be marked __devinit too.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
6777b9e47e4daf7116ec12b69e9b5cc980809217 23-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Update comments describing the handling of HT CPUs

Update comments describing the handling of HT CPUs based on review feedback.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
4258781ac720ff8f2fa6c34c1bd06a0cb8562188 24-May-2011 Sergey Senozhatsky <sergey.senozhatsky@gmail.com> hwmon: (coretemp) Initialize sysfs attributes

Initialize sysfs attrs before device_create_file() call to suppress lockdep_init_map()
warning:

[ 3.653628] WARNING: at kernel/lockdep.c:2885 lockdep_init_map+0xea/0x43c()
[ 3.653698] Modules linked in:
[ 3.654835] Pid: 1, comm: swapper Not tainted 2.6.39-dbg-git8-05624-g46187f8 #576
[ 3.656014] Call Trace:
[ 3.657139] [<ffffffff8103e4b4>] warn_slowpath_common+0x7e/0x96
[ 3.658298] [<ffffffff8103e4e1>] warn_slowpath_null+0x15/0x17
[ 3.659460] [<ffffffff8106d7b9>] lockdep_init_map+0xea/0x43c
[ 3.660616] [<ffffffff81163c1a>] sysfs_add_file_mode+0x5d/0xa8
[ 3.661785] [<ffffffff81163c71>] sysfs_add_file+0xc/0xe
[ 3.662929] [<ffffffff81163d26>] sysfs_create_file+0x23/0x25
[ 3.664045] [<ffffffff813724d1>] device_create_file+0x14/0x16
[ 3.665172] [<ffffffff81460ed4>] coretemp_probe+0xf9/0x185
[ 3.666306] [<ffffffff8137638e>] platform_drv_probe+0x12/0x14
[ 3.667420] [<ffffffff81375321>] driver_probe_device+0xb0/0x14b
[ 3.668542] [<ffffffff8137546d>] __device_attach+0x35/0x3a
[ 3.669710] [<ffffffff81375438>] ? __driver_attach+0x7c/0x7c
[ 3.670816] [<ffffffff8137426b>] bus_for_each_drv+0x54/0x88
[ 3.671921] [<ffffffff81375231>] device_attach+0x77/0x9b
[ 3.673027] [<ffffffff81374aef>] bus_probe_device+0x22/0x39
[ 3.674137] [<ffffffff81373235>] device_add+0x3c1/0x550
[ 3.675249] [<ffffffff81371ed9>] ? dev_set_name+0x3c/0x3e
[ 3.676371] [<ffffffff813769f3>] platform_device_add+0x10c/0x156
[ 3.677491] [<ffffffff8146af9c>] get_core_online+0xab/0x16e
[ 3.678608] [<ffffffff81ad8070>] coretemp_init+0x4b/0x80
[ 3.679724] [<ffffffff81ad8025>] ? hwmon_init+0xee/0xee
[ 3.680853] [<ffffffff8100020a>] do_one_initcall+0x7a/0x13c
[ 3.681975] [<ffffffff81aaac74>] kernel_init+0xe1/0x15b
[ 3.683081] [<ffffffff8147e4e4>] kernel_thread_helper+0x4/0x10
[ 3.684174] [<ffffffff8102d48c>] ? finish_task_switch+0x76/0xf0
[ 3.685266] [<ffffffff81477918>] ? retint_restore_args+0x13/0x13
[ 3.686356] [<ffffffff81aaab93>] ? start_kernel+0x3ee/0x3ee
[ 3.687425] [<ffffffff8147e4e0>] ? gs_change+0x13/0x13
[ 3.688489] ---[ end trace 7392ad3e6a92ae39 ]---

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
f4e0bcf06b9771af04273473592aeeb860ca2816 23-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Add comments describing the handling of HT CPUs

The coretemp driver provides a single set of device attributes for each
physical core of a HT CPU to avoid duplicate sensors. This
functionality was introduced with commit d883b9f09772 ("hwmon:
(coretemp) Skip duplicate CPU entries").

Commit e40cc4bdfd4b ("x86/hwmon: register alternate sibling upon CPU
removal") extends this functionality to register the HT sibling of a CPU
which is taken offline, to ensure that sensor attributes are provided if
at least one HT sibling of a core is online.

Add comments into the code describing the functionality in some more
detail.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
bb74e8ca352eecefdc5c1a9ebab01f18aa2f6f3c 23-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Fix compile error if CONFIG_SMP is not defined

cpu_sibling_mask() is not defined unless CONFIG_SMP is defined, so it
must not be used directly in the code without ifdef protection.

To solve the problem and avoid ifdefs in the code, define
for_each_sibling() and use it instead.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4cc452758fd250bb5968c583d825bb0e68d65db0 19-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (coretemp) Fix checkpatch errors

Fix remaining checkpatch errors in the coretemp driver.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
199e0de7f5df31a4fc485d4aaaf8a07718252ace 19-May-2011 Durgadoss R <durgadoss.r@intel.com> hwmon: (coretemp) Merge pkgtemp with coretemp

This patch merges the pkgtemp with coretemp driver.
The sysfs interfaces for all cores in the same pkg
are shown under one directory, in hwmon. It also
supports CONFIG_HOTPLUG_CPU. So, the sysfs interfaces
are created when each core comes online and are
removed when it goes offline.

Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
[guenter.roeck@ericsson.com: Fixed section reference errors]
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
f8bb8925682f355dc20f721bda7021ef13e5869f 20-Oct-2010 Joe Perches <joe@perches.com> hwmon: (coretemp) Use pr_fmt and pr_<level>

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>
3247800676c4a04352cde72b9935b57ffc72ce15 08-Oct-2010 Jan Beulich <JBeulich@novell.com> hwmon: (coretemp) fix reading of microcode revision (v2)

According to the documentation, simply reading the respective MSR
isn't sufficient: It should be written with zeros, cpuid(1) be
executed, and then read (see arch/x86/kernel/cpu/intel.c for an
example).

v2: Fail probe when microcode revision cannot be determined, but is
needed to check for proper operation.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Chen Gong <gong.chen@linux.intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
17c10d61c750619324ee2a46c5a9e03a435fe212 09-Oct-2010 Chen Gong <gong.chen@linux.intel.com> hwmon: ({core, pkg, via-cpu}temp) remove unnecessary CONFIG_HOTPLUG_CPU ifdefs

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>
9401ba13281f9cf36c85d4f8d3a52f9655e69b58 13-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: remove inclusion of unnecessary headers from {core, pkg, 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>
e0a8755b6b701b3397c4c23ff182b7eb6ac6fe26 13-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: (coretemp) cosmetic cleanup

"break" after "return" is at best bogus (good compilers even warn about
the "break" being unreachable).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
a5f42a6bc51454137b918f67310168c27d1dd1de 24-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: {core, pkg, via}cpu_temp_device_remove() can all be __cpuinit

... 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>
fff2017354a3a9906862aabbf2a1cae5b4330e40 28-Sep-2010 Guenter Roeck <guenter.roeck@ericsson.com> hwmon (coretemp): Fix build breakage if SMP is undefined

Commit e40cc4bdfd4b89813f072f72bd9c7055814d3f0f introduced
a build breakage if CONFIG_SMP is undefined. This commit
fixes the problem.

This fix is only a workaround. For a real fix, cpu_sibling_mask() should
be defined in UP include code, eg in linux/smp.h, and asm/smp.h should not be
included directly. This fix is currently not possible because asm/smp.h defines
cpu_sibling_mask() unconditionally and is included directly from many source
files.

Reported-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
e40cc4bdfd4b89813f072f72bd9c7055814d3f0f 13-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: register alternate sibling upon CPU removal

Just like pkgtemp registers another core of the same package when one
gets removed, coretemp should register another hyperthread (if
available) in that situation.

As pointed out in the patch fixing the respective code in pkgtemp, the
list protectng mutex must be dropped before calling
coretemp_device_add(), and due to the restructured loop (including an
explicit return) the "safe" variant of the list iterator isn't needed
anymore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
a46590533ad7b0f3f640732081d7e1658145c0ba 24-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: fix initialization of coretemp

Using cpuid_eax() to determine feature availability on other than
the current CPU is invalid. And feature availability should also be
checked in the hotplug code path.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
89a3fd35ba0318a7208e2c8d8ca6189f567d4a93 13-Sep-2010 Jan Beulich <jbeulich@novell.com> x86/hwmon: fix module init for hotplug-but-no-device-found case

In commit 0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae the call to
platform_driver_unregister() was made conditional upon !HOTPLUG_CPU,
but the return value from coretemp_init() was left to indicate an
error. This isn't correct, as the negative return value indicates to
the module loader that initialization failed, which isn't intended
here and results in dangling pointers.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Chen Gong <gong.chen@linux.intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
45ff34d32a19e9008e7202ba2a7c0d0f40420228 25-Aug-2010 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Fix harmless build warning

Fix the following build warning:

CC [M] drivers/hwmon/coretemp.o
drivers/hwmon/coretemp.c: In function "coretemp_init":
drivers/hwmon/coretemp.c:521: warning: unused variable "n"
drivers/hwmon/coretemp.c:521: warning: unused variable "p"

Introduced by commit 851b29cb3b196cb66452ec964ab5f66c9c9cd1ed. When
you drop code, you also have to drop the variables this code was
using.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Chen Gong <gong.chen@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@intel.com>
37713308d89f17c0f73e88b07138d6ca20bfe686 11-Aug-2010 Andrew Morton <akpm@linux-foundation.org> fix "hwmon: coretemp: update hotplug condition check"

In commit 0dca94baeab4 ("hwmon: coretemp: update hotplug condition
check") we merged v2 of this patch. Update that to v3.

The difference is to remove the new and unnecesary references to
CPU_*_FROZEN.

Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Chen Gong <gong.chen@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6b8e8282611ea35845dcff0cb321a7d735fc3155 10-Aug-2010 Andrew Morton <akpm@linux-foundation.org> drivers/hwmon/coretemp.c: remove unneeded #ifdef CONFIG_HOTPLUG_CPU

register_hotcpu_notifier() is designed to make these ifdefs unnecessary.

Cc: Chen Gong <gong.chen@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
851b29cb3b196cb66452ec964ab5f66c9c9cd1ed 10-Aug-2010 Chen Gong <gong.chen@linux.intel.com> hwmon: coretemp: enable coretemp device add operation failure

If one coretemp device can't be added, it should allow subsequent adding
operation because every new-added device will create a new sysfs group,
not an additional sensor sys entry.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae 10-Aug-2010 Chen Gong <gong.chen@linux.intel.com> hwmon: coretemp: update hotplug condition check

Fix two errors in hotplug. One is for hotplug notifier. The other is
unnecessary driver unregister. Because even none of online cpus supports
coretemp, we can't assume new onlined cpu doesn't support it either. If
related driver is unregistered there we have no chance to use coretemp
from then on.

Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@intel.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3f4f09b4be35d38d6e2bf22c989443e65e70fc4c 09-Jul-2010 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Properly label the sensors

Don't assume that CPU entry number and core ID always match. It
worked in the simple cases (single CPU, no HT) but fails on
multi-CPU systems.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Huaxu Wan <huaxu.wan@intel.com>
Cc: stable@kernel.org
d883b9f0977269d519469da72faec6a7f72cb489 09-Jul-2010 Jean Delvare <khali@linux-fr.org> hwmon: (coretemp) Skip duplicate CPU entries

On hyper-threaded CPUs, each core appears twice in the CPU list. Skip
the second entry to avoid duplicate sensors.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Huaxu Wan <huaxu.wan@intel.com>
Cc: stable@kernel.org
a321cedb12904114e2ba5041a3673ca24deb09c9 24-May-2010 Carsten Emde <C.Emde@osadl.org> drivers/hwmon/coretemp.c: get TjMax value from MSR

The MSR IA32_TEMPERATURE_TARGET contains the TjMax value in the newer
Intel processors.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Yong Wang <yong.y.wang@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
5db47b009d17d69a2f8d84357e7b24c3e3c2edec 24-May-2010 Carsten Emde <C.Emde@osadl.org> drivers/hwmon/coretemp.c: detect the thermal sensors by CPUID

The thermal sensors of Intel(R) CPUs can be detected by CPUID instruction,
indicated by CPUID.06H.EAX[0].

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Reviewed-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Yong Wang <yong.y.wang@linux.intel.com>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
4d7a5644e4adfafe76c2bd8ee168e3f3b5dae3a8 29-Mar-2010 Dean Nelson <dnelson@redhat.com> hwmon: (coretemp) Add missing newline to dev_warn() message

Add missing newline to dev_warn() message string. This is more of an issue
with older kernels that don't automatically add a newline if it was missing
from the end of the previous line.

Signed-off-by: Dean Nelson <dnelson@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fcc6a7462ec8d8a7d63ec59559e91f8fd6991160 29-Mar-2010 Prarit Bhargava <prarit@redhat.com> hwmon: (coretemp) Fix cpu model output

Avoid hex and decimal confusion when printing out the cpu model.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
1fe63ab47a617ee95f562eaa7ddbbc59981ff8c6 10-Jan-2010 Yong Wang <yong.y.wang@linux.intel.com> hwmon: (coretemp) Fix TjMax for Atom N450/D410/D510 CPUs

The max junction temperature of Atom N450/D410/D510 CPUs is 100 degrees
Celsius. Since these CPUs are always coupled with Intel NM10 chipset in
one package, the best way to verify whether an Atom CPU is N450/D410/D510
is to check the host bridge device.

Signed-off-by: Yong Wang <yong.y.wang@intel.com>
Acked-by: Huaxu Wan <huaxu.wan@intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fa08acd7d16cd7ea8114f3844b0ef2505a4276a8 23-Sep-2009 Huaxu Wan <huaxu.wan@linux.intel.com> hwmon: (coretemp) Add Lynnfield CPU

Add Lynnfield processor support. Lynnfield is a quad-core Nehalem
based microprocessor for Desktop market, which is introduced in
September 2009.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Kent Liu <kent.liu@linux.intel.com>
Acked-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
eccfed42215bebda0acc3158c1a4ff8325dea275 23-Sep-2009 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Add support for Penryn mobile CPUs

Following patch adds support for mobile Penryn CPUs. Intel documents this
poorly. I asked the Coretemp author for some help. This is totally untested and
may not work. Please test!

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@linux.intel.com>
Cc: Kent Liu <kent.liu@linux.intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
708a62bcd5f699756bae81491e64648fbf19e2a4 23-Sep-2009 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Fix Atom CPUs support

Fix Atom CPUs support. Intel documents TjMax at 90 degrees C but
some Atoms may have 125 degrees C (this is undocumented speculation).

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Cc: Huaxu Wan <huaxu.wan@linux.intel.com>
Cc: Kent Liu <kent.liu@linux.intel.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
0bf41d9f414a5cf558aff234a0ff486257537574 22-Sep-2009 Michael Riepe <michael.riepe@googlemail.com> drivers/hwmon/coretemp.c: enable the Intel Atom

Enable the coretemp driver on an Intel Atom.

I'm not sure if the readings are correct, however - on my 330, the driver
reports values between 27 and 41 °C (with core1 being about 8°C hotter
than core0, given the same load). Maybe the maximum temperature of 100 °C
is wrong for Atom CPUs.

Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
34c86c1e622ec77ba81c01969003bbc8e15156f3 15-Aug-2008 Darrick J. Wong <djwong@us.ibm.com> coretemp: recognize Nehalem CPUs

Add in the CPUID for Nehalem chips.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: Kent Liu <kent.liu@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
ae770152c801f10a91e5e86597a39b5f9ccf2d0d 18-Jan-2008 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Add Penryn CPU to coretemp

This patch adds support for family 0x17, which has Penryn Core. It should also
cover the 8 cores Xeons.

Can someone test please? I think it should work.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
118a88718886a6cb7fb2cf7fb77ef2eea30c73a1 17-Feb-2008 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Add TjMax detection for mobile CPUs

Following patch will finally solve the detection of Intel Mobile CPUs which
share same CPUID with Desktop/Server CPUs. We need this information to test
some bit so we know if TjMax is 100C or 85C. Intel claims this works for mobiles
only, respect that and set for desktops the TjMax to 100C. Intel provided some
table on their wiki based on my chat with them at:
http://softwarecommunity.intel.com/isn/Community/en-US/forums/30247249/ShowThread.aspx#30247249

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
ba7c1927aa69c4dfe1ecf646f03b306e49dc8e37 17-Feb-2008 Sam Ravnborg <sam@ravnborg.org> hwmon: (coretemp) fix section mismatch warning

Fix following warning:
WARNING: vmlinux.o(.text+0xebfd04): Section mismatch in reference from the function coretemp_cpu_callback() to the function .cpuinit.text:coretemp_device_add()

coretemp_cpu_callback() are only used inside a
HOTPLUG_CPU block so annotate it __cpuinit.
The notifier referencing the function are annotated
__refdata to silence warning from the exit function.
The unregister function do not use the embedded pointer
but clears the variable so the annotation is OK.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
6369a2887a1b35fde91573adc650528e3efea8e9 18-Jan-2008 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Add maximum cooling temperature readout

Following patch will add reporting of maximum temperature, at which all fans
should spin full speed. It may be non-physical temperature on Desktop/Server CPUs.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
561d9a969455cb009bb15b63e1d925dc527e7a9d 03-Dec-2007 Rafael J. Wysocki <rjw@sisk.pl> HWMON: coretemp, suspend fix

It's not permitted to unregister a device after devices have been suspended.
It causes deadlocks to appear on systems with coretemp hwmon loaded.  To avoid
this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set
in action.
 
Also, in other cases it's generally too late to unregister the coretemp device
if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE.
 
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Mark M. Hoffman <mhoffman@lightlink.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
92cb7612aee39642d109b8d935ad265e602c0563 19-Oct-2007 Mike Travis <travis@sgi.com> x86: convert cpuinfo_x86 array to a per_cpu array

cpu_data is currently an array defined using NR_CPUS. This means that
we overallocate since we will rarely really use maximum configured cpus.
When NR_CPU count is raised to 4096 the size of cpu_data becomes
3,145,728 bytes.

These changes were adopted from the sparc64 (and ia64) code. An
additional field was added to cpuinfo_x86 to be a non-ambiguous cpu
index. This corresponds to the index into a cpumask_t as well as the
per_cpu index. It's used in various places like show_cpuinfo().

cpu_data is defined to be the boot_cpu_data structure for the NON-SMP
case.

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Christoph Lameter <clameter@sgi.com>
Cc: Andi Kleen <ak@suse.de>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
c940336b4403540c498fceb102c7142799252129 07-Oct-2007 Rudolf Marek <r.marek@assembler.cz> hwmon: (coretemp) Add support for Celeron 4xx

This patch adds support for the Celeron 4xx based on Core 2 core.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
1beeffe43311f64df8dd0ab08ff6b1858c58363f 20-Aug-2007 Tony Jones <tonyj@suse.de> hwmon: Convert from class_device to device

Convert from class_device to device for hwmon_device_register/unregister

Signed-off-by: Tony Jones <tonyj@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
59a35bafb223bbb0553ba1a3bb9280bda668a8d8 23-Aug-2007 Satyam Sharma <satyam@infradead.org> hwmon: (coretemp) Remove bogus __cpuinitdata etc cleanup

The CPU hotplug notifier_block coretemp_cpu_notifier is already defined
inside an #ifdef HOTPLUG_CPU, therefore marking it as __cpuinitdata is
quite a pointless thing to do.

Also, remove duplicate prototype of function coretemp_update_device()
at the top of this file (another one already exists barely 10 lines
above this one :-)

Signed-off-by: Satyam Sharma <satyam@infradead.org>
Acked-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
d2bc7b135a948f788646e3a7aff9ac5597f42f4f 06-Jul-2007 Adrian Bunk <bunk@stusta.de> make coretemp_device_remove() static

coretemp_device_remove() can become static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
6d79af701d334777541136e914a9c0969b2ad307 24-Jun-2007 Jean Delvare <khali@linux-fr.org> hwmon/coretemp: fix a broken error path

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
67f363b1f6a31cf5027a97372f64bcced4f05ba6 27-May-2007 Rudolf Marek <r.marek@assembler.cz> hwmon/coretemp: Add more safety checks

Add detection of AE18 Errata of Core processor and warns
users that the absolute readings might be wrong for Core2 processor.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
8bb7844286fb8c9fce6f65d8288aeb09d03a5e0d 09-May-2007 Rafael J. Wysocki <rjw@sisk.pl> Add suspend-related notifications for CPU hotplug

Since nonboot CPUs are now disabled after tasks and devices have been
frozen and the CPU hotplug infrastructure is used for this purpose, we need
special CPU hotplug notifications that will help the CPU-hotplug-aware
subsystems distinguish normal CPU hotplug events from CPU hotplug events
related to a system-wide suspend or resume operation in progress. This
patch introduces such notifications and causes them to be used during
suspend and resume transitions. It also changes all of the
CPU-hotplug-aware subsystems to take these notifications into consideration
(for now they are handled in the same way as the corresponding "normal"
ones).

[oleg@tv-sign.ru: cleanups]
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
bebe467823c0d8eeb7f49115c255d8a235a20ddb 08-May-2007 Rudolf Marek <r.marek@assembler.cz> hwmon: New coretemp driver

Add the support for the digital temperature sensor found in recent
Intel Core CPUs.

Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Jean Delvare <khali@linux-fr.org>