Re: Linux 4.2.0-rc5: am335x: musb warnings

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

 



Hi Bin,

On Fri, Apr 1, 2016 at 8:56 AM, Yegor Yefremov
<yegorslists@xxxxxxxxxxxxxx> wrote:
> On Thu, Mar 31, 2016 at 10:13 PM, Bin Liu <b-liu@xxxxxx> wrote:
>> Hi,
>>
>> On Mon, Mar 14, 2016 at 03:54:36PM +0100, Yegor Yefremov wrote:
>>> On Mon, Mar 14, 2016 at 3:42 PM, Bin Liu <b-liu@xxxxxx> wrote:
>>> > Hi,
>>> >
>>> > On Mon, Mar 14, 2016 at 03:33:51PM +0100, Yegor Yefremov wrote:
>>> >> On Mon, Mar 14, 2016 at 3:01 PM, Bin Liu <b-liu@xxxxxx> wrote:
>>> >> > Hi Yegor,
>>> >> >
>>> >> > On Mon, Mar 14, 2016 at 02:40:34PM +0100, Yegor Yefremov wrote:
>>> >> >> On Mon, Mar 14, 2016 at 1:11 PM, Ladislav Michl <ladis@xxxxxxxxxxxxxx> wrote:
>>> >> >> > On Mon, Mar 14, 2016 at 11:25:59AM +0100, Yegor Yefremov wrote:
>>> >> >> >
>>> >> >> > Hi Yegor,
>>> >> >> >
>>> >> >> >> Hi Bin,
>>> >> >> >>
>>> >> >> >> On Wed, Jan 27, 2016 at 11:01 AM, Ladislav Michl <ladis@xxxxxxxxxxxxxx> wrote:
>>> >> >> >> > Any chance it will actually happen? MUSB is still unusable for me and
>>> >> >> >> > doesn't work properly since TI's 2.6.37 kernel (oldest one I have
>>> >> >> >> > tried)...
>>> >> >> >>
>>> >> >> >> The issue with musb_h_tx_flush_fifo still persists. Kernel 4.5.0-rc6.
>>> >> >> >> Just activating SImCOM SIM7100E produces following error:
>>> >> >> >>
>>> >> >> >> # usb 1-1.3: new high-speed USB device number 6 using musb-hdrc
>>> >> >> >> usbcore: registered new interface driver option
>>> >> >> >> usbserial: USB Serial support registered for GSM modem (1-port)
>>> >> >> >> option 1-1.3:1.0: GSM modem (1-port) converter detected
>>> >> >> >> usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB4
>>> >> >> >> option 1-1.3:1.1: GSM modem (1-port) converter detected
>>> >> >> >> usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB5
>>> >> >> >> option 1-1.3:1.2: GSM modem (1-port) converter detected
>>> >> >> >> usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB6
>>> >> >> >> option 1-1.3:1.3: GSM modem (1-port) converter detected
>>> >> >> >> usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB7
>>> >> >> >> option 1-1.3:1.4: GSM modem (1-port) converter detected
>>> >> >> >> usb 1-1.3: GSM modem (1-port) converter now attached to ttyUSB8
>>> >> >> >> qmi_wwan 1-1.3:1.5: cdc-wdm0: USB WDM device
>>> >> >> >> qmi_wwan 1-1.3:1.5 wwan0: register 'qmi_wwan' at
>>> >> >> >> usb-musb-hdrc.0.auto-1.3, WWAN/QMI device, b2:67:d8:31:8f:b6
>>> >> >> >> usbcore: registered new interface driver qmi_wwan
>>> >> >> >> ------------[ cut here ]------------
>>> >> >> >> WARNING: CPU: 0 PID: 868 at drivers/usb/musb/musb_host.c:139
>>> >> >> >> musb_h_tx_flush_fifo+0xc4/0xe4()
>>> >> >> >> musb-hdrc musb-hdrc.0.auto: Could not flush host TX2 fifo: csr: 2403
>>> >> >> >> Modules linked in: qmi_wwan option usb_wwan ftdi_sio usbserial
>>> >> >> >> musb_dsps musb_am335x
>>> >> >> >> CPU: 0 PID: 868 Comm: ModemManager Not tainted 4.5.0-rc6 #47
>>> >> >> >> Hardware name: Generic AM33XX (Flattened Device Tree)
>>> >> >> >> [<c0017e34>] (unwind_backtrace) from [<c0014088>] (show_stack+0x10/0x14)
>>> >> >> >> [<c0014088>] (show_stack) from [<c02c5b24>] (dump_stack+0xb0/0xe4)
>>> >> >> >> [<c02c5b24>] (dump_stack) from [<c003bca4>] (warn_slowpath_common+0x7c/0xb8)
>>> >> >> >> [<c003bca4>] (warn_slowpath_common) from [<c003bd10>]
>>> >> >> >> (warn_slowpath_fmt+0x30/0x40)
>>> >> >> >> [<c003bd10>] (warn_slowpath_fmt) from [<c041ec10>]
>>> >> >> >> (musb_h_tx_flush_fifo+0xc4/0xe4)
>>> >> >> >> [<c041ec10>] (musb_h_tx_flush_fifo) from [<c041fd54>]
>>> >> >> >> (musb_cleanup_urb+0xbc/0x130)
>>> >> >> >> [<c041fd54>] (musb_cleanup_urb) from [<c0420404>] (musb_urb_dequeue+0xf0/0x128)
>>> >> >> >> [<c0420404>] (musb_urb_dequeue) from [<c03fa82c>] (usb_hcd_unlink_urb+0x50/0x84)
>>> >> >> >> [<c03fa82c>] (usb_hcd_unlink_urb) from [<c03fba70>] (usb_kill_urb+0x4c/0xc4)
>>> >> >> >> [<c03fba70>] (usb_kill_urb) from [<bf02f85c>]
>>> >> >> >> (usb_wwan_close+0xbc/0xf0 [usb_wwan])
>>> >> >> >> [<bf02f85c>] (usb_wwan_close [usb_wwan]) from [<c0322ce8>]
>>> >> >> >> (tty_port_shutdown+0x90/0x9c)
>>> >> >> >> [<c0322ce8>] (tty_port_shutdown) from [<c03233cc>] (tty_port_close+0x24/0x4c)
>>> >> >> >> [<c03233cc>] (tty_port_close) from [<c031a258>] (tty_release+0xec/0x478)
>>> >> >> >> [<c031a258>] (tty_release) from [<c014ef38>] (__fput+0x80/0x1d0)
>>> >> >> >> [<c014ef38>] (__fput) from [<c005a8d8>] (task_work_run+0x90/0xc4)
>>> >> >> >> [<c005a8d8>] (task_work_run) from [<c0013a4c>] (do_work_pending+0x8c/0xb4)
>>> >> >> >> [<c0013a4c>] (do_work_pending) from [<c000f8e8>] (slow_work_pending+0xc/0x20)
>>> >> >> >> ---[ end trace fb2fc0420e2c4594 ]---
>>> >> >> >>
>>> >> >> >> Could you please take a look at this?
>>> >> >> >>
>>> >> >> >> Yegor
>>> >> >> >
>>> >> >> > I cannot reproduce it anymore, as commits
>>> >> >> > 4c2ba0c67394514f3f75c660c9f5d02e66a7efd4
>>> >> >> > bba40e6948b94cba71965285fbac31bd078c024a
>>> >> >> > fixed issue for me (using Inventra DMA on DM3730) - but those two are part
>>> >> >> > of 4.5.0-rc6 ...
>>> >> >>
>>> >> >> You are lucky! I've tried 4.5.0 and I still have this issue, though
>>> >> >> I'm on am335x and not on DM3730:
>>> >> >
>>> >> > How do you trigger the issue? Plug the modem then unplug it?
>>> >> > Can you please try the way in [1] to increase the loops to see if the
>>> >> > fifo could be flushed in a longer time?
>>> >> >
>>> >> > Regards,
>>> >> > -Bin.
>>> >> >
>>> >> > [1] http://www.spinics.net/lists/linux-usb/msg137242.html
>>> >>
>>> >> Do you mean something like this?
>>> >>
>>> >> diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
>>> >> index 58487a4..f6d6822 100644
>>> >> --- a/drivers/usb/musb/musb_host.c
>>> >> +++ b/drivers/usb/musb/musb_host.c
>>> >> @@ -112,7 +112,7 @@ static void musb_h_tx_flush_fifo(struct musb_hw_ep *ep)
>>> >>         struct musb     *musb = ep->musb;
>>> >>         void __iomem    *epio = ep->regs;
>>> >>         u16             csr;
>>> >> -       int             retries = 1000;
>>> >> +       int             retries = 10000;
>>> >
>>> > Yes.
>>> >
>>> >>
>>> >>         csr = musb_readw(epio, MUSB_TXCSR);
>>> >>         while (csr & MUSB_TXCSR_FIFONOTEMPTY) {
>>> >>
>>> >> No, it doesn't help. I'm triggering this issue via enabling it, i.e.
>>> >> our hardware can power on/off mPCIe slot via GPIO pin. When the system
>>> >> starts mPCI slot is disabled. The I enable it after booting into user
>>> >> space and the produces the error. It also happens if I insert USB
>>> >
>>> > Ok. I can imagine the device is no longer functional due to the fifo
>>> > flush issue.
>>>
>>> I've inserted the mPCIe modem into the system, where mPCIe is alsways
>>> on and the issue is still there. Some modems like Huawei MU609 are
>>> working, but when using with the latest usb_modeswitch and compiling
>>> all those drivers as modules (option, qmi_wwan etc.) I can also
>>> provoke the FIFO flush issue.
>>>
>>> >> modem as a dongle, where usb_modeswitch first has to switch it from
>>> >> CD-ROM mode into modem mode.
>>> >
>>> > Any detail of the usb modem dongle? I will try to find one to take a
>>> > look. I have a few usb modems but none of them triggers this problem.
>>>
>>> TP-LINK MA260 (http://www.tp-link.com/en/products/details/cat-5090_MA260.html)
>>>
>>
>> What exactly do you do to trigger the fifo flush problem on MA260? I got
>> a MA260 dongle, but usb_modeswitch does not trigger it.
>
> I'm using Debian 8 image with following usb_modeswitch:
>
> root@baltos:~# usb_modeswitch -e
>
>  * usb_modeswitch: handle USB devices with multiple modes
>  * Version 2.2.0 (C) Josua Dietze 2014
>  * Based on libusb1/libusbx
>
>  ! PLEASE REPORT NEW CONFIGURATIONS !
>
> Both 3.18.21 and 4.5.0 report following error after MA260 insertion:
>
> usb 1-1.2: new high-speed USB device number 3 using musb-hdrc
> usb 1-1.2: New USB device found, idVendor=2357, idProduct=f000
> usb 1-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4
> usb 1-1.2: Product: TP-LINK HSPA+ Modem
> usb 1-1.2: Manufacturer: TP-LINK, Incorporated
> usb 1-1.2: SerialNumber: 863745011099716
> usb-storage 1-1.2:1.0: USB Mass Storage device detected
> scsi host0: usb-storage 1-1.2:1.0
> scsi 0:0:0:0: CD-ROM            TP-LINK  MMC Storage      2.31 PQ: 0 ANSI: 2
> scsi 0:0:0:1: Direct-Access     TP-LINK  MMC Storage      2.31 PQ: 0 ANSI: 2
> sd 0:0:0:1: [sda] Attached SCSI removable disk
> usb 1-1.2: USB disconnect, device number 3
> usb 1-1.2: new high-speed USB device number 4 using musb-hdrc
> usb 1-1.2: New USB device found, idVendor=2357, idProduct=9000
> usb 1-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4
> usb 1-1.2: Product: TP-LINK HSPA+ Modem
> usb 1-1.2: Manufacturer: TP-LINK, Incorporated
> usb 1-1.2: SerialNumber: 863745011099716
> usb-storage 1-1.2:1.2: USB Mass Storage device detected
> scsi host1: usb-storage 1-1.2:1.2
> qmi_wwan 1-1.2:1.4: cdc-wdm0: USB WDM device
> qmi_wwan 1-1.2:1.4 wwan0: register 'qmi_wwan' at
> usb-musb-hdrc.0.auto-1.2, WWAN/QMI device, de:ea:e8:d0:61:6c
> usbcore: registered new interface driver option
> usbserial: USB Serial support registered for GSM modem (1-port)
> option 1-1.2:1.0: GSM modem (1-port) converter detected
> usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
> option 1-1.2:1.1: GSM modem (1-port) converter detected
> usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
> option 1-1.2:1.3: GSM modem (1-port) converter detected
> usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
> scsi 1:0:0:0: CD-ROM            TP-LINK  MMC Storage      2.31 PQ: 0 ANSI: 2
> scsi 1:0:0:1: Direct-Access     TP-LINK  MMC Storage      2.31 PQ: 0 ANSI: 2
> sd 1:0:0:1: [sda] Attached SCSI removable disk
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 1740 at drivers/usb/musb/musb_host.c:139
> musb_h_tx_flush_fifo+0xc4/0xe4()
> musb-hdrc musb-hdrc.0.auto: Could not flush host TX2 fifo: csr: 2403
> Modules linked in: option usb_wwan musb_dsps musb_am335x
> CPU: 0 PID: 1740 Comm: ModemManager Not tainted 4.5.0 #1
> Hardware name: Generic AM33XX (Flattened Device Tree)
> [<c0017ecc>] (unwind_backtrace) from [<c0014100>] (show_stack+0x10/0x14)
> [<c0014100>] (show_stack) from [<c03cf384>] (dump_stack+0xb0/0xe4)
> [<c03cf384>] (dump_stack) from [<c003bf68>] (warn_slowpath_common+0x7c/0xb8)
> [<c003bf68>] (warn_slowpath_common) from [<c003bfd4>]
> (warn_slowpath_fmt+0x30/0x40)
> [<c003bfd4>] (warn_slowpath_fmt) from [<c0534c30>]
> (musb_h_tx_flush_fifo+0xc4/0xe4)
> [<c0534c30>] (musb_h_tx_flush_fifo) from [<c0535d74>]
> (musb_cleanup_urb+0xbc/0x130)
> [<c0535d74>] (musb_cleanup_urb) from [<c0536424>] (musb_urb_dequeue+0xf0/0x128)
> [<c0536424>] (musb_urb_dequeue) from [<c050b98c>] (usb_hcd_unlink_urb+0x50/0x84)
> [<c050b98c>] (usb_hcd_unlink_urb) from [<c050cbd0>] (usb_kill_urb+0x4c/0xc4)
> [<c050cbd0>] (usb_kill_urb) from [<bf00e85c>]
> (usb_wwan_close+0xbc/0xf0 [usb_wwan])
> [<bf00e85c>] (usb_wwan_close [usb_wwan]) from [<c042d8e0>]
> (tty_port_shutdown+0x90/0x9c)
> [<c042d8e0>] (tty_port_shutdown) from [<c042dfd0>] (tty_port_close+0x24/0x4c)
> [<c042dfd0>] (tty_port_close) from [<c0425f30>] (tty_release+0xec/0x474)
> [<c0425f30>] (tty_release) from [<c0168b60>] (__fput+0x80/0x1d0)
> [<c0168b60>] (__fput) from [<c005b944>] (task_work_run+0x90/0xc4)
> [<c005b944>] (task_work_run) from [<c0013ac4>] (do_work_pending+0x8c/0xb4)
> [<c0013ac4>] (do_work_pending) from [<c000f8e8>] (slow_work_pending+0xc/0x20)
> ---[ end trace cbf0ee35fffa18d3 ]---
>
> Debian image was created with these scripts:
> https://github.com/visionsystemsgmbh/vsdebootstrap
> Kernel config: https://github.com/visionsystemsgmbh/onrisc_br_bsp/blob/master/board/vscom/baltos/linux-3.15-config
>
> I've tried both usb1 channel and USB hub and usb2 channel directly. In
> both cases I get this crash.

I've made some more test and could at least find a software
constellation, that produces this error. You'll need ModemManager and
libqmi. As soon as ModemManager sees the modem it opens and closes its
interfaces in oder to get modem's configuration. And wwan closing
seems to produce this error. I could reproduce this behavior with
am335x-evmsk, Linux 4.5 (omap2plus_defconfig, CONFIG_USB_NET_CDC_MBIM,
CONFIG_USB_NET_QMI_WWAN and CONFIG_USB_SERIAL_OPTION) and Buildroot
with enabled ModemManager and libqmi support.

Yegor
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux