]> git.baikalelectronics.ru Git - kernel.git/commit
HID: magicmouse: fix race between input_register() and probe()
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Tue, 2 Apr 2013 09:11:52 +0000 (11:11 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 4 Apr 2013 07:49:56 +0000 (09:49 +0200)
commit7247f70f0987baea7a8d1d369c59dc79c4913540
treee0afda3a56352eec1afed013171e0a4d55ca9399
parent3974bf111c26c9e95a1155e1a47c096313da3523
HID: magicmouse: fix race between input_register() and probe()

Since kernel 3.7, it appears that the input registration occured before
the end of magicmouse_setup_input(). This is shown by receiving a lot of
"EV_SYN SYN_REPORT 1" instead of normal "EV_SYN SYN_REPORT 0".
This value means that the output buffer is full, and the user space
is loosing events.

Using .input_configured guarantees that the race is not occuring, and that
the call of "input_set_events_per_packet(input, 60)" is taken into account
by input_register().

Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=908604

Cc: stable@vger.kernel.org
Reported-and-Tested-By: Clarke Wixon <cwixon@usa.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-magicmouse.c