public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] USB-Serial: Fix error handling of usb_wwan
@ 2013-08-12 17:11 Matt Burtch
  2013-08-12 17:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Burtch @ 2013-08-12 17:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Johan Hovold, Jiri Slaby, linux-usb,
	linux-kernel; +Cc: matt

This fixes an issue where the bulk-in urb used for incoming data transfer
is not resubmitted if the packet recieved contains an error status.  This
results in the driver locking until the port is closed and re-opened.

Tested on a custom board with a Cinterion GSM module.

Signed-off-by: Matt Burtch <matt@grid-net.com>
---
 drivers/usb/serial/usb_wwan.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c
index 8257d30..9eefc33 100644
--- a/drivers/usb/serial/usb_wwan.c
+++ b/drivers/usb/serial/usb_wwan.c
@@ -291,18 +291,18 @@ static void usb_wwan_indat_callback(struct urb *urb)
 			tty_flip_buffer_push(&port->port);
 		} else
 			dev_dbg(dev, "%s: empty read urb received\n", __func__);
-
-		/* Resubmit urb so we continue receiving */
-		err = usb_submit_urb(urb, GFP_ATOMIC);
-		if (err) {
-			if (err != -EPERM) {
-				dev_err(dev, "%s: resubmit read urb failed. (%d)\n", __func__, err);
-				/* busy also in error unless we are killed */
-				usb_mark_last_busy(port->serial->dev);
-			}
-		} else {
+	}
+	/* Resubmit urb so we continue receiving */
+	err = usb_submit_urb(urb, GFP_ATOMIC);
+	if (err) {
+		if (err != -EPERM) {
+			dev_err(dev, "%s: resubmit read urb failed. (%d)\n",
+				__func__, err);
+			/* busy also in error unless we are killed */
 			usb_mark_last_busy(port->serial->dev);
 		}
+	} else {
+		usb_mark_last_busy(port->serial->dev);
 	}
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] USB-Serial: Fix error handling of usb_wwan
  2013-08-12 17:11 [PATCH 1/1] USB-Serial: Fix error handling of usb_wwan Matt Burtch
@ 2013-08-12 17:32 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2013-08-12 17:32 UTC (permalink / raw)
  To: Matt Burtch; +Cc: Johan Hovold, Jiri Slaby, linux-usb, linux-kernel

On Mon, Aug 12, 2013 at 10:11:39AM -0700, Matt Burtch wrote:
> This fixes an issue where the bulk-in urb used for incoming data transfer
> is not resubmitted if the packet recieved contains an error status.  This
> results in the driver locking until the port is closed and re-opened.
> 
> Tested on a custom board with a Cinterion GSM module.
> 
> Signed-off-by: Matt Burtch <matt@grid-net.com>

Ah, nice catch, thanks for this, I'll also mark it for the stable tree
as it's something that those kernels would want to pick up.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-12 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 17:11 [PATCH 1/1] USB-Serial: Fix error handling of usb_wwan Matt Burtch
2013-08-12 17:32 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox