Commit Graph

89 Commits (060f0ce6ff975decd1e0ee318c08e228bccbee1e)

Author SHA1 Message Date
Guenter Roeck 9e3970fba9 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>
2013-01-25 21:03:55 -08:00
Linus Torvalds cff2f741b8 Driver core updates for 3.8-rc1
Here's the large driver core updates for 3.8-rc1.
 
 The biggest thing here is the various __dev* marking removals.  This is
 going to be a pain for the merge with different subsystem trees, I know,
 but all of the patches included here have been ACKed by their various
 subsystem maintainers, as they wanted them to go through here.
 
 If this is too much of a pain, I can pull all of them out of this tree
 and just send you one with the other fixes/updates and then, after
 3.8-rc1 is out, do the rest of the removals to ensure we catch them all,
 it's up to you.  The merges should all be trivial, and Stephen has been
 doing them all in linux-next for a few weeks now quite easily.
 
 Other than the __dev* marking removals, there's nothing major here, some
 firmware loading updates and other minor things in the driver core.
 
 All of these have (much to Stephen's annoyance), been in linux-next for
 a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlDHkPkACgkQMUfUDdst+ykaWgCfW7AM30cv0nzoVO08ax6KjlG1
 KVYAn3z/KYazvp4B6LMvrW9y0G34Wmad
 =yvVr
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg Kroah-Hartman:
 "Here's the large driver core updates for 3.8-rc1.

  The biggest thing here is the various __dev* marking removals.  This
  is going to be a pain for the merge with different subsystem trees, I
  know, but all of the patches included here have been ACKed by their
  various subsystem maintainers, as they wanted them to go through here.

  If this is too much of a pain, I can pull all of them out of this tree
  and just send you one with the other fixes/updates and then, after
  3.8-rc1 is out, do the rest of the removals to ensure we catch them
  all, it's up to you.  The merges should all be trivial, and Stephen
  has been doing them all in linux-next for a few weeks now quite
  easily.

  Other than the __dev* marking removals, there's nothing major here,
  some firmware loading updates and other minor things in the driver
  core.

  All of these have (much to Stephen's annoyance), been in linux-next
  for a while.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

Fixed up trivial conflicts in drivers/gpio/gpio-{em,stmpe}.c due to gpio
update.

* tag 'driver-core-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (93 commits)
  modpost.c: Stop checking __dev* section mismatches
  init.h: Remove __dev* sections from the kernel
  acpi: remove use of __devinit
  PCI: Remove __dev* markings
  PCI: Always build setup-bus when PCI is enabled
  PCI: Move pci_uevent into pci-driver.c
  PCI: Remove CONFIG_HOTPLUG ifdefs
  unicore32/PCI: Remove CONFIG_HOTPLUG ifdefs
  sh/PCI: Remove CONFIG_HOTPLUG ifdefs
  powerpc/PCI: Remove CONFIG_HOTPLUG ifdefs
  mips/PCI: Remove CONFIG_HOTPLUG ifdefs
  microblaze/PCI: Remove CONFIG_HOTPLUG ifdefs
  dma: remove use of __devinit
  dma: remove use of __devexit_p
  firewire: remove use of __devinitdata
  firewire: remove use of __devinit
  leds: remove use of __devexit
  leds: remove use of __devinit
  leds: remove use of __devexit_p
  mmc: remove use of __devexit
  ...
2012-12-11 13:13:55 -08:00
Guenter Roeck 3e280ba08a 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>
2012-12-05 10:55:55 -08:00
Guenter Roeck 2fa5222efe 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>
2012-12-05 10:55:55 -08:00
Guenter Roeck 72cbdddcc1 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>
2012-12-05 10:55:54 -08:00
Bill Pemberton 281dfd0b6e 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>
2012-11-28 11:50:34 -08:00
Bill Pemberton 6c931ae1c0 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>
2012-11-28 11:49:40 -08:00
Bill Pemberton 9e5e9b7a92 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>
2012-11-28 11:48:59 -08:00
Guenter Roeck 1102dcab84 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>
2012-10-14 15:21:33 -07:00
Silas Boyd-Wickizer 641f145600 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>
2012-09-23 20:27:32 +02:00
Andi Kleen 64f503076f 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>
2012-08-18 16:17:43 -07:00
Jan Beulich e273bd98c9 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>
2012-07-30 11:33:00 +02:00
Linus Torvalds 15b77435ed Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar.

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86, cpufeature: Remove stray %s, add -w to mkcapflags.pl
  x86, cpufeature: Catch duplicate CPU feature strings
  x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERM
  x86: Fix kernel-doc warnings
  x86, compat: Use test_thread_flag(TIF_IA32) in compat signal delivery
2012-06-29 10:29:54 -07:00
H. Peter Anvin 4ad3341130 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>
2012-06-25 09:01:15 -07:00
Jean Delvare 1268a172cd 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>
2012-06-17 18:05:06 +02:00
Guenter Roeck 41e58a1f2b 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>
2012-06-17 18:05:05 +02:00
Guenter Roeck 5592906f8b 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>
2012-06-17 18:05:05 +02:00
Jean Delvare fcc14ac1a8 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>
2012-06-17 18:05:05 +02:00
Guenter Roeck bdc71c9a87 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>
2012-05-01 09:16:14 -07:00
Kirill A. Shutemov b704871124 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>
2012-05-01 08:18:05 -07:00
Linus Torvalds 31f6765266 hwmon changes for v3.4
Mostly cleanup. No new drivers this time around, but support for several chips
 added to existing drivers: TPS40400, TPS40422, MTD040, MAX34446, ZL9101M,
 ZL9117M, and LM96080. Also, added watchdog support for SCH56xx, and additional
 attributes for a couple of drivers.
 
 312869e hwmon: (sch56xx) Add support for the integrated watchdog (v2)
 840e191 hwmon: (w83627ehf) Add support for temperature offset registers
 86dda17 hwmon: (jc42) Remove unnecessary device IDs
 3360a10 hwmon: (zl6100) Add support for ZL9101M and ZL9117M
 9271126 hwmon: (adm1275) Add support for ADM1075
 590defe hwmon: (max34440) Add support for MAX34446
 60b873e hwmon: (pmbus) Add more virtual registers
 2163340 hwmon: (pmbus) Add support for Lineage Power MDT040
 c5f35c9 hwmon: (pmbus) Add support for TI TPS40400 and TPS40422
 56aad5d hwmon: (max34440) Add support for 'lowest' output voltage attribute
 f15df57 hwmon: (jc42) Convert to use devm_kzalloc
 918ddef hwmon: (max16065) Convert to use devm_kzalloc
 b8a5a7c hwmon: (smm665) Convert to use devm_kzalloc
 3683928 hwmon: (ltc4261) Convert to use devm_kzalloc
 dd285ad hwmon: (pmbus) Simplify remove functions
 8b313ca hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc
 07404aa hwmon: (lineage-pem) Convert to use devm_kzalloc
 f352df6 hwmon: (hwmon-vid) Fix checkpatch issues
 3230f70 hwmon: (hwmon-vid) Add new entries to VRM model table
 9908ad4 hwmon: (lm80) Add detection of NatSemi/TI LM96080
 0e190b7 hwmon: (lm87) Get rid of macro-generated functions
 8652a26 hwmon: (lm87) Reorganize the code
 0fc86ec hwmon: (applesmc) Silence uninitialized warnings
 7599d32 hwmon: (lm70) Fix: do not use assignment in if condition
 e200c14 hwmon: (lm70) Register hwmon device after creating attribute files, and remove it first
 01d9def hwmon: (w83l786ng) Fix multi-line comments
 130067d hwmon: (w83l785ts) Fix multi-line comments
 7950133 hwmon: (w83781d) Fix: do not use assignment in if condition
 aff6e00 hwmon: (w83781d) Fix multi-line comments
 2a52dd6 hwmon: (smsc47b397) Fix multi-line comments
 36564ef hwmon: (pc87427) Fix multi-line comments
 b6707b7 hwmon: (max1668) Fix multi-line comments
 1160631 hwmon: (lm80) Fix multi-line comments
 bf0f3a0 hwmon: (emc2103) Fix multi-line comments
 fbb6670 hwmon: (adm1031) Fix multi-line comments
 94b991d hwmon: (adm1029) Fix multi-line comments
 27b9de3 hwmon: (w83627hf) Fix checkpatch issues
 ca3ccad hwmon: (w83l786ng) Fix checkpatch issues
 47efe87 hwmon: (w83793) Fix checkpatch issues
 d174368 hwmon: (w83792d) Fix checkpatch issues
 2185696 hwmon: (vt1211) Fix: do not use assignment in if condition
 b162c03 hwmon: (vt1211) Fix checkpatch issues
 9004ac8 hwmon: (via686a) Fix checkpatch issues
 bce2778 hwmon: (pc87360) Fix: do not use assignment in if condition
 449a7a0 hwmon: (pc87360) Fix checkpatch issues
 8958dfb hwmon: (max1619): Fix checkpatch issues
 09770b2 hwmon: (lm85) Fix checkpatch issues
 9b03079 hwmon: (lm78) Fix checkpatch issues
 02fe2fd hwmon: (lm77) Fix checkpatch issues
 f445a9a hwmon: (gl520sm) Fix: do not use assignment in if condition
 43da3d1 hwmon: (gl520sm) Fix checkpatch issues
 228f8e0 hwmon: (gl518sm) Fix checkpatch issues
 c8de836 hwmon: (dme1737) Fix checkpatch issues
 8c10369 hwmon: (asb100): Fix checkpatch issues
 c387e4e hwmon: (adm9240) Fix checkpatch issues
 86aa3e2 hwmon: (adm1026) Fix checkpatch issues
 21d2a8f hwmon: (adm1021) Fix checkpatch issues
 1bd385d hwmon: (abituguru) Fix checkpatch issues
 8969e84 hwmon: (w83627ehf) Fix multi-line comments
 51683ee hwmon: (max1111) Fix multi-line comments
 1b05d22 hwmon: (ltc4151) Fix multi-line comments
 1b9c491 hwmon: (g760a) Fix multi-line comments
 20eaf72 hwmon: (f71882fg) Fix multi-line comments
 4bebced hwmon: (emc1403) Fix multi-line comments
 ca3c7b6 hwmon: (amc6821) Fix multi-line comments
 10775d1 hwmon: (ads7871) Fix multi-line comments
 d13d623 hwmon: (ads7828) Fix multi-line comments
 562fca2 hwmon: (abituguru3) Fix multi-line comments
 ec1c319 hwmon: (w83791d) Fix checkpatch issues
 a80b10c hwmon: (ultra45_env) Fix checkpatch issues
 4d387df hwmon: (thmc50) Fix checkpatch issues
 85a0c0d hwmon: (smsc47m1) Fix checkpatch issues
 7e61268 hwmon: (smsc47m1) Fix: do not use assignment in if condition
 7cc3cb6 hwmon: (smsc47m192) Fix checkpatch issues
 8fda79e hwmon: (sis5595) Fix checkpatch issues
 5725608 hwmon: (pcf8591) Fix checkpatch issues
 2804a4c hwmon: (lm93) Fix checkpatch issues
 a318afd hwmon: (lm92) Fix checkpatch issues
 073f1e6c hwmon: (lm87) Fix: do not use assignment in if condition
 c6370db hwmon: (lm87) Fix checkpatch issues
 525ad37 hwmon: (fschmd) Fix checkpatch issues
 f24d548 hwmon: (atxp1) Fix checkpatch issues
 724cc33 hwmon: (adt7462) Fix checkpatch issues
 790fa38 hwmon: (ltc4215) Fix multi-line comments
 430b4fc hwmon: (ltc4245) Fix multi-line comments
 a68abd3 hwmon: (wm8350-hwmon) Constify fixed string array
 85ebfd3 hwmon: (applesmc) Fix multi-line comments
 75bdc93 hwmon: (asus_atk0110) Fix multi-line comments
 3c4c497 hwmon: (it87) Constify fixed string arrays
 8deeac8 hwmon: (ad7414) Fix multi-line comments
 5d577db hwmon: (jc42) Fix multi-line comments
 780affe hwmon: (coretemp) Fix checkpatch error
 3af2861 hwmon: (pc87360) Fix multi-line comments
 07de3df hwmon: (wm831x-hwmon) Fix multi-line comments
 3c22e23 hwmon: (smm665) Fix checkpatch error
 3c56b06 hwmon: (asc7621) Fix multi-line comments
 4a0d71c hwmon: (it87) Fix multi-line comments
 86d566e hwmon: (hwmon-vid) Fix multi-line comments
 5ed0488 hwmon: (hwmon) Fix multi-line comments
 19f2c05 hwmon: (ds1621) Fix checkpatch issues
 91efffe hwmon: convert drivers/hwmon/* to use module_spi_driver()
 f0967ee hwmon: convert drivers/hwmon/* to use module_i2c_driver()
 61ba031 hwmon: (vt8231) Fix multi-line comments
 9ed5bc2 hwmon: (adt7475) Fix multi-line comments
 2fff084 hwmon: (f71805f) Fix checkpatch issues
 703af96 hwmon: (max6650) Fix multi-line comments
 c531eb3 hwmon: (w83781d) Fix checkpatch issues
 2b22de5 hwmon: (adm1025) Fix checkpatch issues
 7973841 hwmon: (abituguru3) Fix checkpatch issues
 65fe5c7 hwmon: (vt8231) Fix checkpatch issues
 bafda5d hwmon: (max6650) Fix checkpatch issues
 0117c3f hwmon: (pmbus) Replace strict_strtol with kstrtol
 b3789a0 hwmon: (lm83) fix checkpatch issues
 93092a6 hwmon: (k8temp) fix checkpatch issues
 96585f1 hwmon: (lm80) reset device if error occurred
 6a9e7c4c hwmon: (lm80) fix checkpatch warnings
 6b904b6 hwmon: (adt7470) fix checkpatch issues
 e6a83db hwmon: (adt7411) fix checkpatch issues
 56c24af hwmon: (lm70) fix checkpatch issues
 1dc3708 hwmon: (f71882fg) fix checkpatch issues
 c6e8ac0 hwmon: (asus_atk0110) fix checkpatch issues
 99b8c83 hwmon: (adt7475) fix checkpatch issues
 b2ae8f8 hwmon: (smm665) fix checkpatch issues
 c9e1498 hwmon: (sht15) fix checkpatch issues
 0910b28 hwmon: (ibmaem) fix checkpatch issues
 dcb7cb9 hwmon: (ad7414) fix checkpatch issues
 e91aef2 hwmon: (ad7418) fix checkpatch issues
 5996542 hwmon: (w83l785ts) fix checkpatch issues
 a6100f6 hwmon: (wm831x-hwmon) fix checkpatch issues
 839a9ee hwmon: fix checkpatch issues
 08f5090 hwmon: (adm1029) fix checkpatch issues
 4d7c5d4 hwmon: (g760a) fix checkpatch issues
 7b102ed hwmon: (i5k_amb) fix checkpatch issues
 600151b hwmon: use DEFINE_PCI_DEVICE_TABLE
 7fe83ad hwmon: remove () used with return
 a6bee4a hwmon: (amc6821) fix initialisation
 2faaa93 hwmon: (lm80) add error handling
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJPaJBFAAoJEMsfJm/On5mBhkMP/09vlmsG7J3TLHcSKYJBkvSx
 6VNOOJgPqnvF71Az0dX47SU3zVXhG3I7dZufd/hqOK+0CNylSB7OSZMcWvBTduea
 0hDLTYj++SyVDQfVXb3zCVLU/wAE3YuXB3umWPwAKit4s2wAYYRDVCjwK96B88rv
 llNvo6JryuJDBUq7xiEmr0vKWMO0mKwwjpMTGCD3NpzK02ZV49T0gM94xa4gi5nM
 QAhNeO1AzQTx0+mBSRlq+SBBLSiXQmHcNrhnxcRMPha1bEi1D+QESozsczr+9/lz
 8vuTIULOIZxafM4XkBsZdknvlZnYrA6ukituDfVfiYQVcljO/cNu+seutFQDCMJe
 1zTDoNGIAwwnw0sAWWmTQwUMi+GSvlaL20gmm8FhTlvQaj9hNETsPYxEvPEsBNY1
 ICCixZcwpa1mZBXmryz2btf8az0OlX/sApzyHiq24B7lSE5Fv4tBDtwypLRu5N8m
 C4oNXC2dqDU0gtVxzO5Lavu6LHWV9lhyZvRPO75+zxYt4i5cnO04GTAYWh46aOzO
 DAZcs8M2Rj++dI5VW9Vl0k8hP9eWjxtPJFhNv/OWTx4YYQRICrde+j7QZcikIUWF
 0bzYI/zeIcwOg059vhnglBFM3mr7Z92jm4mftcNaSj/zuUHbWf6AQLbIq86Zq7tF
 3Eru3WuTZTwAkyNAVWd5
 =cUoW
 -----END PGP SIGNATURE-----

Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

Pull hwmon changes for v3.4 from Guenter Roeck:
 "Mostly cleanup.  No new drivers this time around, but support for
  several chips added to existing drivers: TPS40400, TPS40422, MTD040,
  MAX34446, ZL9101M, ZL9117M, and LM96080.  Also, added watchdog support
  for SCH56xx, and additional attributes for a couple of drivers."

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (137 commits)
  hwmon: (sch56xx) Add support for the integrated watchdog (v2)
  hwmon: (w83627ehf) Add support for temperature offset registers
  hwmon: (jc42) Remove unnecessary device IDs
  hwmon: (zl6100) Add support for ZL9101M and ZL9117M
  hwmon: (adm1275) Add support for ADM1075
  hwmon: (max34440) Add support for MAX34446
  hwmon: (pmbus) Add more virtual registers
  hwmon: (pmbus) Add support for Lineage Power MDT040
  hwmon: (pmbus) Add support for TI TPS40400 and TPS40422
  hwmon: (max34440) Add support for 'lowest' output voltage attribute
  hwmon: (jc42) Convert to use devm_kzalloc
  hwmon: (max16065) Convert to use devm_kzalloc
  hwmon: (smm665) Convert to use devm_kzalloc
  hwmon: (ltc4261) Convert to use devm_kzalloc
  hwmon: (pmbus) Simplify remove functions
  hwmon: (pmbus) Convert pmbus drivers to use devm_kzalloc
  hwmon: (lineage-pem) Convert to use devm_kzalloc
  hwmon: (hwmon-vid) Fix checkpatch issues
  hwmon: (hwmon-vid) Add new entries to VRM model table
  hwmon: (lm80) Add detection of NatSemi/TI LM96080
  ...
2012-03-21 10:37:25 -07:00
Guenter Roeck 780affe0e9 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>
2012-03-18 18:26:56 -07:00
Andi Kleen 9b38096fde 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>
2012-01-26 16:48:13 -08:00
Jean Delvare d6db23c7ce 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>
2012-01-16 22:51:47 +01:00
Kevin Winchester 141168c36c 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>
2011-12-21 09:25:09 +01:00
Jean Delvare 2aba6cac2a 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>
2011-11-06 20:25:18 +01:00
Andi Kleen ca8bc8dc04 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>
2011-10-14 13:16:42 +02:00
Guenter Roeck 20ecb499f6 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>
2011-09-28 08:19:21 -07:00
Jean Delvare 0eb9782ad9 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>
2011-09-28 08:19:20 -07:00
Jan Beulich 2f1c3db0a6 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>
2011-09-23 10:39:11 -07:00
Jan Beulich e3204ed3a4 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>
2011-09-23 10:39:10 -07:00
Jan Beulich b3a242a6e4 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>
2011-09-23 10:38:09 -07:00
Guenter Roeck f4af6fd6e2 hwmon: (coretemp) Don't use threshold registers for tempX_max
With commit c814a4c7c4, 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 c814a4c7c4 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>
2011-09-21 17:25:18 -07:00
Jean Delvare a45a8c8571 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>
2011-09-21 17:25:18 -07:00
Jean Delvare 6bf9e9b09c 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>
2011-09-21 17:25:18 -07:00
Jean Delvare cd5bd3df1a 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>
2011-09-14 03:55:05 -07:00
Durgadoss R c814a4c7c4 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>
2011-07-28 00:17:36 -07:00
Jean Delvare 808b4e639e 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>
2011-06-17 23:22:26 -07:00
Guenter Roeck bb9973e4e7 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>
2011-06-01 20:10:40 -07:00
Guenter Roeck 4f5f71a7ab hwmon: (coretemp) Fix TjMax detection for older CPUs
Commit a321cedb12 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
2011-06-01 20:10:31 -07:00
Jean Delvare 4c6e0f8101 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>
2011-06-01 11:11:28 -07:00
Jean Delvare 582e1b270f 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>
2011-05-27 02:24:54 -07:00
Guenter Roeck 6777b9e47e 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>
2011-05-27 02:24:53 -07:00
Sergey Senozhatsky 4258781ac7 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>
2011-05-27 02:24:53 -07:00
Guenter Roeck f4e0bcf06b 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 d883b9f097 ("hwmon:
(coretemp) Skip duplicate CPU entries").

Commit e40cc4bdfd ("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>
2011-05-23 21:11:14 -07:00
Guenter Roeck bb74e8ca35 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>
2011-05-23 11:59:08 -07:00
Guenter Roeck 4cc452758f 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>
2011-05-21 07:29:17 -07:00
Durgadoss R 199e0de7f5 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>
2011-05-20 07:04:49 -07:00
Joe Perches f8bb892568 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>
2011-01-08 10:55:05 -08:00
Jan Beulich 3247800676 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>
2010-10-25 14:11:21 -07:00