Message ID | 20200513213646.21649-1-b-liu@ti.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 986c1748c84d7727defeaeca74a73b37f7d5cce1 |
Headers | show |
Series | usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback | expand |
On Wed, May 13, 2020 at 04:36:46PM -0500, Bin Liu wrote: > 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") > > Cc: stable@vger.kernel.org > Signed-off-by: Bin Liu <b-liu@ti.com> > --- > drivers/usb/serial/usb_wwan.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c > index 13be21aad2f4..4b9845807bee 100644 > --- a/drivers/usb/serial/usb_wwan.c > +++ b/drivers/usb/serial/usb_wwan.c > @@ -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
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 13be21aad2f4..4b9845807bee 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -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,
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") Cc: stable@vger.kernel.org Signed-off-by: Bin Liu <b-liu@ti.com> --- drivers/usb/serial/usb_wwan.c | 4 ++++ 1 file changed, 4 insertions(+)