Commit Graph
622 Commits
Author SHA1 Message Date
Jean Delvare 1b2dbfa2cd Implement read error handling (backport from 2.6).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2610 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-26 09:43:15 +00:00
Jean Delvare 9ec1e83e94 Fix fan_div file when fan count is less than 3.
Change several debugging strings.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2609 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-25 18:50:06 +00:00
Jean Delvare 4fd3781e12 Add VID support to the pc87360 driver.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2603 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-19 21:54:08 +00:00
Jean Delvare f52172bfbc Drop out-of-date init code.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2599 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-19 16:24:57 +00:00
Mark D. Studebaker a535570d62 fix default VRM for w83791d; was undefined 9.2, now 9.0
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2598 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-19 16:17:49 +00:00
Jean Delvare acb6e485ca Refine detection.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2597 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-19 07:14:48 +00:00
Jean Delvare 937734ebdb Change voltage magnitude from 2 to 3, so as to limit the
rounding errors.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2595 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-18 18:17:50 +00:00
Mark M. Hoffman e439883223 Incorporate Khali's review suggestions
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2594 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-13 18:44:23 +00:00
Mark M. Hoffman 326167f967 Add alternate VCORE/in0 calculation method
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2593 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-13 17:32:56 +00:00
Jean Delvare 4c789fad92 Fix temperature limits limits (backport from Jonas Munsin's 2.6
patch).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2586 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-08 19:43:59 +00:00
Jean Delvare 9d921b0e59 Rework fan trustability function.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2585 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-06 17:42:41 +00:00
Jean Delvare 249d4363cf Fix FAN_TO_REG.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2581 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-05 12:27:02 +00:00
Jean Delvare fb884933da Prevent fan_min overflow when changing fan_div.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2580 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-05 09:54:33 +00:00
Jean Delvare be77f5a4ce Initial ADM1030 and ADM1031 support. Contributed by Alexandre
d'Alton.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2573 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-06-03 21:32:19 +00:00
Jean Delvare 0034d3760a Don't read new but disabled in/temp inputs.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2565 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-24 21:13:39 +00:00
Jean Delvare bd3d250159 Initial MAX1619 support, contributed by Alexey Fisher.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2564 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-24 20:25:13 +00:00
Jean Delvare ed4dfa0cbd Rework auto fan clock divider algorithm.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2563 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-24 18:40:07 +00:00
Jean Delvare 488b99274d pc87360 fan clock dividers are now read-only.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2562 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-23 17:35:37 +00:00
Jean Delvare e6679b5f15 Thermal diodes and thermistors share pins.
Read fan low limit at init.
        Do not read temperatures and voltages if no new data is ready.
        Drop PWM debugging.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2554 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-21 12:26:55 +00:00
Jean Delvare e133906d1f Fix temp4_crit not being settable.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2551 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-18 19:50:05 +00:00
Jean Delvare 0faf31634a Fix reading and writing of temp4-6 critical limit.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2548 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-18 17:54:22 +00:00
Jean Delvare 6b9ba068c9 Thermistor support.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2542 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-17 18:35:55 +00:00
Jean Delvare d58370d0a2 Unconditional prevention of 24RF08 corruption.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2541 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-16 16:29:19 +00:00
Jean Delvare 354572a5e6 Lower conversion rate when forcibly enabling monitoring of
battery voltage.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2540 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-16 16:21:19 +00:00
Jean Delvare b1596cd16a Get rid of useless i2c_probe call.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2539 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-16 16:13:07 +00:00
Mark D. Studebaker bb33d50c0e Many PWM fixes:
Fix enable; implement disable; preserve clock select bit;
      /proc value now 0-255; use correct bits in register


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2536 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-16 14:19:57 +00:00
Jean Delvare e36609de86 Move auto clock divider change to separate function.
Also change divider on fan_min setting.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2534 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-15 13:37:48 +00:00
Jean Delvare 8de62138b6 Fix register overflow on setting fan min too low.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2532 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-14 20:41:29 +00:00
Jean Delvare 6555d0a328 Initialize fan clock dividers upon load.
Prevent fan_min register overflow on auto fan clock divider
        decrease.
        Prevent writes on pwm 3 registers on PC87360 and PC87363.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2531 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-14 19:20:08 +00:00
Jean Delvare 961547c959 Discard non-standard Super-I/O exit sequence. Patch by
Bjorn Mork.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2530 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-13 19:53:43 +00:00
Jean Delvare 361f285664 Fix fan clock divider changing from 8 to 4 and back continuously
when no fan is present.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2529 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-13 19:30:51 +00:00
Jean Delvare 5ef0dd8c6a Fan clock dividers change automatically.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2528 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-13 18:58:48 +00:00
Jean Delvare 0ca7f76745 Re-enable VLM and TMS monitoring if needed (init>0).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2524 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-11 18:25:56 +00:00
Jean Delvare 8c83ad61c9 Improve selection of Vref.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2521 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-10 18:57:40 +00:00
Jean Delvare 4e6fcb41d4 Backport memory allocation reworking from Linux 2.6.
Cleanup detach function.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2518 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-09 11:00:59 +00:00
Jean Delvare 5313a73781 Discard unused variable in private driver data.
Less agressive initialization process (do not reset the chip,
        closes ticket #1154; preserve application mode)
        Fix temp1 (instead of temp2) limits being unsettable in application
        mode 2 (tickets #894 and #1219).
        Ensure that temp2 and in4 are not used at the same time (ticket
        #894).


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2516 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-09 07:24:37 +00:00
Jean Delvare 3f690ffac2 Backport memory allocation reworking from Linux 2.6.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2512 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-08 13:37:41 +00:00
Jean Delvare 967bbba20d Do not include SENSORS_INSMOD stuff.
Rework chip initialization.
        New module parameter: init.
        Honor pwm invert bits again.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2507 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-08 10:14:51 +00:00
Jean Delvare e58bec5c89 Forcibly enable in7, in8, in10 and temp3 at init time. They are
internal so they have to exist.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2506 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-02 19:02:00 +00:00
Jean Delvare 6e64cc2517 Lock on reads and writes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2505 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-02 18:28:22 +00:00
Jean Delvare 4ef5ecd429 Inverse beep bits of the as99127f in the driver rather than in the
user-space.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2504 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-02 13:49:14 +00:00
Jean Delvare 3803f854a6 Do not read fan data when monitoring is disabled.
Zero private data on init, since channels can be disabled.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2502 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-05-01 19:08:55 +00:00
Jean Delvare fd1169752d Use a different vref if set to external.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2498 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-30 21:19:39 +00:00
Jean Delvare d51832bad3 Simplify temperature conversions.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2496 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-30 17:37:09 +00:00
Jean Delvare b46272cb2a Add some temporary PWM debugging stuff.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2495 7894878c-1315-0410-8ee3-d5d059ff63e0
2004-04-30 16:57:14 +00:00
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