1. 28 5月, 2014 16 次提交
  2. 17 4月, 2014 2 次提交
  3. 13 1月, 2014 1 次提交
    • B
      usb: cdc-wdm: resp_count can be 0 even if WDM_READ is set · f563926f
      Bjørn Mork 提交于
      Do not decrement resp_count if it's already 0.
      
      We set resp_count to 0 when the device is closed.  The next open and
      read will try to clear the WDM_READ flag if there was leftover data
      in the read buffer. This fix is necessary to prevent resubmitting
      the read URB in a tight loop because resp_count becomes negative.
      
      The bug can easily be triggered from userspace by not reading all
      data in the read buffer, and then closing and reopening the chardev.
      
      Fixes: 8dd5cd53 ("usb: cdc-wdm: avoid hanging on zero length reads")
      Cc: <stable@vger.kernel.org> # 3.13
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f563926f
  4. 09 1月, 2014 1 次提交
  5. 21 12月, 2013 1 次提交
    • B
      usb: cdc-wdm: avoid hanging on zero length reads · 8dd5cd53
      Bjørn Mork 提交于
      commit 73e06865 ("USB: cdc-wdm: support back-to-back
      USB_CDC_NOTIFY_RESPONSE_AVAILABLE notifications") implemented
      queued response handling. This added a new requirement: The read
      urb must be resubmitted every time we clear the WDM_READ flag if
      the response counter indicates that the device is waiting for a
      read.
      
      Fix by factoring out the code handling the WMD_READ clearing and
      possible urb submission, calling it everywhere we clear the flag.
      
      Without this fix, the driver ends up in a state where the read urb
      is inactive, but the response counter is positive after a zero
      length read.  This prevents the read urb from ever being submitted
      again and the driver appears to be hanging.
      
      Fixes: 73e06865 ("USB: cdc-wdm: support back-to-back USB_CDC_NOTIFY_RESPONSE_AVAILABLE notifications")
      Cc: Greg Suarez <gsuarez@smithmicro.com>
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Cc: stable <stable@vger.kernel.org> # 3.13
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8dd5cd53
  6. 10 12月, 2013 1 次提交
  7. 05 12月, 2013 1 次提交
  8. 04 12月, 2013 3 次提交
  9. 30 10月, 2013 2 次提交
  10. 26 8月, 2013 1 次提交
  11. 13 8月, 2013 2 次提交
  12. 26 7月, 2013 5 次提交
  13. 18 6月, 2013 1 次提交
    • G
      USB: cdc-acm: remove unneeded spin_lock_irqsave/restore on write path · 71c2fb03
      Greg Kroah-Hartman 提交于
      When writing data we were:
      	lock
      	do some work
      	unlock
      	call function
      		lock
      		do some work
      		unlock
      		return
      	return
      
      It turns out, that "function" was only ever called in the one place, so
      instead of locking/unlocking for no good reason, just inline the
      function and only grab the lock once.
      
      This has sped up the pathological case of sending 1 byte packets to a
      loop-back cdc-acm device from 49600 bytes per second to 50100 bytes a
      second on my workstation.  A tiny increase yes, but noticable, and now
      the spinlock isn't the hottest thing on the perf graph anymore.  Yes, we
      are still waiting for the hardware for the most part, but getting rid of
      a spinlock_irq_save() call for every packet is still a good thing.
      
      And we end up deleting lines of code, always a win overall.
      
      This was found by using a Teensy 3.0 device and the test program and
      firmware located at:
      	http://www.pjrc.com/teensy/benchmark_usb_serial_receive.htmlReported-by: NPaul Stoffregen <paul@pjrc.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      71c2fb03
  14. 17 5月, 2013 3 次提交