Linux USB
 help / color / mirror / Atom feed
From: qianfan <qianfanguijin@163.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, Johan Hovold <johan@kernel.org>,
	Bin Liu <b-liu@ti.com>
Subject: Re: BUG: linux 5.15.0 hang on usb_wwan_indat_callback
Date: Thu, 13 Apr 2023 12:50:12 +0800	[thread overview]
Message-ID: <de92552a-3148-03c0-5b4b-94040d8d7969@163.com> (raw)
In-Reply-To: <2023041257-campfire-squeamish-75a4@gregkh>



在 2023/4/13 1:07, Greg Kroah-Hartman 写道:
> On Wed, Apr 12, 2023 at 07:54:28PM +0800, qianfan wrote:
>> Hi:
>>
>> The linux system maybe hang in usb_wwan_indat_callback when the usb modem
>> sudden disconnected. This problem has a very small probability and can not
>> make it repeat easy.
>>
>> hardware: allwinner R40 with 4 cortex-a7
>> software: linux 5.15.0
> 5.15.0 is _VERY_ old, sorry.  Please try using a modern kernel release,
> we can not do anything about old kernels like this.
>
> Does this still happen on the latest 6.2 release, or the latest 6.3-rc
> release?
Hi, thanks for yours reply.

My custom board is based on allwinner R40 and I had port some drivers to
linux 5.15.0, most of them are not merged by the mainline linux. So test
this on latest kernel is hard to do. I think I can do it at a later time
but not now.

When I enable the 'dev_dbg' and then pull usb-dp pin to GND to make the
modem can't response, I got this flood messages:

[ 1882.636790] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.641053] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.645294] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.649555] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.653811] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.658058] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.662298] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.666536] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
[ 1882.670797] option1 ttyUSB1: usb_wwan_indat_callback: nonzero status: 
-71 on endpoint 05.
...

The system is still working, and ehci_hcd interrupt was trigger more 
than 7000
times one second.

# irqtop -d 1
...
...         7340 GICv2 110 Level ehci_hcd:usb4

Although this is not the bug maker, but we need also improve it.

I had checked the lastest mainline linux driver, the 
drivers/usb/serial/usb-wwan.c
is only 4 commit ahead of linux 5.15.0:

2022-07-25    Merge tag 'usb-serial-5.20-rc1' of 
https://git.kernel.org/pub/scm/linux/kerne...
2022-07-25    USB: serial: fix tty-port initialized comments
2022-07-25    USB: serial: usb_wwan: replace DTR/RTS magic numbers with 
macros
2022-03-08    USB: serial: usb_wwan: remove redundant assignment to 
variable i

The resubmit logic in usb_wwan_indat_callback semms need improve:

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;
}

maybe this patch is better?

switch (status) {
case -ESHOTDOWN:
case -ENOENT:
case -ECONNRESET:
case -EOVERFLOW:
case -EPROTO:
     reutrn;
}

thanks.
>
> thanks,
>
> greg k-h


  reply	other threads:[~2023-04-13  4:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 11:54 BUG: linux 5.15.0 hang on usb_wwan_indat_callback qianfan
2023-04-12 17:07 ` Greg Kroah-Hartman
2023-04-13  4:50   ` qianfan [this message]
2023-04-13 13:46     ` Alan Stern
2023-04-14  2:27       ` qianfan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de92552a-3148-03c0-5b4b-94040d8d7969@163.com \
    --to=qianfanguijin@163.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox