You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
USB disconnects and reconnects cause kernel panics #1272
Other common messages seen are
"Unable to handle kernel paging request at virtual address 0x......"
In normal use, this seems to occur because one or USB devices have spontaneously disconnected and reconnected. The root cause of this is still unknown (but outside the scope of this issue)
However I am able to make the OS crash easily by running the following script to force USB devices to reconnect:
I initially thought it might be related to one of the USB devices, but I tried unplugging the modem and audio card but the problem still occurred. Interestingly, I have never seen the crash if I don't have any USB devices connected.
I originally noticed the problem on Raspbian Jessie Lite, kernel 4.1.13+. I also tried running rpi-update to update the kernel to 4.1.16+, but the problem persisted.
I'm not sure how to get the output of the kernel dumps, after the problem occurs, I reset the unit and there's no kernel info in the logs. Some photos are here:
What other information can I provide to help resolve the issue?
I updated to the 4.4.0 development kernel and the problem still occurs. It's worth noting that having multiple USB devices plugged in seems to make it easier to reproduce (i.e. less cycles of USB reset needed to crash), but it can occur with just a keyboard plugged in.
on kernel 4.4.0+, same USB configuration as listed in the original post. This time it shows a warning, but this doesn't always happen, If I leave the script running in a loop, then Linux eventually dies with one of the other error messages listed earlier.
Feb 3 02:57:17 raspberrypi kernel: [ 129.093029] ERROR::dwc_otg_hcd_urb_enqueue:505: Not connected
Feb 3 02:57:17 raspberrypi kernel: [ 129.093029]
Feb 3 02:57:17 raspberrypi avahi-daemon[347]: Interface eth0.IPv6 no longer relevant for mDNS.
Feb 3 02:57:17 raspberrypi avahi-daemon[347]: Leaving mDNS multicast group on interface eth0.IPv6 with address fe80::f222:ec88:3118:6fa.
Feb 3 02:57:17 raspberrypi kernel: [ 129.292945] usb 1-1: USB disconnect, device number 2
Feb 3 02:57:17 raspberrypi kernel: [ 129.292986] usb 1-1.1: USB disconnect, device number 3
Feb 3 02:57:17 raspberrypi kernel: [ 129.293262] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet
Feb 3 02:57:17 raspberrypi kernel: [ 129.293356] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Feb 3 02:57:18 raspberrypi kernel: [ 129.313049] ------------[ cut here ]------------
Feb 3 02:57:18 raspberrypi kernel: [ 129.313131] WARNING: CPU: 0 PID: 15 at include/asm-generic/dma-mapping-common.h:274 __DWC_DMA_FREE+0xac/0xc8()
Feb 3 02:57:18 raspberrypi kernel: [ 129.313148] Modules linked in: cfg80211 rfkill evdev snd_usb_audio joydev snd_usbmidi_lib snd_hwdep sierra_net snd_rawmidi snd_seq_device sierra usbserial bcm2835_gpiomem snd_bcm2835 bcm2835_wdt snd_pcm snd_timer snd uio_pdrv_genirq uio
Feb 3 02:57:18 raspberrypi kernel: [ 129.313255] CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted 4.4.0+ #834
Feb 3 02:57:18 raspberrypi kernel: [ 129.313269] Hardware name: BCM2708
Feb 3 02:57:18 raspberrypi kernel: [ 129.313307] Workqueue: usb_hub_wq hub_event
Feb 3 02:57:18 raspberrypi kernel: [ 129.313377] [<c00169b8>] (unwind_backtrace) from [<c0013944>] (show_stack+0x20/0x24)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313412] [<c0013944>] (show_stack) from [<c02df2f4>] (dump_stack+0x20/0x28)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313447] [<c02df2f4>] (dump_stack) from [<c0021a28>] (warn_slowpath_common+0x8c/0xc4)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313479] [<c0021a28>] (warn_slowpath_common) from [<c0021b1c>] (warn_slowpath_null+0x2c/0x34)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313515] [<c0021b1c>] (warn_slowpath_null) from [<c03f8368>] (__DWC_DMA_FREE+0xac/0xc8)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313549] [<c03f8368>] (__DWC_DMA_FREE) from [<c03f1e20>] (dwc_otg_hcd_qh_free+0xbc/0xec)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313579] [<c03f1e20>] (dwc_otg_hcd_qh_free) from [<c03ea6bc>] (dwc_otg_hcd_endpoint_disable+0xac/0xc0)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313609] [<c03ea6bc>] (dwc_otg_hcd_endpoint_disable) from [<c03edca8>] (endpoint_disable+0x28/0x34)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313649] [<c03edca8>] (endpoint_disable) from [<c03c4148>] (usb_hcd_disable_endpoint+0x3c/0x40)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313687] [<c03c4148>] (usb_hcd_disable_endpoint) from [<c03c66c8>] (usb_disable_endpoint+0x70/0x8c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313720] [<c03c66c8>] (usb_disable_endpoint) from [<c03c6904>] (usb_disable_device+0x1bc/0x1d8)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313752] [<c03c6904>] (usb_disable_device) from [<c03bec10>] (usb_disconnect+0x78/0x208)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313781] [<c03bec10>] (usb_disconnect) from [<c03bed44>] (usb_disconnect+0x1ac/0x208)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313809] [<c03bed44>] (usb_disconnect) from [<c03bf85c>] (hub_event+0x300/0xe4c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313839] [<c03bf85c>] (hub_event) from [<c0036b84>] (process_one_work+0x110/0x39c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313866] [<c0036b84>] (process_one_work) from [<c0036f6c>] (worker_thread+0x15c/0x4e4)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313901] [<c0036f6c>] (worker_thread) from [<c003c6e8>] (kthread+0xe0/0xfc)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313933] [<c003c6e8>] (kthread) from [<c000f608>] (ret_from_fork+0x14/0x2c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.313950] ---[ end trace 38aa7ae261971bca ]---
Feb 3 02:57:18 raspberrypi kernel: [ 129.313979] ------------[ cut here ]------------
Feb 3 02:57:18 raspberrypi kernel: [ 129.314012] WARNING: CPU: 0 PID: 15 at include/asm-generic/dma-mapping-common.h:274 __DWC_DMA_FREE+0xac/0xc8()
Feb 3 02:57:18 raspberrypi kernel: [ 129.314025] Modules linked in: cfg80211 rfkill evdev snd_usb_audio joydev snd_usbmidi_lib snd_hwdep sierra_net snd_rawmidi snd_seq_device sierra usbserial bcm2835_gpiomem snd_bcm2835 bcm2835_wdt snd_pcm snd_timer snd uio_pdrv_genirq uio
Feb 3 02:57:18 raspberrypi kernel: [ 129.314112] CPU: 0 PID: 15 Comm: kworker/0:1 Tainted: G W 4.4.0+ #834
Feb 3 02:57:18 raspberrypi kernel: [ 129.314125] Hardware name: BCM2708
Feb 3 02:57:18 raspberrypi kernel: [ 129.314147] Workqueue: usb_hub_wq hub_event
Feb 3 02:57:18 raspberrypi kernel: [ 129.314187] [<c00169b8>] (unwind_backtrace) from [<c0013944>] (show_stack+0x20/0x24)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314215] [<c0013944>] (show_stack) from [<c02df2f4>] (dump_stack+0x20/0x28)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314243] [<c02df2f4>] (dump_stack) from [<c0021a28>] (warn_slowpath_common+0x8c/0xc4)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314271] [<c0021a28>] (warn_slowpath_common) from [<c0021b1c>] (warn_slowpath_null+0x2c/0x34)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314303] [<c0021b1c>] (warn_slowpath_null) from [<c03f8368>] (__DWC_DMA_FREE+0xac/0xc8)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314334] [<c03f8368>] (__DWC_DMA_FREE) from [<c03f1e20>] (dwc_otg_hcd_qh_free+0xbc/0xec)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314362] [<c03f1e20>] (dwc_otg_hcd_qh_free) from [<c03ea6bc>] (dwc_otg_hcd_endpoint_disable+0xac/0xc0)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314390] [<c03ea6bc>] (dwc_otg_hcd_endpoint_disable) from [<c03edca8>] (endpoint_disable+0x28/0x34)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314422] [<c03edca8>] (endpoint_disable) from [<c03c4148>] (usb_hcd_disable_endpoint+0x3c/0x40)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314455] [<c03c4148>] (usb_hcd_disable_endpoint) from [<c03c66c8>] (usb_disable_endpoint+0x70/0x8c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314486] [<c03c66c8>] (usb_disable_endpoint) from [<c03c68f0>] (usb_disable_device+0x1a8/0x1d8)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314514] [<c03c68f0>] (usb_disable_device) from [<c03bec10>] (usb_disconnect+0x78/0x208)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314541] [<c03bec10>] (usb_disconnect) from [<c03bed44>] (usb_disconnect+0x1ac/0x208)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314566] [<c03bed44>] (usb_disconnect) from [<c03bf85c>] (hub_event+0x300/0xe4c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314592] [<c03bf85c>] (hub_event) from [<c0036b84>] (process_one_work+0x110/0x39c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314617] [<c0036b84>] (process_one_work) from [<c0036f6c>] (worker_thread+0x15c/0x4e4)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314644] [<c0036f6c>] (worker_thread) from [<c003c6e8>] (kthread+0xe0/0xfc)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314673] [<c003c6e8>] (kthread) from [<c000f608>] (ret_from_fork+0x14/0x2c)
Feb 3 02:57:18 raspberrypi kernel: [ 129.314688] ---[ end trace 38aa7ae261971bcb ]---
Feb 3 02:57:18 raspberrypi dhcpcd[581]: eth0: arp if_readrawpacket: Network is down
Feb 3 02:57:18 raspberrypi kernel: [ 129.333121] usb 1-1.2: USB disconnect, device number 5
Feb 3 02:57:18 raspberrypi dhcpcd[581]: eth0: carrier lost
Feb 3 02:57:18 raspberrypi kernel: [ 129.345031] usb 1-1.4: USB disconnect, device number 6
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Interface eth0.IPv4 no longer relevant for mDNS.
Feb 3 02:57:18 raspberrypi kernel: [ 129.359543] usb 1-1.5: USB disconnect, device number 4
Feb 3 02:57:18 raspberrypi kernel: [ 129.360124] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
Feb 3 02:57:18 raspberrypi kernel: [ 129.360240] sierra 1-1.5:1.0: device disconnected
Feb 3 02:57:18 raspberrypi kernel: [ 129.360857] sierra ttyUSB1: Sierra USB modem converter now disconnected from ttyUSB1
Feb 3 02:57:18 raspberrypi kernel: [ 129.360968] sierra 1-1.5:1.1: device disconnected
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.166.77.
Feb 3 02:57:18 raspberrypi kernel: [ 129.364122] sierra ttyUSB2: Sierra USB modem converter now disconnected from ttyUSB2
Feb 3 02:57:18 raspberrypi kernel: [ 129.364246] sierra 1-1.5:1.3: device disconnected
Feb 3 02:57:18 raspberrypi kernel: [ 129.364561] sierra_net 1-1.5:1.7 wwan0: unregister 'sierra_net' usb-20980000.usb-1.5, Sierra Wireless USB-to-WWAN Modem
Feb 3 02:57:18 raspberrypi kernel: [ 129.379400] sierra_net 1-1.5:1.7 wwan0 (unregistered): usb_control_msg failed, status -19
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Withdrawing address record for fe80::f222:ec88:3118:6fa on eth0.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Withdrawing address record for 192.168.166.77 on eth0.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Withdrawing workstation service for eth0.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Interface wwan0.IPv6 no longer relevant for mDNS.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Leaving mDNS multicast group on interface wwan0.IPv6 with address fe80::2bc6:b343:fc1d:35be.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Withdrawing address record for fe80::2bc6:b343:fc1d:35be on wwan0.
Feb 3 02:57:18 raspberrypi avahi-daemon[347]: Withdrawing workstation service for wwan0.
Feb 3 02:57:18 raspberrypi kernel: [ 129.542987] Indeed it is in host mode hprt0 = 00021501
Feb 3 02:57:18 raspberrypi kernel: [ 129.862879] usb 1-1: new high-speed USB device number 7 using dwc_otg
Feb 3 02:57:18 raspberrypi kernel: [ 129.863135] Indeed it is in host mode hprt0 = 00001101
Feb 3 02:57:18 raspberrypi kernel: [ 130.193345] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
Feb 3 02:57:18 raspberrypi kernel: [ 130.193412] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Feb 3 02:57:18 raspberrypi kernel: [ 130.209964] hub 1-1:1.0: USB hub found
Feb 3 02:57:18 raspberrypi kernel: [ 130.210178] hub 1-1:1.0: 5 ports detected
Feb 3 02:57:19 raspberrypi kernel: [ 130.492870] usb 1-1.1: new high-speed USB device number 8 using dwc_otg
Feb 3 02:57:19 raspberrypi kernel: [ 130.593336] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
Feb 3 02:57:19 raspberrypi kernel: [ 130.593379] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Feb 3 02:57:19 raspberrypi kernel: [ 130.608658] smsc95xx v1.0.4
Feb 3 02:57:19 raspberrypi kernel: [ 130.689434] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:9c:3f:64
Feb 3 02:57:19 raspberrypi dhcpcd[581]: eth0: deleting address fe80::f222:ec88:3118:6fa
Feb 3 02:57:19 raspberrypi kernel: [ 130.782882] usb 1-1.5: new high-speed USB device number 9 using dwc_otg
Feb 3 02:57:19 raspberrypi dhcpcd[581]: eth0: deleting route to 192.168.166.0/24
Feb 3 02:57:19 raspberrypi dhcpcd[581]: eth0: deleting default route via 192.168.166.254
Feb 3 02:57:19 raspberrypi kernel: [ 130.884465] usb 1-1.5: config 1 has an invalid interface number: 7 but max is 3
Feb 3 02:57:19 raspberrypi kernel: [ 130.884512] usb 1-1.5: config 1 has no interface number 2
Feb 3 02:57:19 raspberrypi kernel: [ 130.886061] usb 1-1.5: New USB device found, idVendor=1199, idProduct=68a3
Feb 3 02:57:19 raspberrypi kernel: [ 130.886101] usb 1-1.5: New USB device strings: Mfr=3, Product=2, SerialNumber=0
Feb 3 02:57:19 raspberrypi kernel: [ 130.886123] usb 1-1.5: Product: SL8084T
Feb 3 02:57:19 raspberrypi kernel: [ 130.886142] usb 1-1.5: Manufacturer: Sierra Wireless, Incorporated
Feb 3 02:57:19 raspberrypi kernel: [ 130.890455] sierra 1-1.5:1.0: Sierra USB modem converter detected
Feb 3 02:57:19 raspberrypi kernel: [ 130.891908] usb 1-1.5: Sierra USB modem converter now attached to ttyUSB0
Feb 3 02:57:19 raspberrypi kernel: [ 130.892805] sierra 1-1.5:1.1: Sierra USB modem converter detected
Feb 3 02:57:19 raspberrypi kernel: [ 130.906451] usb 1-1.5: Sierra USB modem converter now attached to ttyUSB1
Feb 3 02:57:19 raspberrypi kernel: [ 130.907240] sierra 1-1.5:1.3: Sierra USB modem converter detected
Feb 3 02:57:19 raspberrypi kernel: [ 130.911344] usb 1-1.5: Sierra USB modem converter now attached to ttyUSB2
Feb 3 02:57:19 raspberrypi kernel: [ 130.920175] sierra_net 1-1.5:1.7 wwan0: register 'sierra_net' at usb-20980000.usb-1.5, Sierra Wireless USB-to-WWAN Modem, 06:12:10:a2:02:07
Feb 3 02:57:19 raspberrypi kernel: [ 131.192869] usb 1-1.2: new low-speed USB device number 10 using dwc_otg
Feb 3 02:57:20 raspberrypi kernel: [ 131.311945] usb 1-1.2: New USB device found, idVendor=1a2c, idProduct=0021
Feb 3 02:57:20 raspberrypi kernel: [ 131.311988] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb 3 02:57:20 raspberrypi kernel: [ 131.312009] usb 1-1.2: Product: USB Keykoard
Feb 3 02:57:20 raspberrypi kernel: [ 131.312029] usb 1-1.2: Manufacturer: USB
Feb 3 02:57:20 raspberrypi kernel: [ 131.342982] input: USB USB Keykoard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:1A2C:0021.0004/input/input3
Feb 3 02:57:20 raspberrypi dhcpcd[581]: eth0: removing interface
Feb 3 02:57:20 raspberrypi kernel: [ 131.405856] hid-generic 0003:1A2C:0021.0004: input,hidraw0: USB HID v1.10 Keyboard [USB USB Keykoard] on usb-20980000.usb-1.2/input0
Feb 3 02:57:20 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Wed Feb 3 02:57:50 2016 [try http://www.rsyslog.com/e/2007 ]
Feb 3 02:57:20 raspberrypi dhcpcd[581]: wwan0: removing interface
Feb 3 02:57:20 raspberrypi dhcpcd[581]: wwan0: deleting address fe80::2bc6:b343:fc1d:35be
Feb 3 02:57:20 raspberrypi ntpd[598]: Deleting interface #6 wwan0, fe80::2bc6:b343:fc1d:35be#123, interface stats: received=0, sent=0, dropped=0, active_time=99 secs
Feb 3 02:57:20 raspberrypi ntpd[598]: Deleting interface #5 eth0, fe80::f222:ec88:3118:6fa#123, interface stats: received=0, sent=0, dropped=0, active_time=99 secs
Feb 3 02:57:20 raspberrypi ntpd[598]: Deleting interface #3 eth0, 192.168.166.77#123, interface stats: received=0, sent=8, dropped=0, active_time=99 secs
Feb 3 02:57:20 raspberrypi ntpd[598]: 103.242.68.68 interface 192.168.166.77 -> (none)
Feb 3 02:57:20 raspberrypi ntpd[598]: 203.99.128.34 interface 192.168.166.77 -> (none)
Feb 3 02:57:20 raspberrypi ntpd[598]: 103.239.8.22 interface 192.168.166.77 -> (none)
Feb 3 02:57:20 raspberrypi ntpd[598]: 202.78.240.38 interface 192.168.166.77 -> (none)
Feb 3 02:57:20 raspberrypi ntpd[598]: peers refreshed
Feb 3 02:57:21 raspberrypi dhcpcd[581]: eth0: adding address fe80::f222:ec88:3118:6fa
Feb 3 02:57:21 raspberrypi dhcpcd[581]: eth0: waiting for carrier
Feb 3 02:57:21 raspberrypi kernel: [ 132.686507] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Feb 3 02:57:21 raspberrypi kernel: [ 132.687844] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Feb 3 02:57:21 raspberrypi dhcpcd[581]: wwan0: adding address fe80::8750:7251:8d3a:2672
Feb 3 02:57:21 raspberrypi avahi-daemon[347]: Joining mDNS multicast group on interface wwan0.IPv6 with address fe80::8750:7251:8d3a:2672.
Feb 3 02:57:21 raspberrypi kernel: [ 133.032084] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready
Feb 3 02:57:21 raspberrypi avahi-daemon[347]: New relevant interface wwan0.IPv6 for mDNS.
Feb 3 02:57:21 raspberrypi avahi-daemon[347]: Registering new address record for fe80::8750:7251:8d3a:2672 on wwan0.*.
Feb 3 02:57:21 raspberrypi dhcpcd[581]: wwan0: waiting for carrier
Feb 3 02:57:21 raspberrypi dhcpcd[581]: eth0: removing interface
Feb 3 02:57:21 raspberrypi dhcpcd[581]: eth0: deleting address fe80::f222:ec88:3118:6fa
Feb 3 02:57:22 raspberrypi dhcpcd[581]: wwan0: new hardware address: 06:12:10:a2:01:07
Feb 3 02:57:22 raspberrypi dhcpcd[581]: wwan0: removing interface
Feb 3 02:57:22 raspberrypi dhcpcd[581]: wwan0: deleting address fe80::8750:7251:8d3a:2672
Feb 3 02:57:22 raspberrypi avahi-daemon[347]: Withdrawing address record for fe80::8750:7251:8d3a:2672 on wwan0.
Feb 3 02:57:22 raspberrypi avahi-daemon[347]: Leaving mDNS multicast group on interface wwan0.IPv6 with address fe80::8750:7251:8d3a:2672.
Feb 3 02:57:22 raspberrypi avahi-daemon[347]: Interface wwan0.IPv6 no longer relevant for mDNS.
Feb 3 02:57:22 raspberrypi kernel: [ 134.219030] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
Feb 3 02:57:22 raspberrypi kernel: [ 134.227609] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Feb 3 02:57:30 raspberrypi kernel: [ 141.412941] hid-generic 0003:1A2C:0021.0005: usb_submit_urb(ctrl) failed: -1
Feb 3 02:57:30 raspberrypi kernel: [ 141.412989] hid-generic 0003:1A2C:0021.0005: timeout initializing reports
Feb 3 02:57:30 raspberrypi kernel: [ 141.414006] input: USB USB Keykoard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:1A2C:0021.0005/input/input4
Feb 3 02:57:30 raspberrypi kernel: [ 141.474519] hid-generic 0003:1A2C:0021.0005: input,hidraw1: USB HID v1.10 Device [USB USB Keykoard] on usb-20980000.usb-1.2/input1
Feb 3 02:57:30 raspberrypi kernel: [ 141.712927] usb 1-1.4: new full-speed USB device number 11 using dwc_otg
Feb 3 02:57:30 raspberrypi kernel: [ 141.825464] usb 1-1.4: New USB device found, idVendor=1908, idProduct=2070
Feb 3 02:57:30 raspberrypi kernel: [ 141.825507] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 3 02:57:30 raspberrypi kernel: [ 141.825529] usb 1-1.4: Product: USB PnP Sound Device
Feb 3 02:57:30 raspberrypi kernel: [ 141.825548] usb 1-1.4: Manufacturer: Generic
Feb 3 02:57:30 raspberrypi kernel: [ 141.825565] usb 1-1.4: SerialNumber: 〲㌱㈱
Feb 3 02:57:30 raspberrypi kernel: [ 141.842989] usb 1-1.4: 1:1: cannot get freq at ep 0x2
Feb 3 02:57:30 raspberrypi kernel: [ 141.844839] usb 1-1.4: 2:1: cannot get freq at ep 0x82
Feb 3 02:57:30 raspberrypi kernel: [ 141.880042] input: Generic USB PnP Sound Device as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.4/1-1.4:1.3/0003:1908:2070.0006/input/input5
Feb 3 02:57:30 raspberrypi kernel: [ 141.935226] hid-generic 0003:1908:2070.0006: input,hidraw2: USB HID v2.01 Device [Generic USB PnP Sound Device] on usb-20980000.usb-1.4/input3
Feb 3 02:59:04 raspberrypi kernel: [ 235.745060] smsc95xx 1-1.1:1.0 eth0: link down
Feb 3 02:59:04 raspberrypi rsyslogd-2007: action 'action 17' suspended, next retry is Wed Feb 3 02:59:34 2016 [try http://www.rsyslog.com/e/2007 ]
Feb 3 02:59:06 raspberrypi kernel: [ 237.305140] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
Feb 3 02:59:13 raspberrypi dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Feb 3 02:59:13 raspberrypi dhclient: DHCPNAK from 192.168.166.2
Feb 3 02:59:13 raspberrypi dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 8
Feb 3 02:59:13 raspberrypi dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Feb 3 02:59:13 raspberrypi dhclient: DHCPOFFER from 192.168.166.2
Feb 3 02:59:13 raspberrypi dhclient: DHCPACK from 192.168.166.2
Feb 3 02:59:13 raspberrypi avahi-daemon[347]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.166.77.
Feb 3 02:59:13 raspberrypi avahi-daemon[347]: New relevant interface eth0.IPv4 for mDNS.
Feb 3 02:59:13 raspberrypi avahi-daemon[347]: Registering new address record for 192.168.166.77 on eth0.IPv4.
Feb 3 02:59:14 raspberrypi dhclient: bound to 192.168.166.77 -- renewal in 310951 seconds.
The reason for the 4.4 backtrace seems to be the same issue that we had with the i2s driver, dma_free_coherent being called with interrupts disabled. dwc_otg_hcd_qh_free calls DWC_DMA_FREE inside a spinlock_irqsave block.
Looks like preparation for using DMA pool had been started but it looks unfinished and everything's "#if 0"ed out.
It's possible that memory's being leaked when disconnecting/reconnecting as dwc_otg will stop and start the host driver.
dwc2 is the upstream driver but lacks FIQ support. If you have no low- or full-speed devices then it will probably work OK. It is the go-to for Pi Zero in device mode, however.
I found usb_modeswitch 2.3.0-1 (on archlinux) to be the cause of my kernel panics when I plug in/out my usb modem. When I downgrade the package to the previous version (2.2.6-1), all is fine.
@tpfkanep This particular problem doesn't just happen with the USB modem. I can reproduce it with a USB audio card or other devices as well. Having multiple USB devices seems to make it easier to reproduce though.
This might fix your particular issue, but as previously mentioned, I can reproduce the kernel panics even without usb_modeswitch and a usb modem, e.g with a USB audio card.
Point 3) is a small wild goose chase - because there are only two non-periodic transaction queues (inactive and active), on each scheduling call dwc_otg_queue_transactions() will repeatedly process queue heads that have already been assigned to a channel. I've replicated the early-out mechanism for FIQ enabled channels.
I've fixed several potential crash-inducing conditions due to the FIQ racing against cil_hcd_disconnect() and as far as I can tell, the bug has gone down in severity but is still present - now I get a much longer interval between crashes in assign_and_init_hc(), but before then the driver "forgets" about host channels that it has available and no USB transfers happen after that point.
I believe I have a fix for the list corruption - in kill_all_urbs()->kill_urbs_in_qh_list(), if a transfer is in progress, the channel is forcibly halted but HAINTMSK is not altered. Subsequently in dwc_otg_hcd_disconnect_cb() the channel is unconditionally cleaned up (all interrupt sources masked) and reinserted into free_hc_list.
The corruption happens because if the CPU is slow in executing the second unnecessary disable, a bit in HAINT is set as the channel already halted, which then triggers ...handle_hc_n_intr() which results in the channel being inserted into the list a second time.
The fix is to just let the dequeue code path run to completion and delete the second cleanup.
I have run the test script for a few hours - so far so good.
I notice a number of new error messages show up in syslog:
May 16 14:18:23 raspberrypi kernel: [ 8600.477366] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 14:18:23 raspberrypi kernel: [ 8600.477366]
May 16 14:18:23 raspberrypi kernel: [ 8600.477481] input: USB USB Keykoard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:1A2C:0021.0006/input/input5
May 16 14:18:23 raspberrypi kernel: [ 8600.477542] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 14:18:23 raspberrypi kernel: [ 8600.477542]
May 16 14:18:23 raspberrypi kernel: [ 8600.505325] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 14:18:23 raspberrypi kernel: [ 8600.505325]
May 16 14:18:24 raspberrypi kernel: [ 8600.545356] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 14:18:24 raspberrypi kernel: [ 8600.545356]
I've left the unit to run overnight, will report again tomorrow.
As an aside, I've seen issues on current 4.4.x kernels where sometimes disconnecting/reconnecting my 3G modem can seemingly cause all other USB devices to disconnect and reconnect. I had put this down as a probably hardware problem (perhaps power-related?), but have you seen anything in your recent travels that might suggest a software reason?
3G modems typically play fast and loose with the USB maximum Vbus current draw (500mA). Peak loading when the modem is transmitting can exceed several watts.
I can well imagine that the power supplies draw a surge on hotplug that upsets Vbus on the Pi.
I've run the disconnect/reconnect script overnight with 3 full-speed devices plugged in, no crashes resulted. Closing as fixed.
I stopped the script after running it for > 24 hours, but my USB network and 3G devices were no longer working.
My USB devices were present:
pi@raspberrypi:~$ lsusb
Bus 001 Device 100: ID 0d8c:0016 C-Media Electronics, Inc.
Bus 001 Device 099: ID 1199:68a3 Sierra Wireless, Inc. MC8700 Modem
Bus 001 Device 101: ID 1a2c:0021 China Resource Semico Co., Ltd Keyboard
Bus 001 Device 098: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 097: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@raspberrypi:~$ lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 97, If 0, Class=Hub, Driver=hub/5p, 480M
|__ Port 1: Dev 98, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
|__ Port 2: Dev 101, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 2: Dev 101, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 4: Dev 99, If 1, Class=Vendor Specific Class, Driver=sierra, 480M
|__ Port 4: Dev 99, If 2, Class=Vendor Specific Class, Driver=sierra, 480M
|__ Port 4: Dev 99, If 0, Class=Vendor Specific Class, Driver=sierra, 480M
|__ Port 4: Dev 99, If 7, Class=Vendor Specific Class, Driver=sierra_net, 480M
|__ Port 4: Dev 99, If 3, Class=Vendor Specific Class, Driver=sierra, 480M
|__ Port 5: Dev 100, If 0, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 5: Dev 100, If 1, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 5: Dev 100, If 2, Class=Audio, Driver=snd-usb-audio, 12M
|__ Port 5: Dev 100, If 3, Class=Human Interface Device, Driver=usbhid, 12M
pi@raspberrypi:~$
However, neither eth0 nor wwan0 (3g modem) are accessible.
pi@raspberrypi:~$ ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:90 errors:0 dropped:0 overruns:0 frame:0
TX packets:90 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:12554 (12.2 KiB) TX bytes:12554 (12.2 KiB)
pi@raspberrypi:~$ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
12436: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether b8:27:eb:8f:13:fc brd ff:ff:ff:ff:ff:ff
12437: wwan0: <BROADCAST,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether de:65:07:14:49:07 brd ff:ff:ff:ff:ff:ff
I checked the syslog and the dhcpcd.service failed about 2 hours after starting the test
May 16 16:35:31 raspberrypi kernel: [ 8074.530821] Indeed it is in host mode hprt0 = 00021501
May 16 16:35:31 raspberrypi kernel: [ 8074.730699] usb 1-1: new high-speed USB device number 18 using dwc_otg
May 16 16:35:31 raspberrypi kernel: [ 8074.730914] Indeed it is in host mode hprt0 = 00001101
May 16 16:35:31 raspberrypi kernel: [ 8074.961137] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
May 16 16:35:31 raspberrypi kernel: [ 8074.961160] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 16 16:35:31 raspberrypi kernel: [ 8074.977154] hub 1-1:1.0: USB hub found
May 16 16:35:31 raspberrypi kernel: [ 8074.977326] hub 1-1:1.0: 5 ports detected
May 16 16:35:32 raspberrypi kernel: [ 8075.290717] usb 1-1.1: new high-speed USB device number 19 using dwc_otg
May 16 16:35:32 raspberrypi kernel: [ 8075.421146] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
May 16 16:35:32 raspberrypi kernel: [ 8075.421169] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 16 16:35:32 raspberrypi kernel: [ 8075.424638] smsc95xx v1.0.5
May 16 16:35:32 raspberrypi kernel: [ 8075.518008] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:8f:13:fc
May 16 16:35:32 raspberrypi kernel: [ 8075.610701] usb 1-1.4: new high-speed USB device number 20 using dwc_otg
May 16 16:35:32 raspberrypi kernel: [ 8075.742809] usb 1-1.4: config 1 has an invalid interface number: 7 but max is 4
May 16 16:35:32 raspberrypi kernel: [ 8075.742831] usb 1-1.4: config 1 has no interface number 4
May 16 16:35:32 raspberrypi kernel: [ 8075.744753] usb 1-1.4: New USB device found, idVendor=1199, idProduct=68a3
May 16 16:35:32 raspberrypi kernel: [ 8075.744772] usb 1-1.4: New USB device strings: Mfr=3, Product=2, SerialNumber=0
May 16 16:35:32 raspberrypi kernel: [ 8075.744783] usb 1-1.4: Product: SL8084T
May 16 16:35:32 raspberrypi kernel: [ 8075.744793] usb 1-1.4: Manufacturer: Sierra Wireless, Incorporated
May 16 16:35:32 raspberrypi kernel: [ 8075.762976] sierra 1-1.4:1.0: Sierra USB modem converter detected
May 16 16:35:32 raspberrypi kernel: [ 8075.764075] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB0
May 16 16:35:32 raspberrypi kernel: [ 8075.764871] sierra 1-1.4:1.1: Sierra USB modem converter detected
May 16 16:35:32 raspberrypi kernel: [ 8075.765968] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB1
May 16 16:35:32 raspberrypi kernel: [ 8075.766733] sierra 1-1.4:1.2: Sierra USB modem converter detected
May 16 16:35:32 raspberrypi kernel: [ 8075.775632] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB2
May 16 16:35:32 raspberrypi kernel: [ 8075.776476] sierra 1-1.4:1.3: Sierra USB modem converter detected
May 16 16:35:32 raspberrypi kernel: [ 8075.777822] usb 1-1.4: Sierra USB modem converter now attached to ttyUSB3
May 16 16:35:32 raspberrypi kernel: [ 8075.793309] sierra_net 1-1.4:1.7 wwan0: register 'sierra_net' at usb-20980000.usb-1.4, Sierra Wireless USB-to-WWAN Modem, de:65:07:14:fc:07
May 16 16:35:32 raspberrypi kernel: [ 8075.900766] usb 1-1.5: new full-speed USB device number 21 using dwc_otg
May 16 16:35:32 raspberrypi kernel: [ 8076.039883] usb 1-1.5: New USB device found, idVendor=0d8c, idProduct=0016
May 16 16:35:32 raspberrypi kernel: [ 8076.039907] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 16 16:35:32 raspberrypi kernel: [ 8076.039918] usb 1-1.5: Product: USB Audio Device
May 16 16:35:32 raspberrypi kernel: [ 8076.039928] usb 1-1.5: Manufacturer: C-Media Electronics Inc.
May 16 16:35:32 raspberrypi kernel: [ 8076.103015] input: C-Media Electronics Inc. USB Audio Device as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.5/1-1.5:1.3/0003:0D8C:0016.05F2/input/input1521
May 16 16:35:32 raspberrypi kernel: [ 8076.171643] hid-generic 0003:0D8C:0016.05F2: input,hidraw0: USB HID v1.00 Device [C-Media Electronics Inc. USB Audio Device] on usb-20980000.usb-1.5/input3
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: adding address fe80::9b31:ff3e:31f5:e93e
May 16 16:35:33 raspberrypi kernel: [ 8076.470769] usb 1-1.2: new low-speed USB device number 22 using dwc_otg
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: waiting for carrier
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: carrier acquired
May 16 16:35:33 raspberrypi kernel: [ 8076.616668] usb 1-1.2: New USB device found, idVendor=1a2c, idProduct=0021
May 16 16:35:33 raspberrypi kernel: [ 8076.616693] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
May 16 16:35:33 raspberrypi kernel: [ 8076.616705] usb 1-1.2: Product: USB Keykoard
May 16 16:35:33 raspberrypi kernel: [ 8076.616715] usb 1-1.2: Manufacturer: USB
May 16 16:35:33 raspberrypi kernel: [ 8076.629507] input: USB USB Keykoard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:1A2C:0021.05F3/input/input1522
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: IAID 07:14:fc:07
May 16 16:35:33 raspberrypi kernel: [ 8076.692634] hid-generic 0003:1A2C:0021.05F3: input,hidraw1: USB HID v1.10 Keyboard [USB USB Keykoard] on usb-20980000.usb-1.2/input0
May 16 16:35:33 raspberrypi dhcpcd[514]: eth0: adding address fe80::e3be:a19f:6472:355d
May 16 16:35:33 raspberrypi dhcpcd[514]: eth0: waiting for carrier
May 16 16:35:33 raspberrypi kernel: [ 8076.987227] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 16:35:33 raspberrypi kernel: [ 8076.988534] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: rebinding lease of 100.74.94.245
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: leased 100.74.94.245 for 259200 seconds
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: forcing router 100.74.94.245 through interface
May 16 16:35:33 raspberrypi dhcpcd[514]: wwan0: adding route to 0.0.0.0/0
May 16 16:35:34 raspberrypi dhcpcd[514]: wwan0: soliciting an IPv6 router
May 16 16:35:34 raspberrypi ntpd[538]: Listen normally on 1528 wwan0 100.74.94.245 UDP 123
May 16 16:35:34 raspberrypi ntpd[538]: Listen normally on 1529 wwan0 fe80::9b31:ff3e:31f5:e93e UDP 123
May 16 16:35:34 raspberrypi ntpd[538]: peers refreshed
May 16 16:35:35 raspberrypi kernel: [ 8078.535492] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
May 16 16:35:35 raspberrypi dhcpcd[514]: eth0: carrier acquired
May 16 16:35:35 raspberrypi kernel: [ 8078.543181] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
May 16 16:35:35 raspberrypi dhcpcd[514]: eth0: IAID eb:8f:13:fc
May 16 16:35:35 raspberrypi dhcpcd[514]: eth0: soliciting a DHCP lease
May 16 16:35:35 raspberrypi dhcpcd[514]: eth0: soliciting an IPv6 router
May 16 16:35:37 raspberrypi ntpd[538]: Listen normally on 1530 eth0 fe80::e3be:a19f:6472:355d UDP 123
May 16 16:35:37 raspberrypi ntpd[538]: peers refreshed
May 16 16:35:40 raspberrypi dhcpcd[514]: eth0: probing for an IPv4LL address
May 16 16:35:40 raspberrypi kernel: [ 8084.173399] input: USB USB Keykoard as /devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.1/0003:1A2C:0021.05F4/input/input1523
May 16 16:35:40 raspberrypi kernel: [ 8084.173468] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:40 raspberrypi kernel: [ 8084.173468]
May 16 16:35:40 raspberrypi kernel: [ 8084.173688] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:40 raspberrypi kernel: [ 8084.173688]
May 16 16:35:40 raspberrypi kernel: [ 8084.173808] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:40 raspberrypi kernel: [ 8084.173808]
May 16 16:35:41 raspberrypi kernel: [ 8084.200688] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:41 raspberrypi kernel: [ 8084.200688]
May 16 16:35:41 raspberrypi kernel: [ 8084.240688] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:41 raspberrypi kernel: [ 8084.240688]
May 16 16:35:41 raspberrypi kernel: [ 8084.242300] hid-generic 0003:1A2C:0021.05F4: input,hidraw2: USB HID v1.10 Device [USB USB Keykoard] on usb-20980000.usb-1.2/input1
May 16 16:35:41 raspberrypi kernel: [ 8084.310745] ERROR::dwc_otg_hcd_urb_enqueue:487: Not connected
May 16 16:35:41 raspberrypi kernel: [ 8084.310745]
May 16 16:35:41 raspberrypi dhcpcd[514]: eth0: arp if_readrawpacket: Network is down
May 16 16:35:41 raspberrypi dhcpcd[514]: eth0: carrier lost
May 16 16:35:41 raspberrypi kernel: [ 8084.331008] usb 1-1: USB disconnect, device number 18
May 16 16:35:41 raspberrypi kernel: [ 8084.331033] usb 1-1.1: USB disconnect, device number 19
May 16 16:35:41 raspberrypi kernel: [ 8084.331438] smsc95xx 1-1.1:1.0 eth0: unregister 'smsc95xx' usb-20980000.usb-1.1, smsc95xx USB 2.0 Ethernet
May 16 16:35:41 raspberrypi kernel: [ 8084.331520] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
May 16 16:35:41 raspberrypi kernel: [ 8084.351870] usb 1-1.2: USB disconnect, device number 22
May 16 16:35:41 raspberrypi kernel: [ 8084.365330] usb 1-1.4: USB disconnect, device number 20
May 16 16:35:41 raspberrypi kernel: [ 8084.380602] sierra ttyUSB0: Sierra USB modem converter now disconnected from ttyUSB0
May 16 16:35:41 raspberrypi kernel: [ 8084.380840] sierra 1-1.4:1.0: device disconnected
May 16 16:35:41 raspberrypi kernel: [ 8084.383358] sierra ttyUSB1: Sierra USB modem converter now disconnected from ttyUSB1
May 16 16:35:41 raspberrypi kernel: [ 8084.383501] sierra 1-1.4:1.1: device disconnected
May 16 16:35:41 raspberrypi kernel: [ 8084.392216] sierra ttyUSB2: Sierra USB modem converter now disconnected from ttyUSB2
May 16 16:35:41 raspberrypi kernel: [ 8084.392336] sierra 1-1.4:1.2: device disconnected
May 16 16:35:41 raspberrypi kernel: [ 8084.402119] sierra ttyUSB3: Sierra USB modem converter now disconnected from ttyUSB3
May 16 16:35:41 raspberrypi kernel: [ 8084.402246] sierra 1-1.4:1.3: device disconnected
May 16 16:35:41 raspberrypi kernel: [ 8084.402711] sierra_net 1-1.4:1.7 wwan0: unregister 'sierra_net' usb-20980000.usb-1.4, Sierra Wireless USB-to-WWAN Modem
May 16 16:35:41 raspberrypi kernel: [ 8084.412115] sierra_net 1-1.4:1.7 wwan0 (unregistered): usb_control_msg failed, status -19
May 16 16:35:41 raspberrypi kernel: [ 8084.413073] usb 1-1.5: USB disconnect, device number 21
May 16 16:35:41 raspberrypi systemd[1]: dhcpcd.service: main process exited, code=killed, status=11/SEGV
May 16 16:35:41 raspberrypi dhcpcd[13144]: sending signal TERM to pid 514
May 16 16:35:41 raspberrypi dhcpcd[13144]: dhcpcd not running
May 16 16:35:41 raspberrypi dhcpcd[13144]: dhcpcd[13144]: sending signal TERM to pid 514
May 16 16:35:41 raspberrypi dhcpcd[13144]: dhcpcd[13144]: dhcpcd not running
May 16 16:35:41 raspberrypi systemd[1]: dhcpcd.service: control process exited, code=exited status=1
May 16 16:35:41 raspberrypi systemd[1]: Unit dhcpcd.service entered failed state.
May 16 16:35:42 raspberrypi ntpd[538]: Deleting interface #1530 eth0, fe80::e3be:a19f:6472:355d#123, interface stats: received=0, sent=0, dropped=0, active_time=5 secs
May 16 16:35:42 raspberrypi ntpd[538]: Deleting interface #1529 wwan0, fe80::9b31:ff3e:31f5:e93e#123, interface stats: received=0, sent=0, dropped=0, active_time=8 secs
May 16 16:35:42 raspberrypi ntpd[538]: Deleting interface #1528 wwan0, 100.74.94.245#123, interface stats: received=4, sent=4, dropped=0, active_time=8 secs
May 16 16:35:42 raspberrypi ntpd[538]: 122.252.184.186 interface 100.74.94.245 -> (none)
May 16 16:35:43 raspberrypi ntpd[538]: 103.242.70.5 interface 100.74.94.245 -> (none)
May 16 16:35:43 raspberrypi ntpd[538]: 130.217.226.50 interface 100.74.94.245 -> (none)
May 16 16:35:43 raspberrypi ntpd[538]: 203.97.213.52 interface 100.74.94.245 -> (none)
May 16 16:35:43 raspberrypi ntpd[538]: peers refreshed
After restarting dhcpcd (systemctl restart dhcpcd), everything is ok again.
as reported, eth0 seemed to be ok from a driver perspective (it was present in /sys/class/net) but did not show in the list when I ran ifconfig.
Everything was fine again after starting dhcpcd.service (without rebooting the device)
The fixes are specific to the dwc_otg driver, which is a downstream implementation.
Also, unless your desktop hardware is powered by a mobile phone SoC using an OTG USB core, it's highly unlikely that this issue is the one you're seeing.
@P33M I'm getting a lot of issues similar to what you describe, when running webcams over the usb, namely sporadically get dmesg messages, and eventually get following, which requires a power cycle to recover from.
I'm running,
Linux version 4.9.41-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1023 SMP Tue Aug 8 16:00:15 BST 2017
Activity
jkuek commentedon Jan 28, 2016
I am able to crash Raspbian Wheezy 3.18.11+ with the same script, although the trace is different
jkuek commentedon Feb 2, 2016
I updated to the 4.4.0 development kernel and the problem still occurs. It's worth noting that having multiple USB devices plugged in seems to make it easier to reproduce (i.e. less cycles of USB reset needed to crash), but it can occur with just a keyboard plugged in.
jkuek commentedon Feb 3, 2016
Here's the syslog output after one run of my script:
on kernel 4.4.0+, same USB configuration as listed in the original post. This time it shows a warning, but this doesn't always happen, If I leave the script running in a loop, then Linux eventually dies with one of the other error messages listed earlier.
HiassofT commentedon Feb 3, 2016
The reason for the 4.4 backtrace seems to be the same issue that we had with the i2s driver, dma_free_coherent being called with interrupts disabled. dwc_otg_hcd_qh_free calls DWC_DMA_FREE inside a spinlock_irqsave block.
Looks like preparation for using DMA pool had been started but it looks unfinished and everything's "#if 0"ed out.
jkuek commentedon Feb 4, 2016
Here's another backtrace from 4.1.13
panic 4.1.13.txt
jkuek commentedon Feb 4, 2016
Here's kern.log showing multiple oops and eventual panic on 4.4.1
panic 4.4.1.txt
jkuek commentedon Feb 4, 2016
Another log, different backtrace
dwc error 4.4.1.txt
[-]Kernel panics (USB-triggered?)[/-][+]USB disconnects and reconnects cause kernel panics[/+]jkuek commentedon Feb 9, 2016
Updated the kernel using apt-get to 4.1.17+ #834, still getting a crash, but this time it says
kernel BUG at drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c:2425!
Internal error: Oops - BUG: 0 [#1] ARM
Full crash log: crash 4.1.17.txt
Is anyone still maintaining the dwc_otg driver? I see there is a dwc2 driver in mainline, should I switch to that instead?
P33M commentedon Feb 10, 2016
It's possible that memory's being leaked when disconnecting/reconnecting as dwc_otg will stop and start the host driver.
dwc2 is the upstream driver but lacks FIQ support. If you have no low- or full-speed devices then it will probably work OK. It is the go-to for Pi Zero in device mode, however.
tpfkanep commentedon Mar 11, 2016
I found usb_modeswitch 2.3.0-1 (on archlinux) to be the cause of my kernel panics when I plug in/out my usb modem. When I downgrade the package to the previous version (2.2.6-1), all is fine.
jkuek commentedon Mar 13, 2016
@tpfkanep This particular problem doesn't just happen with the USB modem. I can reproduce it with a USB audio card or other devices as well. Having multiple USB devices seems to make it easier to reproduce though.
jkuek commentedon Mar 21, 2016
Seen again on 4.4.6+ #861:
tpfkanep commentedon Jul 3, 2016
A user on the usb_modeswitch forum posted the following solution (working great on my Pi for a couple of days now):
http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=4&t=2498
jkuek commentedon Jul 3, 2016
@tpfkanep Thanks for the info.
This might fix your particular issue, but as previously mentioned, I can reproduce the kernel panics even without usb_modeswitch and a usb modem, e.g with a USB audio card.
19 remaining items
P33M commentedon May 12, 2017
Point 3) is a small wild goose chase - because there are only two non-periodic transaction queues (inactive and active), on each scheduling call
dwc_otg_queue_transactions()will repeatedly process queue heads that have already been assigned to a channel. I've replicated the early-out mechanism for FIQ enabled channels.I've fixed several potential crash-inducing conditions due to the FIQ racing against
cil_hcd_disconnect()and as far as I can tell, the bug has gone down in severity but is still present - now I get a much longer interval between crashes inassign_and_init_hc(), but before then the driver "forgets" about host channels that it has available and no USB transfers happen after that point.P33M commentedon May 15, 2017
I believe I have a fix for the list corruption - in
kill_all_urbs()->kill_urbs_in_qh_list(), if a transfer is in progress, the channel is forcibly halted but HAINTMSK is not altered. Subsequently indwc_otg_hcd_disconnect_cb()the channel is unconditionally cleaned up (all interrupt sources masked) and reinserted into free_hc_list.The corruption happens because if the CPU is slow in executing the second unnecessary disable, a bit in HAINT is set as the channel already halted, which then triggers
...handle_hc_n_intr()which results in the channel being inserted into the list a second time.The fix is to just let the dequeue code path run to completion and delete the second cleanup.
jkuek commentedon May 16, 2017
I have run the test script for a few hours - so far so good.
I notice a number of new error messages show up in syslog:
I've left the unit to run overnight, will report again tomorrow.
As an aside, I've seen issues on current 4.4.x kernels where sometimes disconnecting/reconnecting my 3G modem can seemingly cause all other USB devices to disconnect and reconnect. I had put this down as a probably hardware problem (perhaps power-related?), but have you seen anything in your recent travels that might suggest a software reason?
P33M commentedon May 16, 2017
3G modems typically play fast and loose with the USB maximum Vbus current draw (500mA). Peak loading when the modem is transmitting can exceed several watts.
I can well imagine that the power supplies draw a surge on hotplug that upsets Vbus on the Pi.
I've run the disconnect/reconnect script overnight with 3 full-speed devices plugged in, no crashes resulted. Closing as fixed.
jkuek commentedon May 16, 2017
Ah yes, but in my case the modem is externally powered, and it's just a USB connection to the Pi.
I concur with your findings, I ran the script overnight and the unit is still running! Thanks.
Will those syslog error messages be in the official release? The additional extra empty line could be removed.
jkuek commentedon May 17, 2017
@P33M just noticed one issue:
I stopped the script after running it for > 24 hours, but my USB network and 3G devices were no longer working.
My USB devices were present:
However, neither eth0 nor wwan0 (3g modem) are accessible.
I checked the syslog and the dhcpcd.service failed about 2 hours after starting the test
After restarting dhcpcd (systemctl restart dhcpcd), everything is ok again.
P33M commentedon May 17, 2017
So eth0 came back without a reboot, correct?
jkuek commentedon May 17, 2017
as reported, eth0 seemed to be ok from a driver perspective (it was present in /sys/class/net) but did not show in the list when I ran ifconfig.
Everything was fine again after starting dhcpcd.service (without rebooting the device)
dimaqq commentedon Sep 21, 2017
@P33M do you know if your fix (or some other fix) landed upstream?
I'm having similar hangs on desktop on stock 4.4.0 and custom USB device that's externally powered.
P33M commentedon Sep 21, 2017
The fixes are specific to the dwc_otg driver, which is a downstream implementation.
Also, unless your desktop hardware is powered by a mobile phone SoC using an OTG USB core, it's highly unlikely that this issue is the one you're seeing.
dimaqq commentedon Sep 21, 2017
Ugh, thanks, I'll keep digging!
l-spitz commentedon Sep 26, 2017
@P33M I'm getting a lot of issues similar to what you describe, when running webcams over the usb, namely sporadically get dmesg messages, and eventually get following, which requires a power cycle to recover from.
I'm running,
Linux version 4.9.41-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1023 SMP Tue Aug 8 16:00:15 BST 2017
Is the fix you mention in this release?
bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer
bpf, selftests: Update test case for atomic cmpxchg on r0 with pointer