summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/adutux.c
diff options
context:
space:
mode:
authorKirill Kapranov <kirill.kirillovich.kapranov@gmail.com>2018-02-17 22:01:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-09 18:37:10 +0100
commit687ca6395f10ac8a54fd5285dda91ed9efac9e23 (patch)
treeb134186b4cf748278c1d21a11c6e7255ccc63c54 /drivers/usb/misc/adutux.c
parentuwb: Re-use DEFINE_SHOW_ATTRIBUTE() macro (diff)
downloadlinux-687ca6395f10ac8a54fd5285dda91ed9efac9e23.tar.xz
linux-687ca6395f10ac8a54fd5285dda91ed9efac9e23.zip
USB: adutux: Add waiting in transfer abortion
Add waiting for an URB transmit finish that let the last URB to be sent (to be not discarded) during 'release' procedure. W/o this waiting,the last frame will be nearly always lost. A test case: an attempt of sending a single frame: echo -en "\001mk255" >/dev/adutux0 Signed-off-by: Kirill Kapranov <kirill.kirillovich.kapranov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/adutux.c')
-rw-r--r--drivers/usb/misc/adutux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c
index f7a2fe42396f..b3160afe0458 100644
--- a/drivers/usb/misc/adutux.c
+++ b/drivers/usb/misc/adutux.c
@@ -132,6 +132,8 @@ static void adu_abort_transfers(struct adu_device *dev)
spin_lock_irqsave(&dev->buflock, flags);
if (!dev->out_urb_finished) {
spin_unlock_irqrestore(&dev->buflock, flags);
+ wait_event_timeout(dev->write_wait, dev->out_urb_finished,
+ COMMAND_TIMEOUT);
usb_kill_urb(dev->interrupt_out_urb);
} else
spin_unlock_irqrestore(&dev->buflock, flags);