# HP nx6235 - which kernel and patches give best fan control?

## gentonix

I've tried to get everything working following the guide from gentoo-wiki.org but the patch provided in the article is rather old and doesn't seem to work when resuming from suspend. So if there are any nx6325 users here would you be so kind to share your knowledge on the issue. Which kernel and patches are you using and does the fan control work fine? What about when resuming from suspend?

----------

## nephros

I have a different HP compaq model, but as I understand it most of the fan problems when resuming come from buggy DSDTs; have you tried replacing the DSDT with a patched one from http://acpi.sourceforge.net/dsdt/index.php ?

Anyway, I use suspend2-sources  (2.6.16-r12 ATM), simply because suspend2 works better than swsup on my nx6125.

----------

## tux2

First of all check your BIOS version. Do you have the new BIOS, F02? That should work better than the old one.

Replacing DSDT isn't needed any more. OR I can't see any differences between the fixed DSDT and the orginal one.

The thermal patches are included in newer kernel (since 2.6.18-rc1 I think).

I use 2.6.18-rc6. Mostly it works perfekt (sometimes the temperature won't update and I don't know why, and this is the problem why the fan will not go on)

a (possible) workaround:

add this to /etc/conf.d/local.start

```

echo 1 > /proc/acpi/thermal_zone/TZ1/polling_frequency

echo 1 > /proc/acpi/thermal_zone/TZ2/polling_frequency

echo 1 > /proc/acpi/thermal_zone/TZ3/polling_frequency

watch acpi -V &>/dev/null &

```

But I don't know if this work on resume too.

Does your battery/ac work perfektly?

----------

## gentonix

Thanks for the answer. 

I have bios F02 and I'm currently in the process of moving to 2.6.18rc6. I'll try the script too. With gentoo-sources 2.6.17-r4 I was previously using the AC/Battery status didn't update, and it doesn't look like it's working out-of-the-box with this one either.

----------

## tux2

Hi,

2.6.18 is out and have some fixes for your problem included.

Have you something special configured to use this notebook with suspend2?

----------

## gentonix

Ok, I've patched the vanilla 2.6.18 with the patches from suspend2 but I haven't tried suspending yet, because there's still lots of trouble with even basic fan control. The temperatures of thermal zones just stop updating at some point (even if I have the echo 1 > /proc/acpi/thermal_zones/TZ etc script running), and after that there is no fan control. If the fan is running fast when the temperatures stop updating it will remain so. If it's running slow, it will not spin up no matter how hard I stress the cpu. Running acpi -t doesn't help. When running Windows I noticed that there are quite long times when the temperature isn't updated also, but still the fan spins up when needed. 

On the positive side: the AC/Battery status now works perfectly, as does sound with the kernel alsa drivers.

----------

## tux2

hm.. well.. my fan now works perfectly, but AC/Battery only sometimes   :Laughing: 

ok, what have I done?

