# Fan control: Panther Point and Ivy Bridge (Lenovo S300)

## Flou34

Hi!

I'm new to the Linux world, but with the help of a friend and countless Google requests, I managed to set it up properly to be used by me. 

However, I've now stumpled upon a problem I can't seem to solve by myself. 

I am using a Lenovo IdeaPad S300 with a Panther Point chipset and an Ivy Bridge i3 CPU and after managing to configure CPU frequency scaling, I wanted to enable fan control. I followed this guide.

After activating all the modules mentioned in there and running sensors-detect, the only sensor that is actually detected is coretemp. I proceeded to remove the seemingly unneeded modules and ran pwmconfig:

```
/usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed
```

lm_sensors is running. Output of sensors:

```
acpitz-virtual-0

Adapter: Virtual device

temp1:        +50.0°C  (crit = +127.0°C)

coretemp-isa-0000

Adapter: ISA adapter

Physical id 0:  +50.0°C  (high = +86.0°C, crit = +100.0°C)

Core 0:         +46.0°C  (high = +86.0°C, crit = +100.0°C)

Core 1:         +50.0°C  (high = +86.0°C, crit = +100.0°C)

```

That isn't too surprising, because I think coretemp does exactly what the name suggests: measuring core temperature. 

At lm-sensors.org/wiki/Devices, there's a driver listed for Panther Point and a link to a standalone driver: http://khali.linux-fr.org/devel/misc/i2c-i801/

But, to be completely honest, I don't really know what to do with this information.

Thank you very much for taking the time to help me out!

----------

## roravun

This driver is in the main tree of the kernel. This means you should be able to load it by modprobing it, 

provided you have this module included/compiled into your kernel.

Run

`modprobe -l | grep i801` as root and expect following line:

 *Quote:*   

> kernel/drivers/i2c/busses/i2c-i801.ko

 

Then schedule this module to autoload with /etc/conf.d/modules

Also, have you run sensors-detect?

It would detected the required module automatically and schedule it to autoload.

Have you enabled lm_sensors service?

----------

## Flou34

I ran sensors-detect previously with all available modules built into the Kernel. Nothing but coretemp was detected.

lm_sensors is running.

```
~ # /etc/init.d/lm_sensors status

 * status: started
```

I followed your advice and enabled the i2c-i801 module, without success.

```
~ # lsmod | grep i801

i2c_i801                8559  0 

i2c_core               16530  5 i915,drm_kms_helper,drm,i2c_i801,i2c_algo_bit
```

```
~ # pwmconfig

# pwmconfig revision 5857 (2010-08-22)

This program will search your sensors for pulse width modulation (pwm)

controls, and test each one to see if it controls a fan on

your motherboard. Note that many motherboards do not have pwm

circuitry installed, even if your sensor chip supports pwm.

We will attempt to briefly stop each fan using the pwm controls.

The program will attempt to restore each fan to full speed

after testing. However, it is ** very important ** that you

physically verify that the fans have been to full speed

after the program has completed.

/usr/sbin/pwmconfig: There are no pwm-capable sensor modules installed
```

Am I out of luck here?

----------

## roravun

On my thinkpad T60 the proper way to get reasonable output from sensors was to *first* load the module and then run sensors-detect, allowing it 

to scan  I2C/SMBus. Please load i801 driver, and then run sensors_detect, yesing all questions, and post the output here.

Btw, what is this pwmconfig? It is not even in portage? Are you sure it is not outdated?

----------

## Flou34

```
~ # modprobe i2c_i801

~ # lsmod | grep i801

i2c_i801                8559  0 

i2c_core               16530  5 i915,drm_kms_helper,drm,i2c_algo_bit,i2c_i801

~ # sensors-detect

# sensors-detect revision 5984 (2011-07-10 21:22:53 +0200)

# System: LENOVO 9803 (laptop)

# Board: LENOVO Product Name

This program will help you determine which kernel modules you need

to load to use lm_sensors most effectively. It is generally safe

and recommended to accept the default answers to all questions,

unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.

Do you want to scan for them? This is totally safe. (YES/no): y                                                                                                                                 

Module cpuid loaded successfully.                                                                                                                                                               

Silicon Integrated Systems SIS5595...                       No                                                                                                                                  

VIA VT82C686 Integrated Sensors...                          No                                                                                                                                  

VIA VT8231 Integrated Sensors...                            No                                                                                                                                  

AMD K8 thermal sensors...                                   No                                                                                                                                  

AMD Family 10h thermal sensors...                           No                                                                                                                                  

AMD Family 11h thermal sensors...                           No

AMD Family 12h and 14h thermal sensors...                   No

AMD Family 15h thermal sensors...                           No

AMD Family 15h power sensors...                             No

Intel digital thermal sensor...                             Success!

    (driver `coretemp')

