This patch makes the abort_cmd function synchronous. This allows the
caller to immediately send a new command after abort_cmd() returns.
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
struct port100_cmd *cmd;
bool cmd_cancel;
+ struct completion cmd_cancel_done;
};
struct port100_cmd {
mutex_lock(&dev->out_urb_lock);
+ init_completion(&dev->cmd_cancel_done);
+
usb_kill_urb(dev->out_urb);
dev->out_urb->transfer_buffer = ack_frame;
mutex_unlock(&dev->out_urb_lock);
+ if (!rc)
+ wait_for_completion(&dev->cmd_cancel_done);
+
return rc;
}
{
struct port100 *dev = urb->context;
- dev->cmd_cancel = false;
+ if (dev->cmd_cancel) {
+ dev->cmd_cancel = false;
+ complete(&dev->cmd_cancel_done);
+ }
switch (urb->status) {
case 0: