Ticket #2349 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

pwmconfig causes a hard poweroff

Reported by: ticket Owned by: khali
Priority: critical Milestone:
Component: fancontrol Version: 3.0.1
Keywords: Cc: petchko@…

Description

Hi, when I try to execute pwmconfig my system does a hard poweroff. No warning, no nothing, everything just goes the instant I press enter. any help? I'm running Fedora 9, kernal 2.6.25, anthlon 5600, in a shuttle sn68ptg6 case.

thanks, Pavel

Attachments

dmidecode Download (11.1 KB) - added by ticket 6 years ago.
rmmod Download (1.0 KB) - added by ticket 6 years ago.
hwmon-it87-prevent-poweroff-on-Shuttle-SN68PT.patch Download (4.2 KB) - added by khali 6 years ago.
Proposed workaround

Change History

Changed 6 years ago by khali

  • owner changed from somebody to khali
  • priority changed from major to critical
  • status changed from new to assigned
  • component changed from misc to fancontrol

Hmm, no good. What hardware monitoring chip is this? pwmconfig isn't doing much except reading from and writing to a few sysfs files, so if something wrong happens, this must be because the hardware monitoring driver is doing something wrong with your chip. Please provide the output of "sensors", as well as the output of the following command:

grep . /sys/class/hwmon/hwmon*/device/name

If you don't want this ticket to be overlooked, please also give your contact information.

Changed 6 years ago by ticket

sorry, forgot to put my email in the cc field. its petchko@… How will I find out what my hardware monitoring chip is?

sensors output: k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +30.0°C Core0 Temp: +34.0°C Core1 Temp: +35.0°C Core1 Temp: +22.0°C

it8716-isa-0290 Adapter: ISA adapter VCore: +1.14 V (min = +0.00 V, max = +4.08 V) VDDR: +2.98 V (min = +0.00 V, max = +4.08 V) +3.3V: +3.25 V (min = +0.00 V, max = +4.08 V) +5V: +4.89 V (min = +0.00 V, max = +6.85 V) +12V: +11.90 V (min = +0.00 V, max = +16.32 V) in5: +2.10 V (min = +0.00 V, max = +4.08 V) in6: +1.18 V (min = +0.00 V, max = +4.08 V) 5VSB: +4.89 V (min = +0.00 V, max = +6.85 V) VBat: +2.00 V fan1: 890 RPM (min = 0 RPM) fan3: 0 RPM (min = 0 RPM) temp1: +40.0°C (low = -1.0°C, high = +127.0°C) sensor = transistor temp2: +25.0°C (low = -1.0°C, high = +127.0°C) sensor = transistor temp3: +35.0°C (low = -1.0°C, high = +127.0°C) sensor = thermal diode cpu0_vid: +1.100 V

grep output: /sys/class/hwmon/hwmon0/device/name:k8temp /sys/class/hwmon/hwmon1/device/name:it8716

thanks for the help, Pavel

Changed 6 years ago by khali

  • cc petchko@… added

OK, so your hardware monitoring chip is an ITE IT8716F, which is supported by the it87 driver. Its sysfs files are at /sys/class/hwmon/hwmon1/device. Please provide a list of the pwm files present in this directory:

grep . /sys/class/hwmon/hwmon1/device/pwm*

Beware that this simple command may as well power-off your system. At this point I have no idea what is causing this.

I would like to know if there are any messages in the logs when you load the it87 driver. You should at least see the following:

it87: Found IT8716F chip at 0x290, revision X

Please tell me the revision number, as well as any other it87-related message that you find in your logs around that one.

Changed 6 years ago by ticket

Here are the files:
/sys/class/hwmon/hwmon1/device/pwm1:255
/sys/class/hwmon/hwmon1/device/pwm1_enable:1
/sys/class/hwmon/hwmon1/device/pwm1_freq:23437
/sys/class/hwmon/hwmon1/device/pwm2:164
/sys/class/hwmon/hwmon1/device/pwm2_enable:1
/sys/class/hwmon/hwmon1/device/pwm2_freq:23437
/sys/class/hwmon/hwmon1/device/pwm3:254
/sys/class/hwmon/hwmon1/device/pwm3_enable:1
/sys/class/hwmon/hwmon1/device/pwm3_freq:23437