Intel AMB FB-DIMM thermal sensor...                         No

VIA C7 thermal sensor...                                    No

VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to

standard I/O ports to probe them. This is usually safe.

Do you want to scan for Super I/O sensors? (YES/no): y

Probing for Super-I/O at 0x2e/0x2f

Trying family `National Semiconductor/ITE'...               No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Nuvoton/Fintek'...               No

Trying family `ITE'...                                      No

Probing for Super-I/O at 0x4e/0x4f

Trying family `National Semiconductor/ITE'...               No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Nuvoton/Fintek'...               No

Trying family `ITE'...                                      No

Some hardware monitoring chips are accessible through the ISA I/O ports.

We have to write to arbitrary I/O ports to probe them. This is usually

safe though. Yes, you do have ISA I/O ports even if you do not have any

ISA slots! Do you want to scan the ISA I/O ports? (YES/no): y

Probing for `National Semiconductor LM78' at 0x290...       No

Probing for `National Semiconductor LM79' at 0x290...       No

Probing for `Winbond W83781D' at 0x290...                   No

Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware

monitoring devices. This is the most risky part, and while it works

reasonably well on most systems, it has been reported to cause trouble

on some systems.

Do you want to probe the I2C/SMBus adapters now? (YES/no): y

Found unknown SMBus adapter 8086:1e22 at 0000:00:1f.3.

Sorry, no supported PCI bus adapters found.

Module i2c-dev loaded successfully.

Next adapter: i915 gmbus ssc (i2c-0)

Do you want to scan it? (YES/no/selectively): y

Next adapter: i915 gmbus vga (i2c-1)

Do you want to scan it? (YES/no/selectively): y

Next adapter: i915 gmbus panel (i2c-2)

Do you want to scan it? (YES/no/selectively): y

Client found at address 0x4f

Probing for `National Semiconductor LM75'...                No

Probing for `National Semiconductor LM75A'...               No

Probing for `Dallas Semiconductor DS75'...                  No

Probing for `Dallas Semiconductor DS1621/DS1631'...         No

Probing for `Maxim MAX6642'...                              No

Probing for `Texas Instruments TMP421'...                   No

Probing for `Texas Instruments TMP422'...                   No

Probing for `Maxim MAX6633/MAX6634/MAX6635'...              No

Probing for `NXP/Philips SA56004'...                        No

Client found at address 0x50

Probing for `Analog Devices ADM1033'...                     No

Probing for `Analog Devices ADM1034'...                     No

Probing for `SPD EEPROM'...                                 No

Probing for `EDID EEPROM'...                                Yes

    (confidence 8, not a hardware monitoring chip)

Next adapter: i915 gmbus dpc (i2c-3)

Do you want to scan it? (YES/no/selectively): y

Next adapter: i915 gmbus dpb (i2c-4)

Do you want to scan it? (YES/no/selectively): y

Next adapter: i915 gmbus dpd (i2c-5)

Do you want to scan it? (YES/no/selectively): y

Next adapter: DPDDC-B (i2c-6)

Do you want to scan it? (YES/no/selectively): y

Now follows a summary of the probes I have just done.

Just press ENTER to continue: 

Driver `coretemp':

  * Chip `Intel digital thermal sensor' (confidence: 9)

Do you want to overwrite /etc/conf.d/lm_sensors? Enter s to specify other file name?

  (yes/NO/s): y

Done.

You should now start the lm_sensors service to load the required

kernel modules.

Unloading i2c-dev... OK

Unloading cpuid... OK
```

pwmconfig seems to be a part of lm_sensors to me:

```
~ # equery b pwmconfig

 * Searching for pwmconfig ... 

sys-apps/lm_sensors-3.3.1 (/usr/sbin/pwmconfig)

```

Thank you for your patience!

----------

## roravun

Flou34,

Here is what I get on my thinkpad T60: 

```
# sensors-detect revision 5984 (2011-07-10 21:22:53 +0200)

# System: LENOVO 2007YGB (laptop)

This program will help you determine which kernel modules you need

to load to use lm_sensors most effectively. It is generally safe

and recommended to accept the default answers to all questions,

unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.

Do you want to scan for them? This is totally safe. (YES/no): yes

Silicon Integrated Systems SIS5595...                       No

VIA VT82C686 Integrated Sensors...                          No

VIA VT8231 Integrated Sensors...                            No

AMD K8 thermal sensors...                                   No

AMD Family 10h thermal sensors...                           No

AMD Family 11h thermal sensors...                           No

AMD Family 12h and 14h thermal sensors...                   No

