Commit Graph
577 Commits
Author SHA1 Message Date
Jean Delvare bb5da5b8a8 Ignore fan invert configuration bits.
Do not depend on "new data ready" bit for fan speed update.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2492 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-29 21:34:39 +00:00
Jean Delvare 352fb41c68 Fix fan configuration being read from the wrong registers.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2486 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-28 18:07:52 +00:00
Jean Delvare 084a788bc6 Mask voltage and temperature alarm registers.
Fix temp status sysctl values.
        Clear fan alarms after we read them.
        Do not read invalid or old fan values.
        Do not read voltage and temperature alarms on fan-only chips.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2485 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-27 18:56:06 +00:00
Mark D. Studebaker b0295fe904 move initialization to kernel thread to fix oops
Ticket #1573

--------------

Another update for his issue [kernel panic triggered by bmcsensors}:

The source of the problem are the non-atomic kernel mallocs for device
registration called from an interrupt context - this doesn't seem to be
supported and as observed can crash the kernel.

A possible solution  is to create a kernel thread on initialisation,
leave that thread hanging round while the device scan runs, and finaly
signal the init thread when device scan is complete to finish
initialisation be registing the sensors found during scan.

A patch implementing such a scheme was created by Yvon JEGOU, I'll post
it here again.

Thanks, Martin

--------------

Hi Mark,


>> I don't fully understand... sorry if I'm slow.
>> is the problem doing mallocs from an interrupt context or non-atomic
>> mallocs?
>> what's non-atomic about the malloc?
>> how did we get in an interrupt context?


Being no kernel programmer this is fairly hard form me to answer; lets
see how far I get

The problem is non-atomic kmallocs from an interrupt context.

