Bug 142329

Summary: keyboard misbehavior after APM suspend recovery (on Thinkpad T40)
Product: [Fedora] Fedora Reporter: Satish Balay <balay>
Component: kernelAssignee: Dave Jones <davej>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: alberto.gonzalez.b, barryn, eric_a_benson, jurgen, pfrields, tapani+redhat, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-15 18:15:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
lspci, lsmod, dmesg
none
fix for corrupted keyboard after resume none

Description Satish Balay 2004-12-08 23:12:38 UTC
Description of problem:
During recovery from APM suspend the keyboard doesn't recover properly - and
keyboard functionality is lost. 'Mouse' continues to work (and logging in
remotely via network continues to work)

Version-Release number of selected component (if applicable):

kernel-2.6.9-1.698_FC3
kernel-2.6.9-1.667

How reproducible:
perhaps 1 in 10 tries.

Steps to Reproduce:
1. install FC3 on a thinkpad T40
2. install latest updates
3. boot to APM & console mode with 'acpi=off 3'
4. try suspend with 'Fn-F3' (and restore with 'Fn')
- and see if the keyboard input continues to work
 Repeat '4' untill error messages on console.
  
Actual results:

The keyboard stops working - and different chars appear on the screen.
Alt-Ctrl-Del doesn't work. 

- However the mouse continues to work (so if I'm in gnome - I can reboot)
- Netowork continues to work - so if I can login via netowrk - then I can reboot)

Expected results:

No such crash

Additional info:

Normally this happens with X. I've tried reproducing it in 'console' only mode -
and it did crash.

Normally I also have 'ath_pci' (madwifi) driver loaded - but for this test run -
It wan't loaded

I have the following messages in /var/log/messages (after the crash)
Dec  8 16:35:39 asterix kernel: PCI: Sharing IRQ 11 with 0000:02:00.0
Dec  8 16:35:39 asterix kernel: hub 1-0:1.0: reactivate --> -22
Dec  8 16:35:39 asterix kernel: hub 1-0:1.0: reactivate --> -22
Dec  8 16:35:39 asterix kernel: atkbd.c: Unknown key pressed (translated set 2,
code 0x5a on isa0060/serio0).
Dec  8 16:35:39 asterix kernel: atkbd.c: Use 'setkeycodes 5a <keycode>' to make
it known.
Dec  8 16:35:39 asterix kernel: atkbd.c: Unknown key pressed (translated set 2,
code 0x5a on isa0060/serio0).
Dec  8 16:35:39 asterix kernel: atkbd.c: Use 'setkeycodes 5a <keycode>' to make
it known.
Dec  8 16:35:41 asterix kernel: atkbd.c: Unknown key pressed (translated set 2,
code 0x5a on isa0060/serio0).
Dec  8 16:35:41 asterix kernel: atkbd.c: Use 'setkeycodes 5a <keycode>' to make
it known.
----

Comment 1 Satish Balay 2004-12-08 23:12:38 UTC
Created attachment 108159 [details]
lspci, lsmod, dmesg

Comment 2 Satish Balay 2004-12-08 23:23:49 UTC
Also - this 'crash' happens with ACPI as well
http://www.redhat.com/archives/fedora-list/2004-December/msg02557.html

Comment 3 Pete Toscano 2004-12-09 18:47:20 UTC
I've seen this with my T40, APM, and the ipw2100 driver.  The first time I've
seen it happen was this morning.


Comment 4 Satish Balay 2004-12-13 22:50:10 UTC
Still happens with 2.6.9-1.715_FC3 (no madwifi install yet)

I'm logged into gnome - and the breakage happened perhaps after 15th (or so) attempt

I can continue to login remotely into this machine.

Comment 5 Satish Balay 2004-12-15 22:13:59 UTC
Juergen reposted this issue on LKML - and looks like this is an
upstream issue (with folks having this problem with SuSE/Debian) - but
so far its primarily thinkpads (T40/T41P/T42/X31)

http://www.ussg.iu.edu/hypermail/linux/kernel/0412.1/1265.html

Maybe this is thinkpad specific (perhaps bios) issue..

Comment 6 Satish Balay 2004-12-15 22:45:27 UTC
I've now updated BIOS on the T40 from 3.08a to 3.13. I've tried suspend/resume
with 715 kernel for about 25 times - but couldn't reproduce the error.

I'll go back to my normal 3 suspends a day routine - and see if this issue
reappears. (and now back to 681 kernel)

Comment 7 Satish Balay 2004-12-16 00:06:24 UTC
BTW: BIOS update  requires 'Embedded Controller Program' update. I've updated
mine from 1.02 to 3.04 (to be consitant with the 3.13-bios requirements - but in
the wrong order)

Adding this text here - in case others are planning on trying a bios update.

Comment 8 Satish Balay 2004-12-16 02:16:09 UTC
Ok - it happened again - this time with 681_FC3 - so the bios updates are not
the solution.

Comment 9 Valentine Kouznetsov 2004-12-16 21:45:07 UTC
Hi, I have similar problems with Compaq Evo N600c. It started when I
upgraded from FC2 to FC3. BUT!!! The problem solved if you manually
download source kernel-2.6.9-1.681_FC3.src.rpm, isntall it and build
kernel manually. Here what I did:
1) rpm -ivh kernel-2.6.9-1.681_FC3.src.rpm
2) cd /usr/src/redhat/SPECS
3) rpmbuild -bp --target=i686 kernel-2.6.spec
this step only does unpacking the kernel and applying patches.
4) build kernel manually 
    - cd /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/
    - make xconfig (oldconfig)
    - make bzImage && make modules && make modules_install
    - cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.9-1.681_custom
    - mkinitrd /boot/initrd-2.6.9-1.681_custom.img 2.6.9-prep
