Bug 4781

Summary: Conservative governor makes me lose my USB keyboard
Product: Power Management Reporter: Richard Van Den Boom (rvdboom)
Component: cpufreqAssignee: Venkatesh Pallipadi (venki)
Status: CLOSED CODE_FIX    
Severity: normal CC: davej, linux, venki
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.12 Subsystem:
Regression: --- Bisected commit-id:
Attachments: dmesg output
Patch to fix OOPs with conservative governor on SMP kernel

Description Richard Van Den Boom 2005-06-23 00:34:14 UTC
Distribution: Slackware-current 
 
Hardware Environment: Bi-Opteron system with Tiger K8W board, Logitech USB 
keyboard 
 
Software Environment: Self-compiled 2.6.12rc6 and 2.6.12 kernels with 
kernel.org sources without patches, GCC 3.4.2, KDE 3.4.1 using the Logitech 
driver. 
 
Problem Description: 
When I set up "conservative" as scaling governor (using a simple 'echo 
"conservative" > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor' for 
CPU0 and CPU1 at boot), I cannot type anything in consoles and applications 
(like Kword, for instance) anymore. The oly way I can get my keyboard back is 
rebooting. 
When I use "ondemand", I don't have such problem at all. 
My keyboard is a Logitech Internet Navigator USB keyboard. I cannot test a PS/2 
keyboard on this system, the PS/2 connector doesn't work since I plugged a 
second CPU in it. Everything works find, though, on this system, with any 
governor except the "conservative" one, so my guess is that it still has some 
quirks. 
 
Steps to reproduce: 
Plug a USB keyboard and set "conservative" as CPU governor for both processors 
on a dual-Opteron system. It occurs every time to me, usually 10 to 20 seconds 
after typing something.
Comment 1 Andrew Morton 2005-07-28 22:20:25 UTC
Richard, is this still happening in 2.6.13-rc4?  Have
any insights been gained??

If it still fails, can you identify the latest 2.6
kernel which worked OK?

Thanks.
Comment 2 Dominik Brodowski 2005-08-05 02:27:00 UTC
Can you create a new attachment with the full dmesg, please?
Comment 3 Jonathan Lin 2005-08-23 14:32:06 UTC
I too am having similar problem with my AMD64 box.
AMD64 3700 socket 754 on ECS K8M800-M2 (1.0) microatx board.
kernel = gentoo source kernel 2.6.12-r9

Ondemand with ignore_nice=1 works fine but conservative with ignore_nice=1 craps
out.
Comment 4 Andrew Morton 2005-09-14 22:45:46 UTC
OK, so Richard has disappeared.   Dave, have you looked at this one?
Comment 5 Dave Jones 2005-09-14 23:25:28 UTC
need more info. the dmesg Dominik asked for would be a good start.
Given the reporter has gone AWOL, we may as well close it, unless Jonathan can
elaborate on "craps out"

This one is very puzzling. Bizarre hardware interactions I'm used to, but the
governor in use should make no difference.
Comment 6 Joern Koerner 2005-09-21 00:07:08 UTC
Created attachment 6067 [details]
dmesg output
Comment 7 Joern Koerner 2005-09-21 00:10:48 UTC
Same on IBM Thinkpad R51:
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
results in loose of the keyboard.

Linux satellite 2.6.13-gentoo-r2 #4 SMP Mon Sep 19 17:05:52 CEST 2005 i686 
Intel(R) Pentium(R) M processor 1700MHz GenuineIntel GNU/Linux

lspci:
0000:00:00.0 Host bridge: Intel Corporation 82855PM Processor to I/O Controller 
(rev 03)
0000:00:01.0 PCI bridge: Intel Corporation 82855PM Processor to AGP Controller 
(rev 03)
0000:00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/
ICH4-M) USB UHCI Controller #1 (rev 01)
0000:00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/
ICH4-M) USB UHCI Controller #2 (rev 01)
0000:00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/
ICH4-M) USB UHCI Controller #3 (rev 01)
0000:00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 
EHCI Controller (rev 01)
0000:00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 81)
0000:00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface 
Bridge (rev 01)
0000:00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller 
(rev 01)
0000:00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus 
Controller (rev 01)
0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM 
(ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01)
0000:00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 
Modem Controller (rev 01)
0000:01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 Lf 
[FireGL 9000] (rev 02)
0000:02:00.0 CardBus bridge: Texas Instruments PCI4520 PC card Cardbus 
Controller (rev 01)
0000:02:00.2 FireWire (IEEE 1394): Texas Instruments: Unknown device 802a (rev 
01)
0000:02:01.0 Ethernet controller: Intel Corporation 82540EP Gigabit Ethernet 
Controller (Mobile) (rev 03)
0000:02:02.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)

