Skip to contentSkip to conversation

usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback

PATCH In review Bin Liu 2 participants 2 messages May 13, 2020 – May 19, 2020

Subsystems (2)
lore
Share & tools
lore

Bin Liu

author
#0 lore raw

PATCH 1/1 usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback

usb_wwan_indat_callback() shouldn't resubmit rx urb if the previous urb status is a fatal error. Or the usb controller would keep processing the new urbs then run into interrupt storm, and has no chance to recover.

Fixes 6c1ee66a0b2b ("USB-Serial: Fix error handling of usb_wwan")
---
 drivers/usb/serial/usb_wwan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/serial/usb_wwan.c +4 -0
index 13be21aad2f4..4b9845807bee 100644
@@ -270,6 +270,10 @@ static void usb_wwan_indat_callback(struct urb *urb)
 	if (status) {
 		dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
 			__func__, status, endpoint);
+
+		/* don't resubmit on fatal errors */
+		if (status == -ESHUTDOWN || status == -ENOENT)
+			return;
 	} else {
 		if (urb->actual_length) {
 			tty_insert_flip_string(&port->port, data,
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 17 lines · Bin Liu

usb_wwan_indat_callback() shouldn't resubmit rx urb if the previous urb status is a fatal error. Or the usb controller would keep processing the new urbs then run into interrupt storm, and has no chance to recover.

Fixes 6c1ee66a0b2b ("USB-Serial: Fix error handling of usb_wwan")
---
 drivers/usb/serial/usb_wwan.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/serial/usb_wwan.c +0 -0
index 13be21aad2f4..4b9845807bee 100644

drivers/usb/serial/usb_wwan.c static void usb_wwan_indat_callback(struct urb *urb) · line 279

Quoted 10 lines
drivers/usb/serial/usb_wwan.c +4 -0
@@ -270,6 +270,10 @@ static void usb_wwan_indat_callback(struct urb *urb)
 	if (status) {
 		dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
 			__func__, status, endpoint);
+
+		/* don't resubmit on fatal errors */
+		if (status == -ESHUTDOWN || status == -ENOENT)
+			return;
 	} else {
 		if (urb->actual_length) {
 			tty_insert_flip_string(&port->port, data,

Now applied, thanks.

Johan