Ticket #2227 (closed enhancement: fixed)

Opened 6 years ago

Last modified 6 years ago

it8718 supports 5 fans

Reported by: Paul.Vriens@… Owned by: khali
Priority: minor Milestone: 2.10.4
Component: hardware Version: 2.10.3
Keywords: it8718 Cc:

Description

Hi,

Apparently the it8718f supports upto 5 fans. My mainboard (Gigabyte GA-P35-DS4) has 5 fan connectors and I actually have 3 connected. One of them on a connector which isn't covered by the 3 fans that the it87 covers.

I'm not sure this is the right place as the kernel module also doesn't cover 5 fans.

Cheers,

Paul

Attachments

libsensors-it87-extra-fans.patch Download (4.3 KB) - added by khali 6 years ago.
User-space support for it87 fan4 and fan5
hwmon-it87-support-extra-fans.2.patch Download (6.0 KB) - added by khali 6 years ago.
Support for fan4 and fan5 in it87

Change History

  Changed 6 years ago by ticket

Ouch, the summary should read 'it8718' not 'it8717'.

  Changed 6 years ago by ticket

And I think 'Enhancement' should be 'Enhancement needed' :-), so it's a 'defect'.

  Changed 6 years ago by khali

  • cc Paul.Vriens@… removed
  • summary changed from it8717 supports 5 fans to it8718 supports 5 fans
  • reporter changed from ticket to Paul.Vriens@…

Summary fixed.

There is no bug in the driver, you are asking for an additional feature, so "enhancement" is the right category and "defect" isn't.

Note that on some motherboards, the additional fans are not handled by the IT8716F or IT8718F but by a second hardware monitoring chip on the SMBus. You should make sure this isn't the case for you as well.

If you only have 3 fans, a quick workaround would be to connect them to the 3 fan headers which are already supported by the it87 driver.

follow-up: ↓ 5   Changed 6 years ago by ticket

The workaround is of course possible, although I hate workarounds (and I have to buy another cable, because it's too short to reach the other connector). I'm not sure that this motherboard uses the 8718 for all fans, but it's a wild guess. Is there way to test this (without opening the case). What are the 'problems' if the it87 driver was extended to 5 fans (maybe only for the it8718)?

in reply to: ↑ 4   Changed 6 years ago by khali

Replying to ticket:

I'm not sure that this motherboard uses the 8718 for all fans, but it's a wild guess. Is there way to test this (without opening the case).

A register dump would tell. Assuming that your chip's hardware monitoring function lives at 0x290, the command would be:

isadump 0x295 0x296

If your address is different, adjust the command.

What are the 'problems' if the it87 driver was extended to 5 fans (maybe only for the it8718)?

No particular problem, just that I don't know when I (or someone else) will have the time to implement support for the two additional fans.

The IT8716F and late revisions of the IT8712F support up to 5 fans too.

  Changed 6 years ago by ticket

Here is the output for 'isadump 0x295 0x296'

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 13 10 10 00 ff ff 00 37 ff 87 54 09 17 e3 ff 62 
10: ff ff ff 73 d7 81 80 7f 02 ff 01 ff ff ff ff ff 
20: 48 76 cd b5 00 03 03 c2 c2 22 1c fe 80 f0 6c 6c 
30: ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 
40: 7f 7f 7f 7f 7f 7f 5f 74 2d 40 9c 22 ff ff ff ff 
50: ff 2a 7f 7f 7f 50 fd fd 90 fd 37 12 60 00 00 00 
60: 00 14 7f 23 90 03 ff ff 00 14 41 23 90 03 ff ff 
70: 00 14 41 23 90 03 ff ff ff ff ff ff ff ff ff ff 
80: 19 02 00 00 ff ff 00 00 00 00 00 00 00 00 02 00 
90: 41 ff 22 00 41 7f 22 00 ff ff ff ff ff ff ff ff 
a0: 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff 
b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 

It doesn't seem trivial to add the 2 fans to the driver as (from the datasheet) it appears to not be in line with the way the other 3 are treated. Kernel-hacking is not one of my specialties.

  Changed 6 years ago by khali

  • owner changed from somebody to khali
  • status changed from new to assigned

The dump shows that fan4 is in use (1256 RPM) and fan5 isn't.

Adding support shouldn't be too difficult, the it87 driver in 2.6.19 and later already supports 16-bit fan values. The only difficulty is that the fan4 and fan5 pins can be used for other functions, so we can't just create fan4 and fan5 if the chip supports them. We need to make sure they are really available. And for the IT8712F, we also need to check the chip revision first.

  Changed 6 years ago by ticket

Ok, in my case that must mean (Gigabyte GA-P35-DS4):

CPU_FAN: fan1
SYS_FAN2 or NB_FAN: fan2
PWR_FAN: fan3
SYS_FAN1: fan4
NB_FAN or SYS_FAN2: fan5

If needed I can check by changing some cables.

  Changed 6 years ago by khali

Is the BIOS reporting 5 fan speeds? I'm asking because your fan5 is disabled in the IT8718F, so I'd be quite surprised it the BIOS was able to report it.

Changed 6 years ago by khali

User-space support for it87 fan4 and fan5

  Changed 6 years ago by khali

I attached one kernel patch and one user-space patch. I can't test them but they should give you your missing fan speed reading, with low limit and alarm. Please try it and report.

  Changed 6 years ago by ticket

Thanks, I will see if I can test them :-). You're right btw fan5 (NB_FAN) is not reported in the BIOS.

  Changed 6 years ago by khali

