Subject: [PATCH 002/002] USB: serial: sierra driver read path bug fix From: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx> The following is summary of changes we have made to sierra.c driver in [PATCH 002/002] dealing with read path bug fix: - Fixed a problem in function sierra_indat_callback() which would stop receiving traffic from a modem if a number of URB failures occur. Failed URBs are not resubmitted for the next read and there is only a limited number of URBs allocated for the IN path. After this number of failures, the receive path stops working on a particular interface. Signed-off-by: Elina Pasheva <epasheva@xxxxxxxxxxxxxxxxxx> --- drivers/usb/serial/sierra.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) --- a/drivers/usb/serial/sierra.c 2009-04-28 18:27:53.000000000 -0700 +++ b/drivers/usb/serial/sierra.c 2009-04-28 19:05:59.000000000 -0700 @@ -460,33 +460,39 @@ static void sierra_indat_callback(struct unsigned char *data = urb->transfer_buffer; int status = urb->status; - dbg("%s: %p", __func__, urb); - endpoint = usb_pipeendpoint(urb->pipe); port = urb->context; + dev_dbg(&port->dev, "%s: %p\n", __func__, urb); + if (status) { dev_dbg(&port->dev, "%s: nonzero status: %d on" " endpoint %02x\n", __func__, status, endpoint); } else { if (urb->actual_length) { tty = tty_port_tty_get(&port->port); + tty_buffer_request_room(tty, urb->actual_length); tty_insert_flip_string(tty, data, urb->actual_length); tty_flip_buffer_push(tty); + tty_kref_put(tty); - } else + usb_serial_debug_data(debug, &port->dev, __func__, + urb->actual_length, data); + } else { dev_dbg(&port->dev, "%s: empty read urb" " received\n", __func__); - - /* Resubmit urb so we continue receiving */ - if (port->port.count && status != -ESHUTDOWN) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err) - dev_err(&port->dev, "resubmit read urb failed." - "(%d)\n", err); } } + + /* Resubmit urb so we continue receiving */ + if (port->port.count && status != -ESHUTDOWN && status != -ENOENT) { + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err) + dev_err(&port->dev, "resubmit read urb failed." + "(%d)\n", err); + } + return; } -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html