AMD Family 15h thermal sensors...                           No

AMD Family 15h power sensors...                             No

Intel digital thermal sensor...                             Success!

    (driver `coretemp')

Intel AMB FB-DIMM thermal sensor...                         No

VIA C7 thermal sensor...                                    No

VIA Nano thermal sensor...                                  No

Some Super I/O chips contain embedded sensors. We have to write to

standard I/O ports to probe them. This is usually safe.

Do you want to scan for Super I/O sensors? (YES/no): yes

Probing for Super-I/O at 0x2e/0x2f

Trying family `National Semiconductor/ITE'...               No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Nuvoton/Fintek'...               No

Trying family `ITE'...                                      No

Probing for Super-I/O at 0x4e/0x4f

Trying family `National Semiconductor/ITE'...               No

Trying family `SMSC'...                                     No

Trying family `VIA/Winbond/Nuvoton/Fintek'...               No

Trying family `ITE'...                                      No

Some hardware monitoring chips are accessible through the ISA I/O ports.

We have to write to arbitrary I/O ports to probe them. This is usually

safe though. Yes, you do have ISA I/O ports even if you do not have any

ISA slots! Do you want to scan the ISA I/O ports? (YES/no): yes

Probing for `National Semiconductor LM78' at 0x290...       No

Probing for `National Semiconductor LM79' at 0x290...       No

Probing for `Winbond W83781D' at 0x290...                   No

Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware

monitoring devices. This is the most risky part, and while it works

reasonably well on most systems, it has been reported to cause trouble

on some systems.

Do you want to probe the I2C/SMBus adapters now? (YES/no): yes

Using driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Next adapter: SMBus I801 adapter at 18e0 (i2c-0)

Do you want to scan it? (YES/no/selectively): yes

Next adapter: Radeon i2c hw bus 0x90 (i2c-1)

Do you want to scan it? (YES/no/selectively): 

```

The stuff at the end is obviously from your GPU...

 *Quote:*   

> pwmconfig seems to be a part of lm_sensors to me: 

 

To be frank I did not know of its existence. This program is just AWESOME.

Finally I will get rid of /proc/acpi/ibm/fan home grown scripts manipulation  :Smile: 

On topic, I do not know what is the cause of this weird behaviour. 

You could check your BIOS settings. Later I will look if we could manually find 

addresses for your chip and shove it down the sensors throat. Unfortunately today I am out of time.Last edited by roravun on Thu Jan 03, 2013 8:33 pm; edited 1 time in total

----------

## BillWho

Flou34,

I'm not sure about the Lenovo, but for a dell laptop I had to enable CONFIG_I8K=m  to get the fan status in conky and sensors.

```
laptop linux # sensors

coretemp-isa-0000

Adapter: ISA adapter

Physical id 0:  +46.0°C  (high = +80.0°C, crit = +85.0°C)

Core 0:         +42.0°C  (high = +80.0°C, crit = +85.0°C)

Core 1:         +44.0°C  (high = +80.0°C, crit = +85.0°C)

acpitz-virtual-0

Adapter: Virtual device

temp1:        +45.5°C  (crit = +84.0°C)

i8k-virtual-0

Adapter: Virtual device

Right Fan:   88830 RPM

CPU:          +45.0°C  

```

I also get the "There are no pwm-capable sensor modules installed" from /usr/sbin/pwmconfig   :Confused: 

----------

## roravun

Flou34,

Please verify that after loading relevant SMBus drivers, you are able to find entry in 'lspci' similar to this:

```

        00:1f.3 SMBus: Intel Corporation NM10/ICH7 Family SMBus Controller (rev 02)

   Subsystem: Lenovo ThinkPad T60/R60 series

   Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-

   Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-

   Interrupt: pin A routed to IRQ 23

   Region 4: I/O ports at 18e0 [size=32]

   Kernel driver in use: i801_smbus

   Kernel modules: i2c-i801

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Above 2 lines should be the same for you.

```

Also verify that you have enabled following options in the kernel:

```

I2C_COMPAT=y  <- Just to be sure...

I2C_HELPER_AUTO=y

I2C_CHARDEV=y

I2C_SCMI=y

I2C_I801=y

```

----------

## Flou34

roravun,

I activated all of the Kernel options you provided (including building I2C_I801 into the kernel and not as a module). 

```
~ # lspci

00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)

00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)

00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)

00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)

00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)

00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)

00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)

00:1f.0 ISA bridge: Intel Corporation HM77 Express Chipset LPC Controller (rev 04)

00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)

00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