I am rather new to linux, where will I find these logs? And am I correct in assuming that the best way to reload the it87 driver is to do a reboot?

Changed 6 years ago by khali

At least reading the files didn't break anything... And the values look reasonable.

The easiest way to reload the it87 driver is to run the following commands as root (or using sudo):

rmmod it87
modprobe it87

You can see the kernel logs by either looking under /var/log for files named "messages" or "syslog", or by running "dmesg". So typically you would do this as root:

rmmod it87
modprobe it87
dmesg | tail

And report the output.

Changed 6 years ago by ticket

here are the related log entries:

it87: Found IT8716F chip at 0x290, revision 1 it87: in3 is VCC (+5V) it87: in7 is VCCH (+5V Stand-By)

Changed 6 years ago by khali

OK, nothing frightening in the logs. Next thing to try is writing to the pwm files in sysfs. Presumably writing to one of these files will power-off your machine, as you experienced with pwmconfig. So, please make sure that you have no work in progress and can afford a power-off. The test sequence would be:

cd /sys/class/hwmon/hwmon1/device
sync
echo 1 > pwm1_enable
echo 1 > pwm2_enable
echo 1 > pwm3_enable
echo 255 > pwm1
echo 255 > pwm2
echo 255 > pwm3

Please report at which point the power-off happens, if it happens.

For future reference, it would also be great if you could attach the output of the following commands (one attachment per command please):

rmmod it87 && isadump 0x295 0x296
dmidecode

Changed 6 years ago by ticket

Changed 6 years ago by ticket

Changed 6 years ago by ticket

the power-off happens at echo 255 > pwm2. All other commands execute with no problems.

Changed 6 years ago by khali

Could be that PWM2 is connected to something else than a fan on your system. I see that the fan input 2 is disabled.

I would need another chip dump:

isadump -k 0x87,0x01,0x55,0x55 0x2e 0x2f

Changed 6 years ago by ticket

How will I find out what PWM2 is connected to? Is it one of the lines from psu or one of the plugs on the motherboard? Fan input two is indeed not connected to anything. I only have one case fan in this system, its the shuttle ICE fan.

[Pavel@localhost ~]$ sudo isadump -k 0x87,0x01,0x55,0x55 0x2e 0x2f
WARNING! Running this program can cause system crashes, data loss and worse!
I will probe address register 0x2e and data register 0x2f.
Continue? [Y/n] y
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 00 00 00 00 00 00 00 07 00 00 00 00 00 00 00 00 
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
20: 87 16 01 01 00 1e 00 1f 00 00 00 00 1f 00 00 00 
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
60: 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 
70: 00 01 20 38 00 04 00 00 00 00 00 00 00 00 00 00 
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
b0: 00 00 00 00 00 00 00 00 00 00 12 00 00 00 00 00 
c0: 1e 00 1f 00 00 00 00 00 1e 00 1f 00 00 00 00 00 
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
f0: 00 00 00 00 00 00 00 00 00 00 00 00 32 00 00 00

Changed 6 years ago by khali

PWM2 could be connected to pretty much anything, but I can't think of anything reasonable. That's a question you would need to ask to your motherboard manufacturer. I think it's pretty odd to abuse a fan output pin that way, as it can only cause trouble, but the fact that writing to file pwm2 powers off your system is a rather clear indication that this is what your motherboard manufacturer did.

Unfortunately, I can't find anything useful in the dumps that would let the driver decide to disable PWM2. Pin 10 is really configured for FAN_CTL2 function, and it is set to manual PWM mode. It really looks like a standard fan speed control setup.

So, the only solution I can come up with, is to check specifically for this system when the it87 driver is loaded (using DMI strings) and disable PWM2 for this system. I'll write a patch doing that, stay tuned.

Changed 6 years ago by khali

Proposed workaround

Changed 6 years ago by khali

  • status changed from assigned to closed
  • resolution set to fixed

Fix is in kernel 2.6.27:  http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98dd22c3e086d76058083432d4d8fb85f04bab90

I have also sent a reworked version of the patch for the 2.6.26 and 2.6.25 stable trees.

Note: See TracTickets for help on using tickets.