Input: xpad - correctly handle concurrent LED and FF requests
authorPavel Rojtberg <rojtberg@gmail.com>
Wed, 9 Dec 2015 19:57:01 +0000 (11:57 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Dec 2018 08:48:01 +0000 (09:48 +0100)
commitc190dccbbafebd54afce680c9d1b4b1874ac4617
treef22d5c4f7055e5eeba681edf5735007d0937d44d
parent7a0a65d1576e022b9959ffd25ed8c1f7bd2ccee0
Input: xpad - correctly handle concurrent LED and FF requests

[ Upstream commit 7fc595f4c02636eadaeeecfe7bbc45b57c173004 ]

Track the status of the irq_out URB to prevent submission iof new requests
while current one is active. Failure to do so results in the "URB submitted
while active" warning/stack trace.

Store pending brightness and FF effect in the driver structure and replace
it with the latest requests until the device is ready to process next
request. Alternate serving LED vs FF requests to make sure one does not
starve another. See [1] for discussion. Inspired by patch of Sarah Bessmer
[2].

[1]: http://www.spinics.net/lists/linux-input/msg40708.html
[2]: http://www.spinics.net/lists/linux-input/msg31450.html

Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/joystick/xpad.c