diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-07-19 22:08:31 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-07-20 11:24:24 +0200 |
commit | 01a7c984e86fd45b760bb0da8b635059dff602e1 (patch) | |
tree | 5dfcbaf8c403825ff04c84be01def864a3e29813 /drivers/hid/hid-gyration.c | |
parent | HID: usbhid: fix use-after-free bug (diff) | |
download | linux-01a7c984e86fd45b760bb0da8b635059dff602e1.tar.xz linux-01a7c984e86fd45b760bb0da8b635059dff602e1.zip |
HID: usbhid: fix autosuspend calls
This patch (as1593) fixes some logic errors in the usbhid driver
relating to runtime PM. The driver does not balance its calls to
usb_autopm_get_interface_async() and usb_autopm_put_interface_async().
For example, when the control queue is restarted the driver does a
_get. But the resume won't happen immediately, so the driver leaves
the queue stopped. When the resume does occur, the queue is restarted
and a second _get occurs, with no balancing _put.
The patch fixes the problem by rearranging the logic for restarting
the queues. All the _get/_put calls and bitflag settings in
__usbhid_submit_report() are moved into the queue-restart routines. A
balancing _put call is added for the case where the queue is still
suspended. A call to irq_out_pump_restart(), which doesn't take all
the right actions for restarting the irq-OUT queue, is replaced by a
call to usbhid_restart_out_queue(), which does. Similarly for
ctrl_pump_restart().
Finally, new code is added to prevent an autosuspend from happening
every time an URB is cancelled, and the comments explaining what
happens when an URB needs to be cancelled are expanded and clarified.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-gyration.c')
0 files changed, 0 insertions, 0 deletions