Comment 8 Joern Koerner 2005-09-21 00:31:57 UTC
Edit to comment #7: ondemand works, conservative doesn't - just a copy&pase 
mistake.
echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
results in loose of the keyboard.
Comment 9 Joern Koerner 2005-09-21 01:02:39 UTC
Edit to comment #7: ondemand works, conservative doesn't - just a copy&pase 
mistake.
echo "conservative" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
results in loose of the keyboard.
Comment 10 Venkatesh Pallipadi 2005-09-21 18:33:01 UTC
Strange. Do you have problems with the userlevel cpufreq governor as well or 
is it only with conservative governor?
Comment 11 Venkatesh Pallipadi 2005-09-21 19:02:28 UTC
can you do a top on another terminal while changing the governor and see 
whether CPU utilization goes to max when this happens.

Is it only keyboard not functioning or is it the whole system doesn't respond. 
How about network connections and other stuff? 
Are you running on X?
Comment 12 Joern Koerner 2005-09-22 00:21:54 UTC
>Strange. Do you have problems with the userlevel cpufreq governor as well or 
>is it only with conservative governor?

It's the conservative governor only that make some trouble.

>can you do a top on another terminal while changing the governor and see 
>whether CPU utilization goes to max when this happens.

>
>Is it only keyboard not functioning or is it the whole system doesn't respond. 
>How about network connections and other stuff? 
>Are you running on X?

The whole System is functional except the keyboard. (Network, SSH, Mouse, KDE 
ect...)
But when logging in an doing a poweroff/reboot, X terminates and the VESA-TNG FB 
Console
hangs too.

What should I Probe? Booting with 80x25, without X... ?
When I have some spare time (perhaps next week) I'll check this on some other 
Machines.

Comment 13 Joern Koerner 2005-09-22 01:46:02 UTC
After some more tests, when conservatice governor was enabled, the CPU-Freq 
stays at 600MHz whatever I do.

X is not started this time, PREEMPT.SMP crashed (see dmesg)
But when I press some keys, console shows:
atkbd.c: Keyboard on isa0060/serio0 reports too many keys pressed.

Keyboard is still alive, but the somewhere ignored (due to crash)
I'll recompile the kernel without SMP and try again...
Comment 14 Joern Koerner 2005-09-22 03:26:36 UTC
It seems that SMP was the glitch. After recompiling the Kernel without SMP-
Support, conservative works now as expected.
Comment 15 Venkatesh Pallipadi 2005-09-22 15:58:40 UTC
Created attachment 6094 [details]
Patch to fix OOPs with conservative governor on SMP kernel

Hmmmm.. Looks like conservative governor was never tested with SMP kernel.
There is an obvious bug in there.

This patch (just compile tested right now) should fix the bug.

Can you please test it.
Comment 16 Joern Koerner 2005-09-23 02:46:40 UTC
Yes, the patch works now as expected.
I've tested it with PREEMPT.SMP enabled on my Laptop (P4-Mobile/Centrino),
P4 with Hyperthreading enabled/disabled and on Dual Xeon with/without HT 
enabled.

I think you should apply the patch to official kernel tree and close the bug.

Thanks for the help!
Comment 17 Dave Jones 2005-09-23 11:57:42 UTC
Fix sent to Linus for 2.6.14
Comment 18 Jonathan Lin 2005-10-13 20:55:07 UTC
Sorry for gone missing on you guys.  I have applied the patch and so far the
keyboard does not lock up and the system is running fine.  The problem I am
encountering is that the CPU Freq of 1000ghz even tho the
scaling_available_frequencies listed all of them.  I think now it might just be
me being stupid and make some minor mistake.  I will look around more and report
back.
Comment 19 Venkatesh Pallipadi 2005-10-29 08:50:50 UTC
I will close this bug as this patch is in base now.

Feel free to reopen this one or open a new bug if you still have issues.

Thanks.