Non-atomic refers to the flags specified in the kmalloc call (GFP_ATOMIC
vs. GFP_KERNEL) (Ref. http://lwn.net/Articles/22909/)

Scanning for sensors is triggered by sending an ipmi message in
bmcsensors_reserve_sdr. Building the list of sensors and finally
creating the required proc entries happens on subsequent reception of
ipmi messages in the ipmi call-back. If I understand correctly how
things interact, that would be in an interrupt context.

Where bmcsensors blows up when trying to register lots of sensors is the

-> bmcsensors_command (which is the i2c-ipmi call-back)
-> bmcsensors_msg_handler
-> bmcsensors_rcv_msg
-> bmcsensors_rcv_sdr_msg
-> bmcsensors_build_proc_table
-> i2c_register_entry
-> create_proc_entry
-> proc_create
-> kmalloc

sequence.

My limited understanding of kernel programming is that if memory is
allocated in an interrupt context, GFP_ATOMIC must be used.

While the kmallocs done directly by bmcsensors_build_proc_table would be
fixable, the calls in proc_create_entry are obviously not changeable.
This makes proc_create and its callers unsafe for use in an interrupt
context.

The patch works around this limitation by creating a separate kernel
thread from sm_bmcsensors_init and calling bmcsensors_build_proc_table
from this thread after scanning for sesnsors has finished.

Hope I've managed to adequately explain what I think is wrong.

Bye, Martin


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2482 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-27 01:10:49 +00:00
Jean Delvare eb13a07e48 Be concurrent-access safe (i.e. ensure than no bank change occurs
in our back).
        Fix compilation without DEBUG.
        Do not read in and temp alarms more than needed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2481 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-26 17:53:43 +00:00
Jean Delvare f33169d5cd Retrieve fans configuration from Super-I/O space; export
pwm_enable (read-only); handle fan invert.
        Fix temp_crit being read from temp_min register.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2479 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-26 16:58:52 +00:00
Jean Delvare 80968de0a9 Fix setting voltage limits. This got broken by my previous
fix of inaccurate voltage roundings.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2478 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-25 19:43:54 +00:00
Jean Delvare f5a0f7d493 Add some debug output.
Show more status bits (voltages and temperatures).
        Fix incorrect use of const.
        Clear status bits on update.
        Fix temperature reads (min, crit and current).
        Fix temperature writes (min).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2477 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-25 15:23:32 +00:00
Jean Delvare 44014e8b70 Correctly handle the case where some of the logical devices are
disabled.
        Add KERN constants to printks.
        Reindent.
        Fix error path in detect function.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2474 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-25 06:53:07 +00:00
Jean Delvare 7c8db8e5ff Fix driver not being called by i2c-proc.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2473 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-24 21:29:01 +00:00
Jean Delvare 635b1b06bc Support the LM99 (and LM89).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2471 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-24 08:10:48 +00:00
Jean Delvare a41a6d70ab Fix fan speed computations.
Fix voltage magnitudes.
        Fix voltage limits order.
        Add voltage limits write support.
        Add temperature limits write support.
        Prevent user from setting limit of nonexistent fan 3.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2460 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-20 17:55:10 +00:00
Jean Delvare 48e0e22aea Fix voltage roundings.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2458 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-20 17:12:55 +00:00
Jean Delvare db71a2a1a4 Support voltages and temperatures of National Semiconductor
PC87365 and PC87366 (read-only).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2453 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-19 19:46:14 +00:00
Jean Delvare 239b3d0344 Backport memory allocation reworking from Linux 2.6.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2445 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-17 17:20:01 +00:00
Jean Delvare c7a33c464f Support MAX6633, MAX6634, MAX6635 and LM76.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2440 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-14 18:29:24 +00:00
Jean Delvare ff48783182 Use kernel's swab16 instead of our own function.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2437 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-13 17:52:59 +00:00
Jean Delvare 26aefc15ba Trivial comment fix.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2436 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-12 11:27:00 +00:00
Jean Delvare 81db694b66 Fix i2c address range.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2434 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-10 17:25:55 +00:00
Jean Delvare 342b8a2c04 Return error values in detect.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2431 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-10 14:09:50 +00:00
Jean Delvare 2901509e24 Correctly set the chip name depending on the type.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2429 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-09 18:57:41 +00:00
Jean Delvare bcfb34bcb7 Drop PWM support for as99127f. Update AS99127F docs.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2428 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-09 18:50:43 +00:00
Jean Delvare 2cdac4e54a The pc87360 driver now support the PC87365 and PC87366 as well,
and can write to registers. Untested.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2427 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-09 18:41:30 +00:00
Jean Delvare 1a7c4d2eed Also support the PC87365 and PC87366.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2420 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-07 17:59:38 +00:00
Jean Delvare 6589dbb3d2 Rename pc87360-fan driver to pc87360.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2419 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-07 17:30:54 +00:00
Jean Delvare 26d763bb48 Preleminary (read-only) National Semiconductor PC87360, PC87363
and PC87364 fan monitor and controller support.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2418 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-07 17:27:50 +00:00
Jean Delvare 092aae7ffe Fix bogus memset (similar to a recent fix to the eeprom driver).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2410 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-04 07:16:30 +00:00
Jean Delvare 3307085b6b Preleminary (read-only) National Semiconductor PC87360, PC87363
and PC87364 fan monitor and controller support.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2405 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-01 05:48:18 +00:00
Jean Delvare 18d6d587cc Preleminary (read-only) National Semiconductor PC87360, PC87363
and PC87364 fan monitor and controller support.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2403 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-31 18:58:05 +00:00
Jean Delvare 32b628a4fa Fix bogus memset. Reported by Ralf Roesch.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2401 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-29 17:25:15 +00:00
Jean Delvare 46867ff39c Backport a few fixes from 2.6:
* remove two unused structure members
* remove needless kind checks (only one kind)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2397 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-28 12:00:42 +00:00
Jean Delvare 835d3937dd Backport misdetection prevention patch from 2.6:
* Use unused bits of two more registers (configuration and conversion
rate) to reduce misdetections.

* Return with -ENODEV if the detection fails.

* Change the order in which we try to identify the chips. We better
finish with the LM84 and the MAX1617, in this order, because they are
harder to identify and are more likely to result in false positives.

* Refine LM84 detection. The LM84 has less features than the other chips
(chip cannot be stopped, conversion rate cannot be set, no low limits)
so it has extra unused bits.

* Do not intialize the chip if it was detected as an LM84. This one
cannot be stopped so why would we try to start it again? And as said
right before, conversion rate isn't changeable either.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2395 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-27 16:12:20 +00:00
Jean Delvare 57d7f9c0ef Do not initialize more bits than needed.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2391 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-25 19:05:40 +00:00
Jean Delvare baee14b641 Drop out-of-date comment about semi-static allocation.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2386 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-21 17:28:36 +00:00
Jean Delvare eac40915b6 Add pca9540.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2370 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-19 18:25:57 +00:00
Jean Delvare 12805aeb7c New driver for the PCA9540 (used on the Gigabyte GA-7DPXDW+).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2366 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-19 18:21:07 +00:00
Jean Delvare 2c157316dc Support the LPC47B27x.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2363 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-19 17:51:52 +00:00
Jean Delvare 50b5b87d23 Backport cleanups from Linux 2.6. Mostly whitespace changes, and
a few simplifications.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2362 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-18 20:49:39 +00:00
Jean Delvare c44b1691cc Check for capabilities before using them. Reported by Aurelien
Jarno.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2360 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-16 19:28:40 +00:00
Jean Delvare da21eeb652 Add ID in case i2c-id.h doesn't have it.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2349 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-09 20:39:15 +00:00
Mark D. Studebaker 96d4fcced7 #ifndef driverid
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2336 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-05 04:23:35 +00:00
Mark D. Studebaker a30f070533 correct driver ID
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2334 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-05 04:13:39 +00:00
Mark D. Studebaker 7b6c302155 increase max SDRs
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2333 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-03-05 04:10:55 +00:00
Mark D. Studebaker 520da35172 fix comment
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2319 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-28 16:34:08 +00:00
Jean Delvare 6b2f1e18bb Backport Takeru Komoriya's changes from Linux 2.6. This fixes
loading it87 with reset=1.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2316 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-28 15:46:46 +00:00
Jean Delvare 03f3e08d48 w83781d driver doesn't support ASB100 anymore.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2313 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-23 20:25:27 +00:00
Jean Delvare e6d99aedb0 Consider it possible that sensor type is 0 (unused).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2311 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-22 17:48:16 +00:00
Mark D. Studebaker 154c50fa86 don't export unused in6 and temp1
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2304 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-22 04:09:15 +00:00
Jean Delvare f7b2534fba Preserve other bits when forcing temp2/3 to comparator mode.
Backported from Linux 2.6. Requested by Keith Duthie.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2302 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-21 14:10:31 +00:00
Jean Delvare c74c4df722 Define driver ID if i2c-id.h doesn't have it yet.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2298 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-02-20 21:28:03 +00:00