19 Jul 2012 00:22
[libusb] #142: Spurious short packet errors received because SHORT_NOT_OK flag is always turned on.
libusb Trac <trac <at> libusb.org>
2012-07-18 22:22:42 GMT
2012-07-18 22:22:42 GMT
#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)
RSS Feed