Commit 7436f412 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: usb_wwan: fix discarded writes on resume errors

There's no reason not to try sending off any further delayed write urbs,
should one urb-submission fail.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fb7ad4f9
...@@ -621,28 +621,33 @@ EXPORT_SYMBOL(usb_wwan_suspend); ...@@ -621,28 +621,33 @@ EXPORT_SYMBOL(usb_wwan_suspend);
static int play_delayed(struct usb_serial_port *port) static int play_delayed(struct usb_serial_port *port)
{ {
struct usb_serial *serial = port->serial;
struct usb_wwan_intf_private *data; struct usb_wwan_intf_private *data;
struct usb_wwan_port_private *portdata; struct usb_wwan_port_private *portdata;
struct urb *urb; struct urb *urb;
int err = 0; int err_count = 0;
int err;
portdata = usb_get_serial_port_data(port); portdata = usb_get_serial_port_data(port);
data = port->serial->private; data = port->serial->private;
while ((urb = usb_get_from_anchor(&portdata->delayed))) { while ((urb = usb_get_from_anchor(&portdata->delayed))) {
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (!err) { if (err) {
data->in_flight++; dev_err(&port->dev,
} else { "%s: submit write urb failed: %d\n",
/* we have to throw away the rest */ __func__, err);
do { err_count++;
unbusy_queued_urb(urb, portdata); unbusy_queued_urb(urb, portdata);
usb_autopm_put_interface_no_suspend(port->serial->interface); usb_autopm_put_interface_async(serial->interface);
} while ((urb = usb_get_from_anchor(&portdata->delayed))); continue;
break;
} }
data->in_flight++;
} }
return err; if (err_count)
return -EIO;
return 0;
} }
int usb_wwan_resume(struct usb_serial *serial) int usb_wwan_resume(struct usb_serial *serial)
......
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