summaryrefslogtreecommitdiff
path: root/drivers/hwmon
AgeCommit message (Collapse)Author
2013-07-25hwmon: ina3221: ignore cpu notification when offJun Yan
When ina3221 is in suspend mode or off mode, ignore all cpu notifications Bug 1283995 Change-Id: I5c6bf66bfb401ce697b18828fbcb34ed916bfe3e Signed-off-by: Jun Yan <juyan@nvidia.com> Reviewed-on: http://git-master/r/230999 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com>
2013-04-24hwmon: ina3221: Add suspend and resumeAnshul Jain
Change-Id: I882038b2dee419daf7c402a9c03aad06a0a25807 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/216315 Reviewed-by: Sang-Hun Lee <sanlee@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chaitanya Bandi <bandik@nvidia.com> Tested-by: Jun Yan <juyan@nvidia.com> Reviewed-by: Tao Xie <txie@nvidia.com>
2013-03-25hwmon: ina3221: optimize ina3221Jun Yan
turn off ina3221 when online_cores < 2 and freq < 1GHz turn on ina3221 when online_cores >=2 or freq >= 1GHz Bug 1241820 Change-Id: Ie2d6d703711a33b14c73f765421e9565ecda64f6 Signed-off-by: Jun Yan <juyan@nvidia.com> Reviewed-on: http://git-master/r/210071 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com> Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
2013-02-07hwmon: ina230: use correct configuration modesDeepak Nibade
Bug 1228591 Change-Id: I5a4b2b59d32118d57ee0ff6c21b8423268fc1926 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/197993 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2013-02-06hwmon: ina3221: implement shutdownDeepak Nibade
Bug 1225028 Change-Id: I252cfc136f5fe2c2118ae4d24d5c2ba64fb94437 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/195027 Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com> Tested-by: Sang-Hun Lee <sanlee@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
2013-02-05hwmon: ina230: add support for HPA01112Laxman Dewangan
TI HPA01112 is sw compatible with ina230. Add the module id for HPA01112. Change-Id: If9c054d09c1fd8a2d29b363062a021ad0e99bb97 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/197499 GVS: Gerrit_Virtual_Submit
2013-02-05hwmon: ina230: add support for HPA02149Laxman Dewangan
The TI current/power monitor device INA230 is compatible with the HAP02149. Add module ID for the HPA02149. This device is also compatible with INA226 and hence adding ina226 as module-id. In this way, this driver can regsitered with the name as "ina226" or "ina230" or "hpa02149". bug 1218687 Change-Id: Ic67227bc6d415fd559d804f4bd97e4ea4018d872 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/196411
2013-01-27hwmon: ina3221: Support for turning off inaAnshul Jain
This is an optimization to turn off INA device based on number of cores online. Also, this change removes support for turning on/off INA at runtime using sysfs node. Additionaly, this change creates a new API power2_*, which return 0 if ina device is turned off. Bug 1223376 Bug 1207777 Change-Id: I0beedffa10d7e11e280e96c2c58c4dd191b87819 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/193580 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2013-01-03hwmon: ina230: power down ina devices after initDeepak Nibade
-power down ina devices by setting register values -earlier power down method was a conditional one and left ina devices ON after init Bug 1211188 Change-Id: I113a1e7dc3eb6c211dab58596090c6c508364e25 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/187946 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Tested-by: Daniel Solomon <daniels@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-12-05hwmon: ina3221: Fix trigger config dataAnshul Jain
Fix the debug print and trigger config data for INA3221 device Bug 1160066 Change-Id: Ib544489a8cd8861d98ee7e276e92559c0077ce51 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/167598 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-11-30Thermal: Update thermal zone device registerJinyoung Park
Update thermal zone device register in drivers due to updated thermal API. Bug 1059470 Change-Id: I02e068c2b6c5756edb1f7928d2a822f3f2536867 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/166119 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-11-28hwmon: tegra-tsensor: moving to clk prepare APIsSivaram Nair
The clk_enable/clk_disable pair of APIs are replaced with clk_prepare_enable and clk_disable_unprepare. This is needed for the migration to common clk framework. Bug 920915 Change-Id: I1b5939d7714c21549b4e7e63c223bcac8e66f951 Signed-off-by: Sivaram Nair <sivaramn@nvidia.com> Reviewed-on: http://git-master/r/162324 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
2012-11-22hwmon: ina3221: add support for INA3221Deepak Nibade
-add driver to support INA3221 in both triggered/continuous mode -add header file in include/linux -modify Makefile, Kconfig Bug 1160066 Change-Id: Id0e001d680bb6896e263c0d6c848e1f978290520 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/161227 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Liang Cheng (SW) <licheng@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-11-21hwmon: ina230: add function to measure powerDeepak Nibade
-do calculation using calibration_data, power_lsb, divisor received from respective board files -remove sysdev include Bug 1049224 Change-Id: I673e67cb42972aad1a3c5e5ea995072d40839d05 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/162025 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-11-13hwmon: INA219: Keep the device in power-down after initAly Hirani
Change the init sequence to reset first and then power-down the INA Bug 1174904 Change-Id: Ic337e10d9799e21329b08adab3011ba17dea2844 Signed-off-by: Aly Hirani <ahirani@nvidia.com> Reviewed-on: http://git-master/r/163179 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Anshul Jain (SW) <anshulj@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-11-09hwmon: ina219: INA219 driver with more sysfsAnshul Jain
This new driver allows state change of the INA219 device using this sysds node: To turn the ina219 device on, echo 1 > /<i2c device path>/cur_state To turn it off: echo 0 > /<i2c device path>/cur_state It has new sysfs nodes current2_input and power2_input that contains current and power calculated using shunt resistor and voltage drop across shunt resistor. This driver is backward compatible with the old driver. Bug 1160868 Change-Id: I5e05947e8e3b20a85f02188a48ea4441218e27a8 Signed-off-by: Anshul Jain <anshulj@nvidia.com> Reviewed-on: http://git-master/r/160070 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-11-05drivers: nct: tsensor: Update thermal registerJoshua Primero
Updated thermal register function for tsensor and nct thermal drivers due to Linux thermal API change. bug 1059470 Change-Id: Ic4ca347c6fcc1aad156122147a7c94a5f3880985 Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/159967 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-11-01drivers: nct: tsensor: Update bind functionJoshua Primero
Update the bind function in the tsensor and nct driver to reflect the new Thermal API. bug 1059470 Change-Id: I527383d426ff1f70fe531a02d600735cbedea7b8 Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/159963 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-10-31hwmon: tegra: tsensor: coverity warning fixBitan Biswas
bug 1046331 Change-Id: I1be17d9343b004a6cb0a81c13fd0f322ada9d109 Signed-off-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-on: http://git-master/r/159541 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-10-25hwmon: ina219: add precision multiplierDeepak Nibade
-Precision multiplier declared -This multiplier will be defined in respective board files -Finally multiplier is divided to get normalized value Bug 1049224 Change-Id: Ia84c622c1f1f5ee845806d26b64600be4564b5b9 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/147578 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-10-25drivers: nct: tsensor: writeable trip pointsJoshua Primero
Added nct functionality to change trip points. This will be useful for EDP and thermal throttling. Change-Id: I4fef643263261701164027f9bb13794b37e4907e Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/139083 (cherry picked from commit 0dd4d083d4379752f7db241800d9501460b63d07) Signed-off-by: Gaurav Batra <gbatra@nvidia.com> Reviewed-on: http://git-master/r/146674 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-10-25drivers: hwmon: tsensor: decoupled tsensor driverJoshua Primero
Removed outside interface of tsensor driver. Tsensor driver interacts with cooling devices via Linux thermal framework which it registers to on its own. Change-Id: I349761a28eac94f7f6c05d192394bc2739e93cb6 Signed-off-by: Joshua Primero <jprimero@nvidia.com> Reviewed-on: http://git-master/r/132882 (cherry picked from commit 6645d1062b2d76a504ef7a109b919d631169f479) Signed-off-by: Gaurav Batra <gbatra@nvidia.com> Reviewed-on: http://git-master/r/130288 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> Tested-by: Diwakar Tundlam <dtundlam@nvidia.com>
2012-08-24hwmon: tegra: tsensor:Fix compilation errorNagaraja Kolur
Bug 1024886 Resolved compilation error for unused code. Signed-off-by: Nagaraja Kolur <nkolur@nvidia.com> Change-Id: I9167d8129a9cba0fc6cb203180e07192d66db439 Reviewed-on: http://git-master/r/120581 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Nagaraj Kolur <nkolur@nvidia.com> Tested-by: Nagaraj Kolur <nkolur@nvidia.com> Reviewed-by: Vijaya Bhaskar <vbhaskar@nvidia.com> Reviewed-by: Wahed Syed <wsyed@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-08-07Merge commit 'main-jb-2012.08.03-B4' into t114-0806Pradeep Kumar
Conflicts: arch/arm/boot/compressed/Makefile arch/arm/boot/compressed/atags_to_fdt.c arch/arm/boot/compressed/head.S arch/arm/boot/dts/tegra30.dtsi arch/arm/include/asm/bug.h arch/arm/kernel/traps.c arch/arm/mach-tegra/Makefile.boot arch/arm/mach-tegra/board-cardhu-sdhci.c arch/arm/mach-tegra/board-cardhu.c arch/arm/mach-tegra/board-enterprise-sdhci.c arch/arm/mach-tegra/board-enterprise.c arch/arm/mach-tegra/board-harmony.c arch/arm/mach-tegra/board-kai-sdhci.c arch/arm/mach-tegra/board-ventana.c arch/arm/mach-tegra/board-whistler.c arch/arm/mach-tegra/clock.h arch/arm/mach-tegra/fuse.h arch/arm/mach-tegra/tegra2_usb_phy.c arch/arm/mach-tegra/tegra3_clocks.c arch/arm/mach-tegra/tegra3_dvfs.c arch/arm/mach-tegra/tegra3_speedo.c arch/arm/mach-tegra/timer.c arch/arm/mach-tegra/usb_phy.c arch/arm/mach-tegra/wakeups-t3.c drivers/cpufreq/cpufreq_interactive.c drivers/input/touchscreen/atmel_mxt_ts.c drivers/mfd/tps65090.c drivers/mmc/core/mmc.c drivers/mmc/host/sdhci-tegra.c drivers/mmc/host/sdhci.c drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c drivers/regulator/Kconfig drivers/regulator/core.c drivers/regulator/tps80031-regulator.c drivers/spi/Makefile drivers/staging/nvec/nvec.c drivers/tty/serial/Makefile include/linux/mmc/card.h sound/soc/tegra/tegra_max98095.c sound/usb/card.c Change-Id: I65043bc6ce9e97d0592683462215a39e50f403fd Reviewed-on: http://git-master/r/121392 Reviewed-by: Bo Yan <byan@nvidia.com> Tested-by: Bo Yan <byan@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User
2012-07-25Merge commit 'v3.4.6' into android-t114-3.4Varun Wadekar
Linux v3.4.6 Change-Id: I4518a173ca2852188ebd48121723c8be29d0c682 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-07-19hwmon: (it87) Preserve configuration register bits on initJean Delvare
commit 41002f8dd5938d5ad1d008ce5bfdbfe47fa7b4e8 upstream. We were accidentally losing one bit in the configuration register on device initialization. It was reported to freeze one specific system right away. Properly preserve all bits we don't explicitly want to change in order to prevent that. Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-18Merge commit 'v3.4.5' into android-t114-3.4-rebasedVarun Wadekar
Linux v3.4.5 Conflicts: drivers/base/power/main.c Change-Id: I782e650a89665caea8aed9e5598234888dc11088 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-07-17hwmon: tegra: tsensor:Simplify counter calculationDaniel Fu
Simplify the temp to counter conversion in tsensor, Also it can improve a little bit accuracy of temp to counter conversion. Change-Id: I5764334d5d94e317dd9400bc03cb5d7a64096ee0 Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/115340 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-07-16x86, cpufeature: Rename X86_FEATURE_DTS to X86_FEATURE_DTHERMH. Peter Anvin
commit 4ad33411308596f2f918603509729922a1ec4411 upstream. 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> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16hwmon: (applesmc) Limit key length in warning messagesHenrik Rydberg
commit ac852edb47b15900886ba2564eeeb13b3b526e3e upstream. Key lookups may call read_smc() with a fixed-length key string, and if the lookup fails, trailing stack content may appear in the kernel log. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16hwmon: tegra: tsensor: improve counter accuracyDaniel Fu
When set threshold of tsensor,convert the temp to counter. The counter convert from temp is with ~1.8C average error. Improved the accuracy, make it to be ~0.1C. Bug 1015288 Change-Id: Icab03b559eaeb8846dd1191869afe39c9965f934 Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/114904 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-07-12hwmon: tsensor: fix system hang in 0C.Linqiang Pu
Changed the low temp to 0C since 20C is very easy to trigger thermal alert under -15C to 15C environment temperature. And the thermal alert will run into endless alert from tsensor_work_func. Also revised suspend and resume routine to cancel the work when suspending and disable/enable irq. Bug 999175 Signed-off-by: Linqiang Pu <dpu@nvidia.com> (cherry picked from commit 6a909bfa690991438be298d4933946a92e4929c4) Change-Id: Icafc6d5f0164204cc0cb7bea64bef2fadadbfbfd Reviewed-on: http://git-master/r/111550 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-07-12hwmon: tegra: improve tsensor accuracyBitan Biswas
tsensor driver uses fixed point approximations. Improved accuracy of tsensor temperature reading - adding support to handle negative temperature to counter conversions and vice-versa bug 1001632 bug 999175 Signed-off-by: Bitan Biswas <bbiswas@nvidia.com> (cherry picked from commit 86ae0bdc3fbd34a5a1d0e08f7721ed527ddf5408) Change-Id: I5f6df85611d502a6dda1186234078fe973d7ca75 Reviewed-on: http://git-master/r/100576 Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-05-14hwmon: (coretemp) Increase CPU core limitGuenter Roeck
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-14hwmon: (coretemp) fix oops on cpu unplugKirill A. Shutemov
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-01hwmon: (coretemp) Increase CPU core limitGuenter Roeck
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-01hwmon: (coretemp) fix oops on cpu unplugKirill A. Shutemov
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-04-30hwmon: (fam15h_power) Fix pci_device_id arrayGuenter Roeck
pci_match_id() takes an *array* of IDs which must be properly zero- terminated. Reported-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-30hwmon: (ad7314) Fix build warningGuenter Roeck
The following build warning is seen in some configurations. drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature': drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function Fix by overloading the return value from ad7314_spi_read with both data and error code (the returned data is really u16 and needs to be converted into a signed value anyway). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-26hwmon: (fam15h_power) Fix pci_device_id arrayGuenter Roeck
pci_match_id() takes an *array* of IDs which must be properly zero- terminated. Reported-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable@vger.kernel.org # 3.0+: 00250ec hwmon: fam15h_power: fix bogus values Cc: stable@vger.kernel.org # 3.0+ Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-25hwmon: (ads1015) Fix build warningGuenter Roeck
The following build warning is seen in some configurations. drivers/hwmon/ads1015.c: In function 'show_in': drivers/hwmon/ads1015.c:129: warning: 'in' may be used uninitialized in this function Fix by separating the register read function from the code converting the result into mV. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Dirk Eibach <eibach@gdsys.de> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-25hwmon: fam15h_power: fix bogus values with current BIOSesAndre Przywara
Newer BKDG[1] versions recommend a different initialization value for the running average range register in the northbridge. This improves the power reading by avoiding counter saturations resulting in bogus values for anything below about 80% of TDP power consumption. Updated BIOSes will have this new value set up from the beginning, but meanwhile we correct this value ourselves. This needs to be done on all northbridges, even on those where the driver itself does not register at. This fixes the driver on all current machines to provide proper values for idle load. [1] http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452) Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Jean Delvare <khali@linux-fr.org> [guenter.roeck@ericsson.com: Removed unnecessary return statement] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@vger.kernel.org # 3.0+
2012-04-23drivers: resolve compilation time warningsSanjay Singh Rawat
bug 949219 Change-Id: I5942ba86bd1cbe1f1bd06a7c9f51a10d83e6cabb Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/92819 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Conflicts: drivers/usb/host/ehci.h Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-04-22hwmon: (ad7314) Fix build warningGuenter Roeck
The following build warning is seen in some configurations. drivers/hwmon/ad7314.c: In function 'ad7314_show_temperature': drivers/hwmon/ad7314.c:70: warning: 'data' may be used uninitialized in this function Fix by overloading the return value from ad7314_spi_read with both data and error code (the returned data is really u16 and needs to be converted into a signed value anyway). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-04-18hwmon: (ads1015) Fix build warningGuenter Roeck
The following build warning is seen in some configurations. drivers/hwmon/ads1015.c: In function 'show_in': drivers/hwmon/ads1015.c:129: warning: 'in' may be used uninitialized in this function Fix by separating the register read function from the code converting the result into mV. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Dirk Eibach <eibach@gdsys.de> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-18hwmon: fam15h_power: fix bogus values with current BIOSesAndre Przywara
Newer BKDG[1] versions recommend a different initialization value for the running average range register in the northbridge. This improves the power reading by avoiding counter saturations resulting in bogus values for anything below about 80% of TDP power consumption. Updated BIOSes will have this new value set up from the beginning, but meanwhile we correct this value ourselves. This needs to be done on all northbridges, even on those where the driver itself does not register at. This fixes the driver on all current machines to provide proper values for idle load. [1] http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452) Signed-off-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Jean Delvare <khali@linux-fr.org> [guenter.roeck@ericsson.com: Removed unnecessary return statement] Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: stable@vger.kernel.org # 3.0+
2012-04-18hwmon: (pmbus_core) Fix compiler warningGuenter Roeck
Some configurations produce the following compiler warning: drivers/hwmon/pmbus/pmbus_core.c: In function 'pmbus_show_boolean': drivers/hwmon/pmbus/pmbus_core.c:752: warning: 'val' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from pmbus_get_boolean with both val and error return code (val is a boolean and thus never negative). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-18hwmon: (smsc47m1) Fix compiler warningGuenter Roeck
Some configurations produce the following compiler warning: drivers/hwmon/smsc47m1.c: In function 'sm_smsc47m1_init': drivers/hwmon/smsc47m1.c:938: warning: 'address' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from smsc47m1_find with both address and error return code (the address is an unsigned short and thus never negative). This also reduces module size by a few bytes (46 bytes for x86_64). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-18hwmon: (acpi_power_meter) Fix compiler warning seen in some configurationsGuenter Roeck
In some configurations, BUG() does not result in an endless loop but returns to the caller. This results in the following compiler warning: drivers/hwmon/acpi_power_meter.c: In function 'show_str': drivers/hwmon/acpi_power_meter.c:380: warning: 'val' may be used uninitialized in this function Fix the warning by setting val to an empty string after BUG(). Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
2012-04-18hwmon: (smsc47b397) Fix compiler warningGuenter Roeck
Some configurations produce the following compiler warning: drivers/hwmon/smsc47b397.c: In function 'smsc47b397_init': drivers/hwmon/smsc47b397.c:385: warning: 'address' may be used uninitialized in this function While this is a false positive, it can easily be fixed by overloading the return value from smsc47b397_find with both address and error return code (the address is an unsigned short and thus never negative). This also reduces module size by a few bytes (64 bytes for x86_64). Cc: Mark M. Hoffman <mhoffman@lightlink.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>