Re: [PATCH] Input: fixed EVIOCGRAB iterative grab/release.

From
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date
2011-02-11 01:22:11
Also in
lkml
Reply to
Terry Lambert, 2011-02-11
On Thu, Feb 10, 2011 at 04:41:52PM -0800, Terry Lambert wrote:
Sure.  First patch to linux in 16 years and all, I didn't want to be
too noisy...

Problem:

If you use EVIOCGRAB, such as when you are using a Cr-48 with the
Synaptics trackpad driver, the grab on the input device has to be
dropped before you zero out the grab on the evdev, or you can't grab
it again without rebooting.  The X Server does this; it's usually not
an issue for Chromium OS because it tends to just reboot, but everyone
else gets a locked up pointer.
Older versions of X evdev and X synaptics drivers used to grab event
device and release the grab when switching to another VT, then reqacuire
the grab when switching back to X's VT. This works (-ed?) just fine with
the current code.

Could you please explain how exactly current order of operations
prevents subsequent grabs and why changing it resolves the issue?

FWIW the current pattern is old and true "release resources in the order
opposite to which they were acquired".
This is pretty easy to reproduce with a modified evtest program that
does an EVIOCGRAB, if you don't have a Synaptics touchpad to use for
testing (but you won't get whatever you grab back unless you use the
same fd or reboot).
Could you probably share this modified version?
I have some patches to a number of bugs in the Synaptics driver, and
some additional code cleanup vs. checkpatch.pl for
drivers/input/evdev.c too, but I thought I'd start small.
Send them on, please.

Thanks.

-- 
Dmitry
Thread (7 messages) 7 messages, 3 authors, last reply 2011-02-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help