Linux-USB Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org
	public-inbox-index linux-usb

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git