All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback
@ 2020-05-13 21:36 Bin Liu
  2020-05-19  7:49 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Liu @ 2020-05-13 21:36 UTC (permalink / raw)
  To: linux-usb; +Cc: 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")

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,
-- 
2.17.1


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

* Re: [PATCH] usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback
  2020-05-13 21:36 [PATCH] usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback Bin Liu
@ 2020-05-19  7:49 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2020-05-19  7:49 UTC (permalink / raw)
  To: Bin Liu; +Cc: linux-usb

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

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

end of thread, other threads:[~2020-05-19  7:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-13 21:36 [PATCH] usb: usb_wwan: do not resubmit rx urb on fatal errors in rx callback Bin Liu
2020-05-19  7:49 ` Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.