Bug 84941 - Accelerometer sends messages as scancodes through the keyboard serial bus
Summary: Accelerometer sends messages as scancodes through the keyboard serial bus
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Serial (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Russell King
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-21 16:52 UTC by Giedrius Statkevičius
Modified: 2014-11-18 15:46 UTC (History)
0 users

See Also:
Kernel Version: 3.16.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Giedrius Statkevičius 2014-09-21 16:52:19 UTC
My laptop is HP ProBook 4540s. Basically, when normally running the kernel if you check `dmesg` you will notice that the journal is spammed with messages like this:

[169347.147304] atkbd serio0: Unknown key pressed (translated set 2, code 0xa8 on isa0060/serio0).
[169347.147313] atkbd serio0: Use 'setkeycodes e028 <keycode>' to make it known.

Or:

[168184.805491] atkbd serio0: Unknown key pressed (translated set 2, code 0xa7 on isa0060/serio0).
[168184.805494] atkbd serio0: Use 'setkeycodes e027 <keycode>' to make it known.

The range of the codes is from 0xa5 to 0xa8. This has to do something with the "hp 3d driveguard" technology inside the laptop. It's basically a gyroscope that sends messages to the kernel when the laptop is in a free fall and user space programs can react to this by usually parking the hdd head(s). I know about the hp_accel driver and the hpfall program to monitor the changes. But, it seems that atkbd also gets messages about these changes and spams the journal because it doesn't know how to handle these codes.

I checked that this _really_ has something to do with the "hp 3d driveguard" by running two different terminals with these commands:

1st one:
cd /sys/devices/pci0000:00/0000:00:1f.2/ata1/host0/target0:0:0/0:0:0:0
watch --difference=permanent cat unload_heads

2nd one:
watch --different=permanent "dmesg | tail"

Now, when carefully putting the laptop in a freefall you can see the value of unload_heads change, the hdd led on the laptop turns red and a message appears in dmesg:

[170301.807563] atkbd serio0: Unknown key pressed (translated set 2, code 0xa8 on isa0060/serio
0).
[170301.807571] atkbd serio0: Use 'setkeycodes e028 <keycode>' to make it known.


Seems like 0xa8 happens when the heads get parked and 0xa7 when the hdd spins up again.

So, after looking in the atkbd code it seems that there is a mechanism that handles various weird codes like this. A patch that fixes this should probably just make atkbd ignore the 0xa5-0xa8 codes.
Comment 1 Giedrius Statkevičius 2014-09-21 16:56:13 UTC
A link to a archlinux forums thread where someone complains about having the same problem: https://bbs.archlinux.org/viewtopic.php?pid=1231955
Comment 2 Giedrius Statkevičius 2014-09-23 18:40:23 UTC
Sorry, it's a accelerometer, not a gyroscope. Can't edit the original message.
More links about the same problem on older versions of the kernel:
http://h30434.www3.hp.com/t5/Notebook-Hardware/Shock-sensor-on-ProBook-4340s/td-p/2329335
http://askubuntu.com/questions/241999/tilt-of-laptop-causing-unknown-key-pressed-syslog-entries
Comment 3 Giedrius Statkevičius 2014-11-18 15:46:22 UTC
Fixed in 3.18-rc5.

Note You need to log in before you can comment on or make changes to this bug.