From: Greg KH on
2.6.32-stable review patch. If anyone has any objections, please let me know.

From: Henrique de Moraes Holschuh <hmh(a)>

commit 7f0cf712a74fcc3ad21f0bde95bd32c2f2cc3888 upstream.

Thadeu Lima de Souza Cascardo reports this:

Brightness notification does not work until the user writes to
hotkey_mask attribute. That's because the polling thread will only run
if hotkey_user_mask is set and someone is reading the input device or
if hotkey_driver_mask is set. In this second case, this condition is
not tested after the mask is changed, because the brightness and
volume drivers are started after the hotkey drivers.

Fix tpacpi_hotkey_driver_mask_set() to call hotkey_poll_setup(), so
that the poller kthread will be started when needed.

Reported-by: Thadeu Lima de Souza Cascardo <cascardo(a)>
Tested-by: Thadeu Lima de Souza Cascardo <cascardo(a)>
Signed-off-by: Henrique de Moraes Holschuh <hmh(a)>
Cc: Andrew Morton <akpm(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

drivers/platform/x86/thinkpad_acpi.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2073,6 +2073,7 @@ static struct attribute_set *hotkey_dev_

static void tpacpi_driver_event(const unsigned int hkey_event);
static void hotkey_driver_event(const unsigned int scancode);
+static void hotkey_poll_setup(const bool may_warn);

/* HKEY.MHKG() return bits */
#define TP_HOTKEY_TABLET_MASK (1 << 3)
@@ -2254,6 +2255,8 @@ static int tpacpi_hotkey_driver_mask_set

rc = hotkey_mask_set((hotkey_acpi_mask | hotkey_driver_mask) &
+ hotkey_poll_setup(true);

return rc;
@@ -2538,7 +2541,7 @@ static void hotkey_poll_stop_sync(void)

/* call with hotkey_mutex held */
-static void hotkey_poll_setup(bool may_warn)
+static void hotkey_poll_setup(const bool may_warn)
const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;
const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
@@ -2569,7 +2572,7 @@ static void hotkey_poll_setup(bool may_w

-static void hotkey_poll_setup_safe(bool may_warn)
+static void hotkey_poll_setup_safe(const bool may_warn)
@@ -2587,7 +2590,11 @@ static void hotkey_poll_set_freq(unsigne


-static void hotkey_poll_setup_safe(bool __unused)
+static void hotkey_poll_setup(const bool __unused)
+static void hotkey_poll_setup_safe(const bool __unused)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at