For some months now, my wife’s laptop was making a strange high pitch whining noise. The noise was not that loud but noticeable and it was the kind that gives you a headache after a while.
As I am the system administrator of the family, my wife asked me to investigate :-) The laptop is a nice Sony VGN-N31M, running Debian Lenny (of course). The noise seemed to come out of the USB ports and indeed unplugging all USB peripherals made it stop. Googling around revealed that it is a fairly common problem of some early Core 2 Duo processors and it is related to power management and especially low power states. (See, for example this article from the Thinkpad wiki for a discussion of the problem).
The solution is quite easy, don’t let the processor to go to very low power states (like C4)! To do this, we need to pass the appropriate option to the “processor” kernel module. For Debian (and possibly for most distributions) just create a file in /etc/modprobe.d/ (with any name) and put inside the line:
options processor max_cstate=2
(you can try using “3” instead of “2”).
However there is a slight complication: the processor module gets loaded by the initrd, before the /etc/modprobe.d directory is examined. So we need to update the initrd:
does the trick. Reboot and the noise is gone.
It took me some hours to figure out why creating the file in /etc/modprobe.d was not enough. Many thanks to Inliniac for documenting the whole process. You can read his post for more details.
(Actually, I write this post as a “thank you” :-) ).