[go: nahoru, domu]

History log of /drivers/hwmon/ibmaem.c
Revision Date Author Comments
d659f9b135fe26b966a6a4ad7281d35d7dbb1366 16-Jul-2014 Thomas Gleixner <tglx@linutronix.de> hwmon: ibmaem: Use ktime_get_ns()

Using the wall clock time for delta time calculations is wrong to
begin with because wall clock time can be set from userspace and NTP.
Such data wants to be based on clock monotonic.

The calculations also are done on a nanosecond basis. Use the
nanoseconds based interface right away.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Jean Delvare <jdelvare@suse.de>
Acked-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: John Stultz <john.stultz@linaro.org>
12ca0b569eac0bf8389b3eac74ba1d7e9f624ab8 11-Sep-2013 Sachin Kamat <sachin.kamat@linaro.org> hwmon: (ibmaem) Fix return value

Propagate appropriate error code obtained from ipmi_create_user()
instead of hardcoding.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
5407e051354bdd943f6ea66562112c9868d64cf5 27-Aug-2013 Darrick J. Wong <darrick.wong@oracle.com> hwmon: Change my email address.

I've changed employers, so change the email addresses to match.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
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>
fa845740cbc565d8f52c32973bb598743eb0d995 10-Oct-2012 Jean Delvare <khali@linux-fr.org> hwmon: Add missing inclusions of <linux/err.h>

These drivers use IS_ERR so they should include <linux/err.h>.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Luca Tettamanti <kronos.it@gmail.com>
Cc: Henrik Rydberg <rydberg@euromail.se>
0910b28ef44a0ef3653ac6a10ee8eab0acfe3f09 08-Jan-2012 Frans Meulenbroeks <fransmeulenbroeks@gmail.com> hwmon: (ibmaem) fix checkpatch issues

fixed:
WARNING: please, no space before tabs
+{"power3_average", ^I aem2_show_pcap_value,^IPOWER_AUX},$

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
179c4fdb565dd2157e5dfe89318b74868e3b523d 04-Jan-2012 Frans Meulenbroeks <fransmeulenbroeks@gmail.com> hwmon: replaced strict_str* with kstr*

replaced strict_strtol with kstrtol and
replaced strict_strtuol with kstrtuol

This satisfies checkpatch -f
Compile tested only: no warnings or errors given

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
da8ebe4e09ee5661f125a8401ade58baf226aa57 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (ibmaem) Avoid repeated memory allocations

Preallocate a buffer for the response to sensor reads, and reuse it
for each read instead of allocating a new one each time. This should
be faster and should also avoid memory fragmentation.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
9d84c9e8b5b0386ee1d7769de0ff8a2546a2d054 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (ibmaem) Make instance initializations independent

There is no good reason that I can see why the failure to initialize
one instance should prevent other instances from being initialized.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
547a1c99d0052c8bee0a8fe4091e6a9094c3cde3 04-Nov-2011 Jean Delvare <khali@linux-fr.org> hwmon: (ibmaem) Fix error paths

I am under the impression that error paths in functions
aem_init_aem1_inst() and aem_init_aem2_inst() are incorrect. In
several cases, the function returns 0 on error, which I suspect is
not intended. Fix this by properly tracking error codes.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
65807044760e03ebf766973c5e94a2ea1d57937b 01-Nov-2011 Jonathan Cameron <jic23@cam.ac.uk> drivers/hwmon/hwmon.c: convert idr to ida and use ida_simple_get()

A straightforward looking use of idr for a device id.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
66a89b2164e2d30661edbd1953eacf0594d8203a 09-Aug-2011 Julia Lawall <julia@diku.dk> hwmon: (ibmaem) add missing kfree

rs_resp is dynamically allocated in aem_read_sensor(), so it should be freed
before exiting in every case. This collects the kfree and the return at
the end of the function.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org # 2.6.27+
3cdb2052a6e365ad56202874e6a8a05a2bb336fc 24-May-2011 Guenter Roeck <guenter.roeck@ericsson.com> hwmon: (ibmaem) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
95de3b257516d21af6e0313c7bab119e4f80d6f4 25-May-2011 Jean Delvare <khali@linux-fr.org> hwmon: Use helper functions to set and get driver data

Use helper functions to set and get driver data. This is more elegant.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
55d705cce829c37999f26a8d4f1dd701013e7920 20-Oct-2010 Joe Perches <joe@perches.com> hwmon: (ibmaem) 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>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
8070408b5446232ba6eb6e0809a329da58a6ae52 15-Jun-2009 Darrick J. Wong <djwong@us.ibm.com> hwmon: (ibmaem) Automatically load on HC10 blade

Enable auto-probing for the HC10 blade and amend the supported system
list.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
fe2d5ffc74a1de6a31e9fd65b65cce72d881edf7 12-Nov-2008 Darrick J. Wong <djwong@us.ibm.com> Fix platform drivers that crash on suspend/resume

It turns out that if one registers a struct platform_device, the
platform device code expects that platform_device.device->driver points
to a struct driver inside a struct platform_driver.

This is not the case with the ipmi-si, ipmi-msghandler and ibmaem
drivers, which causes the suspend/resume hook functions to jump off into
nowhere, causing a crash. Make this assumption hold true for these
three drivers.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
21d93c14b32f1d74ebed09caca7d6c10cf3f952e 17-Oct-2008 Darrick J. Wong <djwong@us.ibm.com> hwmon: (ibmaem) Automatically load on IBM systems via DMI

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
bb15e7f286e3ecf3e85e06ad9b0019096e43a613 15-Aug-2008 Darrick J. Wong <djwong@us.ibm.com> ibmaem: don't query the entire sensor repository when reading energy meter

Currently, all sensors are read when the energy meter is queried via
sysfs. This introduces a considerable amount of delay and variation in
the sysfs reading, which is not desirable when trying to profile energy
use. Therefore, read only the energy meters when a sysfs query comes in
for them, and don't cache the results so that we always get the latest
reading.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9c5413eac5199b8457689eb2c9d9e75138356bd6 15-Aug-2008 Darrick J. Wong <djwong@us.ibm.com> ibmaem: prevent infinite probing loop on x3650 M2 systems

On older machines, probing for a nonexistent AEM interface returned an
IPMI error; when we saw this, we'd stop probing. On the x3650 M2 and
(presumably) later, we are returned a value indicating success and a
buffer full of garbage or zeroes. This causes the probe function to run
in an infinite loop. To fix this, we add one last check--if the
interface number we're looking for is higher than the number of
interfaces that AEM claims to have, stop probing.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
eb93b7df7e66597fa807e34a0f812ffff7ff165b 15-Aug-2008 Darrick J. Wong <djwong@us.ibm.com> ibmaem: update the documentation to reflect the current name

Minor documentation update to reflect the current full name of the power
management hardware interface and reflows the text a bit.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
a064d5bdd0c9602e4cd930ad949392640b37dda7 02-Jun-2008 Al Viro <viro@ftp.linux.org.uk> ibmaem endianness annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
8808a793f052c0a67426a24b961402fa20e92814 23-May-2008 Darrick J. Wong <djwong@us.ibm.com> ibmaem: new driver for power/energy/temp meters in IBM System X hardware

This driver reads IBM Active Energy Manager energy/temperature/power
sensors on IBM System X hardware.

[akpm@linux-foundation.org: fix printk warnings]
Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>