02:00.0 Network controller: Intel Corporation Centrino Wireless-N 2230 (rev c4)
```

BillWho,

just to test, I also built CONFIG_i8k, although it says it's for Dell laptops. Sadly, this did not help as well.[/code]

----------

## BillWho

Flou34,

We can't see the driver with plain lspci - paste back

```
awk '/SMBus/,/Kernel/' <(lspci -k)
```

----------

## roravun

Flou34, 

I meant 

```
lscpi -vv
```

(Or better use the command given by BillWho. )

Only verbose mode will give you information whether your chip is really under control of the module.

Unless you have already verified that.

As a side note: 

if you like you can build the driver as a module. I compiled it into my kernel since I stick to the policy that 

if something is unpluggable piece of hardware that is always used it makes no sense to compile it as a module. 

I2c chip certainly fulfills these conditions.

----------

## Flou34

Sorry   :Embarassed: 

```
~ # awk '/SMBus/,/Kernel/' <(lspci -k)

00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)

        Subsystem: Lenovo Device 3977

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

        Subsystem: Lenovo Device 397f

        Kernel driver in use: r8169

```

Does not seem to work correctly, does it?

By the way, maybe I should elaborate on how I came to the conclusion of this laptop using a Panther Point chip. I looked it up on this support page:

 *Quote:*   

> Core Chipset	            Intel HM76 (HM75 ready)

 

This lead me to this page (German)

 *Quote:*   

> HM76 (Panther Point)

 

----------

## BillWho

Flou34,

Actually I was expecting to see this, but yours indicates that no module/driver is in use.

```
laptop linux # awk '/SMBus/,/Kernel/' <(lspci -k)

00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)

   Subsystem: Dell Device 0504

   Kernel modules: i2c-i801

laptop linux # 

```

Compare your config settings with mine 

```
laptop src # awk '/I2C/{if ($1 != "#") print}' /usr/src/linux/.config

CONFIG_MOUSE_SYNAPTICS_I2C=m

CONFIG_I2C=m

CONFIG_I2C_BOARDINFO=y

CONFIG_I2C_COMPAT=y

CONFIG_I2C_CHARDEV=m

CONFIG_I2C_HELPER_AUTO=y

CONFIG_I2C_ALGOBIT=m

CONFIG_I2C_I801=m

CONFIG_I2C_SCMI=m

```

----------

## Flou34

I don't have the 'laptop' command, but I grepped those modules separately. I've got them all built in, except for CONFIG_I2C_ALGOBIT, which is a module.

----------

## roravun

Flou34,

Your I2C chip is not under the control of any driver. No wonder sensors cant find anything.

I think you should build the i801 driver as a module and manually load after your system is up. Or better, build 

everything I2C related as modules, that way it can be easily verified that at least modules are working.

And you are correct as to the fact you have this chip. What is funny, I just noticed my chip has the same path as yours  :Smile: 

```

00:1f.3 SMBus: Intel Corporation NM10/ICH7 Family SMBus Controller (rev 02)

```

```
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04) 
```

If you are in suitable timezone, you can find me on #gentoo (same nick as here) and we should get it sorted out faster, if you like.

----------

## BillWho

Flou34,

Just a FYI, "laptop" is the computer's hostname   :Very Happy: 

```
laptop bill # cat /etc/conf.d/hostname

# Set to the hostname of this machine

hostname="laptop"

```

----------

## roravun

Flou34,

Here: http://bpaste.net/show/68180/  you can find amended version of your kernel configuration.

I have removed tons of unnecessary stuff as well as disabled some ACPI sensors to be sure they do not cause the conflict

we have discovered. Please compile it and try to run it.

NOTE: before you compile, please run `make oldconfig`, to convert config from x86-32 to x86-64.

IMPORTANT: be sure to backup your current working kernel configuration first,

and provide grub entry for it. I can not guarantee you will be able to boot with newly compiled kernel.

Although I did not change any 'mount' critical parts of your configuration.

----------

## roravun

If somebody is curious, or has the same problem, in this case

there is a resource conflict that prevents the i2c_i801 driver from taking control over the chip:

```

ACPI Warning: 0x0000000000003040-0x000000000000305f SystemIO conflicts with Region \_SB_.PCI0.SBUS.SMBI 1 (20120711/utaddress-251)

ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
```

We have not yet resolved the issue.

----------

## s4e8

Enable CONFIG_IEDAPAD_LAPTOP or everything under "X86 Platform Specific Device Drivers"

----------

## roravun

s4e8,

Yes, that is a good idea (although I think Flou34 had this enabled in his original configuration ).

Flou34, 

Here is updated version: http://bpaste.net/show/68288/

----------

## roravun

This probably is a kernel bug.

I have discovered my own thinkpad prints warnings about resource conflicts.

See for example: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1071353

----------

