1. 20 Jul, 2012 5 commits
    • Alan Stern's avatar
      HID: usbhid: check for suspend or reset before restarting · d4150c8f
      Alan Stern authored
      This patch (as1596) improves the queue-restart logic in usbhid by
      checking to see if the device is suspended or a reset is about to
      occur.  There's no point submitting an URB if either of those is
      true.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      d4150c8f
    • Alan Stern's avatar
      HID: usbhid: replace HID_REPORTED_IDLE with HID_SUSPENDED · f2b5264d
      Alan Stern authored
      This patch (as1595) improves the usbhid driver by using the
      HID_SUSPENDED bitflag to indicate that the device is suspended rather
      than using HID_REPORTED_IDLE, which the patch removes.
      
      Since HID_SUSPENDED was not being used for anything, and since the
      name "HID_REPORTED_IDLE" doesn't convey much meaning, the end result
      is easier to read and understand.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      f2b5264d
    • Alan Stern's avatar
      HID: usbhid: inline some simple routines · 93101af3
      Alan Stern authored
      This patch (as1594) simplifies the usbhid driver by inlining a couple
      of routines.  As a result of an earlier patch, irq_out_pump_restart()
      and ctrl_pump_restart() are each used in only one place.  Since they
      don't really do what their names say, and since they each involve only
      about two lines of actual code, there's no reason to keep them as
      separate functions.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      93101af3
    • Alan Stern's avatar
      HID: usbhid: fix autosuspend calls · 01a7c984
      Alan Stern authored
      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: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      01a7c984
    • Alan Stern's avatar
      HID: usbhid: fix use-after-free bug · 668160e5
      Alan Stern authored
      This patch (as1592) fixes an obscure problem in the usbhid driver.
      Under some circumstances, a control or interrupt-OUT URB can be
      submitted twice.  This will happen if the first submission fails; the
      queue pointers aren't updated, so the next time the queue is restarted
      the same URB will be submitted again.
      
      The problem is that raw_report gets deallocated during the first
      submission.  The second submission will then dereference and try to
      free an already-freed region of memory.  The patch fixes the problem
      by setting raw_report to NULL when it is deallocated and checking for
      NULL before dereferencing it.
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      CC: Oliver Neukum <oliver@neukum.org>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      668160e5
  2. 19 Jul, 2012 7 commits
  3. 18 Jul, 2012 17 commits
  4. 17 Jul, 2012 11 commits