Commit 687ca639 authored by Kirill Kapranov's avatar Kirill Kapranov Committed by Greg Kroah-Hartman

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: default avatarKirill Kapranov <kirill.kirillovich.kapranov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 092bd5c2
...@@ -132,6 +132,8 @@ static void adu_abort_transfers(struct adu_device *dev) ...@@ -132,6 +132,8 @@ static void adu_abort_transfers(struct adu_device *dev)
spin_lock_irqsave(&dev->buflock, flags); spin_lock_irqsave(&dev->buflock, flags);
if (!dev->out_urb_finished) { if (!dev->out_urb_finished) {
spin_unlock_irqrestore(&dev->buflock, flags); 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); usb_kill_urb(dev->interrupt_out_urb);
} else } else
spin_unlock_irqrestore(&dev->buflock, flags); spin_unlock_irqrestore(&dev->buflock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment