aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-03-12 14:09:39 -0400
committerGreg Kroah-Hartman <greg@kroah.com>2014-03-12 15:44:49 -0400
commitfc11efe2800f2f9ba2ccb268321642b7e9f73a65 (patch)
tree9637222cfe2a617baaf7e64956c3374e2c192b9c /drivers/usb/serial
parent5083fd7bdfe6760577235a724cf6dccae13652c2 (diff)
USB: serial: continue to read on errors
Make sure to try to resubmit the read urb on errors. Currently a recoverable error would lead to reduced throughput as only one urb will be used until the port is closed and reopened (or resumed or unthrottled). Also upgrade error messages from debug to error log level. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/generic.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index b63ce023f96f..d7f39ea7d6ac 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -359,16 +359,29 @@ void usb_serial_generic_read_bulk_callback(struct urb *urb)
359 359
360 dev_dbg(&port->dev, "%s - urb %d, len %d\n", __func__, i, 360 dev_dbg(&port->dev, "%s - urb %d, len %d\n", __func__, i,
361 urb->actual_length); 361 urb->actual_length);
362 362 switch (urb->status) {
363 if (urb->status) { 363 case 0:
364 dev_dbg(&port->dev, "%s - non-zero urb status: %d\n", 364 break;
365 __func__, urb->status); 365 case -ENOENT:
366 case -ECONNRESET:
367 case -ESHUTDOWN:
368 dev_dbg(&port->dev, "%s - urb stopped: %d\n",
369 __func__, urb->status);
370 return;
371 case -EPIPE:
372 dev_err(&port->dev, "%s - urb stopped: %d\n",
373 __func__, urb->status);
366 return; 374 return;
375 default:
376 dev_err(&port->dev, "%s - nonzero urb status: %d\n",
377 __func__, urb->status);
378 goto resubmit;
367 } 379 }
368 380
369 usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data); 381 usb_serial_debug_data(&port->dev, __func__, urb->actual_length, data);
370 port->serial->type->process_read_urb(urb); 382 port->serial->type->process_read_urb(urb);
371 383
384resubmit:
372 /* Throttle the device if requested by tty */ 385 /* Throttle the device if requested by tty */
373 spin_lock_irqsave(&port->lock, flags); 386 spin_lock_irqsave(&port->lock, flags);
374 port->throttled = port->throttle_req; 387 port->throttled = port->throttle_req;