There is a DSDT-file at acpi.sf.net which should control the fan correctly (but the warnings aren't fixed, so I have googled and fixed it (I will upload it later, sry)

(And sorry about my first post, I was wrong. Fan and AC/Battery _are_ DSDT stuff.   :Embarassed:  )

Then patch your kernel for using this DSDT file and put it into a initramfs.

Reboot and enjoy (I have 'watch acpi -V &>/dev/null &' still running)

I've searched for the AC/Battery problem and found something interested:

At HARDWARE Gentoo on HP Compaq nx6325 he describes three different booting symptoms. He wrote this:

 *Quote:*   

> If the system comes up, and the HP logo and boot options disappear in about 5 seconds, then it's all fine. No "stop" during boot, AC/Battery status works as intended.

 

That's true, but what causes the boot process hanging?

I found this: ( I don't know the url anymore.. I think it was on a novell website)

 *Quote:*   

> There are three ways to workaround about this hanging:
> 
> 1. Remove all batterys and AC cable and then insert it again
> 
> 2. Start windows before linux
> ...

 

last method sounds strange.. I haven't it tested yet.

Someone at a hp forum wrote that his battery discharged fast even if he didn't use his system. The clock(bios) consumes energy from the battery before using the internal CMOS-battery. Maybe the BIOS saves something more about the last suspend/halt? That would explain the first workaround. BUT this is only a suggestion, I don't know more about this.

So long,

tux2  :Smile: 

----------

## gentonix

I found out about the psmouse problem too, it affects many HP laptop models. Basically it's fixable by just doing rmmod psmouse before rebooting or halting, or preferably adding it to the halt and reboot scripts. I've also found out that if the thermal zone updating stops, I can make it work by doing 

```

# rmmod thermal; modprobe thermal

```

it will freeze again soon after that though.

I have the model with a Sempron processor, I wonder if it affects this problem. I'd be interested to try the fixed dsdt, though I wonder if there's some processor specific stuff there...?

Here's my kernel power management config, in case there's something wrong there:

```

#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

CONFIG_PM_LEGACY=y

# CONFIG_PM_DEBUG is not set

# CONFIG_SOFTWARE_SUSPEND is not set

CONFIG_SUSPEND2=y

#

# Image Storage (you need at least one writer)

#

# CONFIG_SUSPEND2_FILEWRITER is not set

CONFIG_SUSPEND2_SWAPWRITER=y

#

# General Options

#

CONFIG_SUSPEND2_DEFAULT_RESUME2=""

# CONFIG_SUSPEND2_KEEP_IMAGE is not set

CONFIG_SUSPEND2_REPLACE_SWSUSP=y

CONFIG_SUSPEND_SHARED=y

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=y

CONFIG_ACPI_HOTKEY=y

CONFIG_ACPI_FAN=m

# CONFIG_ACPI_DOCK is not set

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=m

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

CONFIG_ACPI_DEBUG=y

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

CONFIG_X86_PM_TIMER=y

# CONFIG_ACPI_CONTAINER is not set

# CONFIG_ACPI_SBS is not set

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

# CONFIG_CPU_FREQ_STAT_DETAILS is not set

# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y

# CONFIG_CPU_FREQ_GOV_PERFORMANCE is not set

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=y

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=y

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

CONFIG_X86_POWERNOW_K8=y

CONFIG_X86_POWERNOW_K8_ACPI=y

# CONFIG_X86_GX_SUSPMOD is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

# CONFIG_X86_SPEEDSTEP_ICH is not set

# CONFIG_X86_SPEEDSTEP_SMI is not set

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

#

# shared options

#

# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

# CONFIG_X86_SPEEDSTEP_LIB is not set

```

----------

## tux2

I've uploaded it here: http://people.fh-landshut.de/~sprecht/gentoo/Hewlett_Packard-nx6325-F02-custom.asl.gz

I downloaded the DSDT from acpi.sf.net.

 *wschenck wrote:*   

> Fixed:
> 
>  - CPU fan would turn off after a while without being able to be turned on again

 

and fixed the warnings that still exists with wschenck's one.

This is my kernel power management config:

```

#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

CONFIG_PM_LEGACY=y

CONFIG_PM_DEBUG=y

# CONFIG_PM_TRACE is not set

# CONFIG_SOFTWARE_SUSPEND is not set

CONFIG_SUSPEND_SMP=y

CONFIG_SUSPEND2_CRYPTO=y

CONFIG_SUSPEND2=y

#

# Image Storage (you need at least one writer)

#

# CONFIG_SUSPEND2_FILEWRITER is not set

CONFIG_SUSPEND2_SWAPWRITER=y

#

# General Options

#

CONFIG_SUSPEND2_DEFAULT_RESUME2="/dev/sda8"

# CONFIG_SUSPEND2_KEEP_IMAGE is not set

CONFIG_SUSPEND2_REPLACE_SWSUSP=y

CONFIG_SUSPEND_SHARED=y

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

# CONFIG_ACPI_SLEEP_PROC_SLEEP is not set

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=y

CONFIG_ACPI_HOTKEY=m

CONFIG_ACPI_FAN=y

CONFIG_ACPI_DOCK=m

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_HOTPLUG_CPU=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_CUSTOM_DSDT_INITRD=y

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

CONFIG_X86_PM_TIMER=y

CONFIG_ACPI_CONTAINER=y

# CONFIG_ACPI_SBS is not set

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

CONFIG_CPU_FREQ_TABLE=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=y

CONFIG_CPU_FREQ_GOV_USERSPACE=y

CONFIG_CPU_FREQ_GOV_ONDEMAND=m

CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

#

# CPUFreq processor drivers

#

CONFIG_X86_ACPI_CPUFREQ=m

# CONFIG_X86_POWERNOW_K6 is not set

# CONFIG_X86_POWERNOW_K7 is not set

CONFIG_X86_POWERNOW_K8=y

CONFIG_X86_POWERNOW_K8_ACPI=y

# CONFIG_X86_GX_SUSPMOD is not set

# CONFIG_X86_SPEEDSTEP_CENTRINO is not set

# CONFIG_X86_SPEEDSTEP_ICH is not set

# CONFIG_X86_SPEEDSTEP_SMI is not set

# CONFIG_X86_P4_CLOCKMOD is not set

# CONFIG_X86_CPUFREQ_NFORCE2 is not set

# CONFIG_X86_LONGRUN is not set

# CONFIG_X86_LONGHAUL is not set

#

# shared options

#

# CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set

# CONFIG_X86_SPEEDSTEP_LIB is not set

```

----------

## gentonix

Thanks for the file! I dumped my own dsdt, looked at the differences between it and yours (there were some others than the fan section too), made some changes in the fan control section, and now I can control the fans. Now after I resume from suspend-to-ram I can do 

```
echo 0 > /proc/acpi/fan/C352/state
```

 and the fan spins up!

I'm a little puzzled about how the fan control works. There are four fan resources and there are values 0 and 3 available. 3 stops the resource and 0 starts it. C34F is the loudest setting, it also starts all the others. C350 is the second loudest setting, it also starts C351 and C352. C351 is the second quietest and also starts C352. C352 is the quietest setting. You can also turn the fan off completely by setting the state of C352 to 3. The thing that I don't understand is why there are four fan resources, after all there's just one actual fan in the laptop (if I'm not mistaken). This seems like quite an ankward way of controlling the fan.

Anyway, interesting stuff this dsdt, I'll have to investigate further. But now that I can control the fans manually, I don't have to worry about overheating that much.

----------

## tux2

Take a look at /proc/acpi/thermal_zone/TZ1/trip_points:

```

hp6325 ~ # cat /proc/acpi/thermal_zone/TZ1/trip_points

critical (S5):           105 C

passive:                 95 C: tc1=1 tc2=2 tsp=100 devices=0xdffed338 0xdffed324

active[0]:               75 C: devices=0xdffdeab8

active[1]:               65 C: devices=0xdffdea54

active[2]:               55 C: devices=0xdffdea04

active[3]:               16 C: devices=0xdffde9b4

```

There are 4 active-states, each one presents one fan-state. If a trip_point is reached, an other state will be activated. This activates the fan-speed too.

active[3] -> C352

active[2] -> C351

active[1] -> C350

active[0] -> C34F

Some examples:

If your cpu-temp is:

```

<16° -> all off

>16° && <55°  --> active[3] = on , others off

>55° && <65°  --> active[3] = on, active[2] = on , others off

...

```

All this activities are controlled by ACPI (and defined in the DSDT file)

You can watch this ACPI-events with 'acpi_listen'

This programm will show you when you press the LID-button or when you remove the ac-cable or when the fan-state change.

Now I will try to get suspend2ram and suspend2disk working. I hope it's easier   :Laughing: 

----------

## mfocker

Hi there, I also have a nx6325 (TL-52), and was wondering how do I build the initrd and how to add the patched DSDT to this initrd?

I use gentoo-sources.

I know that with genkernel one can build an initrd, but how to add the modified DSDT?

----------

## nephros

 *mfocker wrote:*   

> Hi there, I also have a nx6325 (TL-52), and was wondering how do I build the initrd and how to add the patched DSDT to this initrd?
> 
> I use gentoo-sources.
> 
> I know that with genkernel one can build an initrd, but how to add the modified DSDT?

 

User jetblack has written a wonderful HOWTO including this. Maybe it can help you (Section 9 answers your question BTW).

----------

## mfocker

 *nephros wrote:*   

> User jetblack has written a wonderful HOWTO including this. Maybe it can help you (Section 9 answers your question BTW).

 

Excellent! Thanks!

Shall dig into that one, when a suitable time gap appears in the near future.  :Smile: 

----------

