Bug 19822 - Releasing EVIOCGRAB causes rfkill state to change
Summary: Releasing EVIOCGRAB causes rfkill state to change
Status: RESOLVED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: acpi_platform-drivers@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 00:13 UTC by Brad Jorsch
Modified: 2012-04-12 18:21 UTC (History)
1 user (show)

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


Attachments
Small program to trigger the bug (517 bytes, text/x-csrc)
2010-10-07 00:13 UTC, Brad Jorsch
Details

Description Brad Jorsch 2010-10-07 00:13:41 UTC
Created attachment 32632 [details]
Small program to trigger the bug

Hardware: Thinkpad T500

When an EVIOCGRAB is released on thinkpad_acpi's /dev/input/eventX device ("ThinkPad Extra Buttons", "thinkpad_acpi/input0"), it re-enables both the bluetooth and wireless radios if they had previously been turned off in software.

I can reproduce this at will using the following method:
1. Disable either or both of the radios by writing 0 to /sys/class/rfkill/*/state.
2. Run the attached program with the appropriate device as the argument.

This also seems to be present in 2.6.34 and 2.6.32.
Comment 1 Dmitry Torokhov 2012-04-12 18:21:05 UTC
This works as expected, "ungrab" returns control over input device to rfkill-input handler which synchronizes state of rfkill switches with state of input switches/keys.

Using /sys/class/rfkill/*/state simultaneously with rfkill input handler is not supported. If you want to control state of rfkill switch manually, you need to "claim" it via /sys/class/rfkill/rfkillX/claim attribute, or disable input handler using IOCTL on /dev/rfkill.

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