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

From: Dmitry Torokhov
Date: Thu Feb 10 2011 - 20:22:15 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/