Once installed APM works fine again.

I think there is a bug either in a build target or post of FC3 spec file.
The kernel is fine, it's certainly FC3 specific bug.
Valentin.

Comment 10 Valentine Kouznetsov 2004-12-19 23:28:50 UTC
Hi,
strange things happens, even first attempts of using custom build kernel
gave working apm system, lately I got still the same problem with apm
as before. 
Valentin

Comment 11 Valentine Kouznetsov 2004-12-21 05:03:34 UTC
Hi,
it seems to me I found one solution which works for my laptop,
Compaq Evo N600c. I just add atkbd.reset option to FC3 kernel and
everything works fine, although I do see the following messages in my
logs:
Dec 20 23:52:59 localhost kernel: atkbd.c: keyboard reset failed on
isa0060/serio1
Dec 20 23:52:59 localhost kernel: atkbd.c: keyboard reset failed on
isa0060/serio2
Dec 20 23:52:59 localhost kernel: atkbd.c: keyboard reset failed on
isa0060/serio3
Dec 20 23:52:59 localhost apmd[2557]: Normal Resume after 00:00:14
(96% unknown) AC power

But I think they correspond to other "optional keyboards" (serio1,2,3)
and the one I'm using is assigned as serio0.

It would be interesting if other people try this option.
Valentin.


Comment 12 Jürgen Botz 2005-03-01 21:22:21 UTC
Valentine (comment #11) must have been mistaken or lucky... giving the
kernel the atkbd.reset boot-time option does not solve the problem.  I
still get the hosed keyboard after some some sleep-wake cycles,
usually between 2 and 8.

Comment 13 Need Real Name 2005-03-17 00:10:36 UTC
I have had this same problem on waking up from ACPI sleep on a Thinkpad T41p in
FC3 with many different kernels. The mouse (Trackpoint) is fine, everything else
is fine, but the keyboard generates strings of garbage whenever you touch it. I
have noticed that it seems to happen if I touch the keyboard during the wake-up
process. If I wait until it is completely awake before touching the keyboard, it
is fine, but if I touch a key before then it gets into this state. There may be
other ways to trigger the problem but it happens every time when I do this.

Comment 14 Tapani Tarvainen 2005-03-25 06:40:44 UTC
I have the same problem in an ancient HP Omnibook 4100, which has been running  
various Linux versions starting with 2.0.something when it was new in 1998,  
with no apm problems whatsoever. With FC3 the keyboard gets messed up every 
time after returning from suspend. It's not completely random though, each key 
seems to produce same effect each time, and as if the key got stuck. E.g., 'a' 
acts like hitting return and holding it down, 't' is like holding 'z', &c. 
Mouse continues to work normally.  
 
  

Comment 15 Tapani Tarvainen 2005-03-25 14:55:07 UTC
Additional note: I built 2.6.11.5 straight from kernel.org sources 
and the problem went away. Given Valentin's experience above it may 
be too early to declare victory, but for now things look good. 
 
 

Comment 16 Satish Balay 2005-04-08 23:38:13 UTC
There is a post on linux-thinkpad list about this bug & a patch. Adding this
reference to bugzilla

http://mailman.linux-thinkpad.org/pipermail/linux-thinkpad/2005-April/025480.html

Comment 17 Jürgen Botz 2005-04-09 16:40:43 UTC
Created attachment 112911 [details]
fix for corrupted keyboard after resume

Comment 18 Jürgen Botz 2005-04-09 16:43:59 UTC
I can confirm that this patch seems to fix the problem.  I can no longer hose
the keyboard with many suspend/resumes, even if I bang on some keys right after
wakeup starts.  I'm including a version of the patch adapted for the latest FC3
kernel (2.6.10-1.770_FC3) SRPM.




Comment 19 Satish Balay 2005-04-09 18:46:24 UTC
currently using the above patch from #16 with 2.6.11-1.14_FC3 from
http://people.redhat.com/davej/kernels/Fedora/FC3/SRPMS.kernel

So far my repeated suspend/resume attempts didn't triger the bug

[my previous failure was with modified 2.6.11-1.8_FC3 kernel]

Comment 20 Dave Jones 2005-07-15 17:53:27 UTC
An update has been released for Fedora Core 3 (kernel-2.6.12-1.1372_FC3) which
may contain a fix for your problem.   Please update to this new kernel, and
report whether or not it fixes your problem.

If you have updated to Fedora Core 4 since this bug was opened, and the problem
still occurs with the latest updates for that release, please change the version
field of this bug to 'fc4'.

Thank you.

Comment 21 Satish Balay 2005-07-15 18:05:55 UTC
I've been using the patch from #16 with fedora kernels [all the way to
2.6.11-1.35_FC3] - without a crash since my last report.

Looks like this patch is in 2.6.12 [hence in 2.6.12-1.1371_FC3/1372] so I'll
venture to say that it will work. 

Currently using 1371 - will report if the problem strikes again.

Comment 22 Dave Jones 2005-07-15 18:15:48 UTC
ok, reopen if it reoccurs.

thanks for testing.