Bug 15118 - "ThinkPad" key on T20 only works after suspend cycle
Summary: "ThinkPad" key on T20 only works after suspend cycle
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Henrique de Moraes Holschuh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-24 11:14 UTC by Henrique de Moraes Holschuh
Modified: 2010-10-08 18:23 UTC (History)
2 users (show)

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


Attachments
Fix polling thread autostart (1.96 KB, patch)
2010-01-27 02:25 UTC, Henrique de Moraes Holschuh
Details | Diff

Description Henrique de Moraes Holschuh 2010-01-24 11:14:53 UTC
Reported-by: Florian Zumbiehl <florz@florz.de>

The vendor ("ThinkPad") key on a T20 with latest T22 BIOS only works after a S3 suspend/resume cycle.  Tested with direct (no userspace script) S3 sleep.

The T20 is running a patched kernel to fix the EC DoS problem.

The key is operating in NVRAM polling mode.

It breaks again when thinkpad-acpi is unloaded and then reloaded.

Driver hotkey state dump:
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_all_mask:0x0088080c
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_bios_enabled:0
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_bios_mask:0x0000080c
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_enable:1
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_mask:0x0088080c
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_poll_freq:10
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_recommended_mask:0x0088080c
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_report_mode:1
| /sys/bus/platform/devices/thinkpad_acpi/hotkey_source_mask:0x00880000
Comment 1 florz 2010-01-24 17:07:29 UTC
Suspend to disk (using tuxonice) also makes the key work, so this is not specific to S3.
Comment 2 Henrique de Moraes Holschuh 2010-01-26 02:46:58 UTC
Some bugs found.  I don't have time to fix them right now, so I will document it and fix them later (probably still this week).

1. driver only starts the kthread if the input device is in use, so anyone depending on the deprecated ACPI events over /proc will not get them.

2. driver will not start the kthread if the device open happens before lifecycle is updated, just remove the test as we enforce it by registering the input device late.

Suspend/resume fixes it because we always check if we need to start the kthread on resume.

To work around bug 2, do "echo 10 > /sys/bus/platform/devices/thinkpad_acpi/hotkey_poll_freq".
Comment 3 Henrique de Moraes Holschuh 2010-01-27 02:25:08 UTC
Created attachment 24741 [details]
Fix polling thread autostart

Please test and report if it fixes the issue.
Comment 4 florz 2010-01-27 03:38:29 UTC
Seems to work, just got this warning during compilation:

drivers/platform/x86/thinkpad_acpi.c:2237: warning: 'tpacpi_hotkey_driver_mask_set' defined but not used
Comment 5 Len Brown 2010-02-02 02:49:55 UTC
test patch is attached, so moving status to RESOLVED,
and will move to CLOSED when production patch hits upstream.
Comment 6 Len Brown 2010-09-29 02:30:37 UTC
commit b589ea4c44170d3f7a845684e2d1b3b9571663af
Author: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Date:   Thu Feb 25 21:28:58 2010 -0300

    thinkpad-acpi: fix poll thread auto-start

shipped in v2.6.33-3-gb589ea4
closed

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