libusb Trac | 19 Jul 2012 00:22
Favicon

[libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.

#142: Spurious short packet errors received because SHORT_NOT_OK flag is always
turned on.
--------------------+---------------------------------------
 Reporter:  cwn     |       Owner:
     Type:  defect  |      Status:  new
Milestone:          |   Component:  libusb-1.0 Linux backend
 Keywords:          |  Blocked By:
   Blocks:          |
--------------------+---------------------------------------
 This bug was seen in libusb 1.0.9 running on Linux kernel 3.2.0. If the
 async bulk transfer is broken up into multiple URBs, then all but the last
 URB should have the SHORT_NO_OK flag turned on so that short USB packets
 in the middle of the transfer will be reported as an error. The bug is
 that the SHORT_NOT_OK flag is always turned on even if there is only one
 URBs in the transfer. This causes any URBs that ends in a short packet to
 return any -EREMOTEIO error. The result is that when a large number of
 9206 byte async bulk transfers are queued a 300 to 400 microsecond delay
 can be seen on a USB protocol analyser between transfers.

 Changing the if statement in libusb-1.0.9/libusb/os/linux_usbfs.c on line
 1629 to check if the URB is the last URB in the transfer before turning on
 the SHORT_NOT_OK flag seems to have fixed the problem for me.

 Original Code:
                 if (supports_flag_bulk_continuation && !is_out)
                         urb->flags = USBFS_URB_SHORT_NOT_OK;

 Modified Code:
                 if (supports_flag_bulk_continuation && !is_out && i+1 !=
 num_urbs)
(Continue reading)

libusb Trac | 19 Jul 2012 00:33
Favicon

Re: [libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.

#142: Spurious short packet errors received because SHORT_NOT_OK flag is always
turned on.
---------------------+--------------------------------------
  Reporter:  cwn     |      Owner:
      Type:  defect  |     Status:  new
 Milestone:          |  Component:  libusb-1.0 Linux backend
Resolution:          |   Keywords:
Blocked By:          |     Blocks:
---------------------+--------------------------------------

Comment (by stuge):

 I think that this change makes sense. Could you create a commit against
 libusb.git and attach a patch to the ticket, or push it somewhere? A small
 style remark is that I think i < num_urbs-1 might be slightly more
 obvious.

--

-- 
Ticket URL: <https://libusb.org/ticket/142#comment:1>
libusb <https://libusb.org/>
C library for writing portable USB drivers in userspace
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
libusb Trac | 8 Feb 2013 07:33
Favicon

Re: [libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.

#142: Spurious short packet errors received because SHORT_NOT_OK flag is always
turned on.
---------------------+--------------------------------------
  Reporter:  cwn     |      Owner:
      Type:  defect  |     Status:  new
 Milestone:          |  Component:  libusb-1.0 Linux backend
Resolution:          |   Keywords:
Blocked By:          |     Blocks:
---------------------+--------------------------------------

Comment (by hjelmn):

 If this change makes sense I am going to push for it to be included in
 1.0.16. Any objections?

--

-- 
Ticket URL: <https://libusb.org/ticket/142#comment:2>
libusb <https://libusb.org/>
C library for writing portable USB drivers in userspace
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
libusb Trac | 8 Feb 2013 16:23
Favicon

Re: [libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.

#142: Spurious short packet errors received because SHORT_NOT_OK flag is always
turned on.
---------------------+--------------------------------------
  Reporter:  cwn     |      Owner:
      Type:  defect  |     Status:  new
 Milestone:  1.0.16  |  Component:  libusb-1.0 Linux backend
Resolution:          |   Keywords:
Blocked By:          |     Blocks:
---------------------+--------------------------------------
Changes (by hjelmn):

 * milestone:   => 1.0.16

--

-- 
Ticket URL: <https://libusb.org/ticket/142#comment:3>
libusb <https://libusb.org/>
C library for writing portable USB drivers in userspace
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
libusb Trac | 11 Apr 2013 23:48
Favicon

Re: [libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.

#142: Spurious short packet errors received because SHORT_NOT_OK flag is always
turned on.
---------------------+--------------------------------------
  Reporter:  cwn     |      Owner:
      Type:  defect  |     Status:  closed
 Milestone:  1.0.16  |  Component:  libusb-1.0 Linux backend
Resolution:  fixed   |   Keywords:
Blocked By:          |     Blocks:
---------------------+--------------------------------------
Changes (by hjelmn):

 * status:  new => closed
 * resolution:   => fixed

--

-- 
Ticket URL: <https://libusb.org/ticket/142#comment:4>
libusb <https://libusb.org/>
C library for writing portable USB drivers in userspace
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter

Gmane