North bridge fans are often two-wire fans, so they can't be monitored :-(

  Changed 6 years ago by ticket

I've tried to patch against current kernel GIT but it fails. Most of the lines you change in you're patch have 'data' instead of 'client'. For example part of you're patch:

@@ -555,7 +555,7 @@ static ssize_t set_fan_min(struct device
        }

        data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
-       it87_write_value(data, IT87_REG_FAN_MIN(nr), data->fan_min[nr]);
+       it87_write_value(data, IT87_REG_FAN_MIN[nr], data->fan_min[nr]);
        mutex_unlock(&data->update_lock);
        return count;

where 'my' it87.c contains:

        data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
        it87_write_value(client, IT87_REG_FAN_MIN(nr), data->fan_min[nr]);
        mutex_unlock(&data->update_lock);
        return count;

Am I missing something?

  Changed 6 years ago by khali

My patch is on top of the latest -mm, not the latest Linus' tree. Sorry for not telling you. So you're missing these two patches to the it87 driver:

http://lm-sensors.org/kernel?p=kernel/mhoffman/hwmon-2.6.git;a=commitdiff;h=6d8cc2c5f3b69870c49419a992d415a87d8b3536

http://lm-sensors.org/kernel?p=kernel/mhoffman/hwmon-2.6.git;a=commitdiff;h=6e38cccf5557263b3a23b37132e5977118b999c6

Apply these first, and then my patch, and it should work.

  Changed 6 years ago by ticket

I patched and build the kernel. I've also downloaded the latest snapshot of lm_sensors and added you're patch. I do have a fan4 now (and as expected no fan5), but with a speed of -1, so something is missing. I'll have another look in the code.

Changed 6 years ago by khali

Support for fan4 and fan5 in it87

  Changed 6 years ago by khali

Sorry, one change was missing. I've updated the patch, please try again.

  Changed 6 years ago by ticket

That's exactly what I've just changed :-). Now compiling.

  Changed 6 years ago by ticket

Yep, that did the trick. Thanks very much for your fast patches. I'm as always amazed by the fact how fast things can go in an 'open' world.

Now I just have to wait to wait till everything ends up in the main F7 packages :-).

Thanks again.

  Changed 6 years ago by khali

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

User-space part was committed to lm-sensors SVN (changeset r4565) so it'll be in 2.10.4.

Kernel patch was submitted for inclusion:
 http://lists.lm-sensors.org/pipermail/lm-sensors/2007-July/020303.html

If you insist on showing your appreciation, I can point you to my wishlist :)
 http://khali.linux-fr.org/wishlist.html

  Changed 6 years ago by ticket

  • status changed from closed to reopened
  • resolution fixed deleted

(I'm not sure if I should re-open, so sorry if I shouldn't). I've been watching the current kernel (2.6.13-rc5 and the latest one from Andrew Morton 2.6.23-rc4-mm1). The patch doesn't seem to be in. Any idea?

  Changed 6 years ago by khali

The problem is that the hwmon subsystem maintainer did not pick my patch yet. Presumably he is waiting for someone to review it, but nobody volunteered to do so. I've just sent it again, let's see what happens.

  Changed 6 years ago by khali

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

My patch was accepted by the hwmon subsystem maintainer and is staging in -mm now.

Note: See TracTickets for help on using tickets.