usb: wusbcore: serialize access to the HWA data out endpoint
authorThomas Pugliese <thomas.pugliese@gmail.com>
Mon, 7 Oct 2013 15:53:57 +0000 (10:53 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 Oct 2013 12:19:21 +0000 (05:19 -0700)
commit679ee475a1c19243c8f50a5a76f6b7519b24c1a3
treea1cee61ed77804e87b138621bc77f90cc24db11c
parent8114fabc94cc94e4eb50050a99f7ee5573fa37d9
usb: wusbcore: serialize access to the HWA data out endpoint

This patch serializes access to the HWA data transfer out (DTO)
endpoint.  This prevents a situation where two transfer requests being
sent concurrently to separate downstream endpoints could interleave
their transfer request and transfer data packets causing data
corruption.  The transfer processing code will now attempt to acquire
the DTO resource before sending a transfer to the HWA.  If it cannot
acquire the resource, the RPIPE that the transfer is assigned to will
be placed on a waiting list.  When the DTO resource is released, the
actor releasing the resource will serivce the RPIPEs that are waiting.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/wusbcore/wa-hc.h
drivers/usb/wusbcore/wa-rpipe.c
drivers/usb/wusbcore/wa-xfer.c