Re: BUG: linux 5.15.0 hang on usb_wwan_indat_callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux