rockchip-linux / kernel

BSP kernel source
Other
954 stars 1.11k forks source link

USB 3.0 disconnect hangs USB subsystem #34

Open rmbusy opened 7 years ago

rmbusy commented 7 years ago

First saw this with xenial-minimal-rock64-0.4.17-85-arm64.img. Next tried jessie-minimal-rock64-0.5.7-101-arm64.img, and seeing same basic issue. After disconnecting USB 3.0 HD from USB 3.0 port, any attempt to interface with USB causes timeout and kernel panic.

Using rock64 4GB, booting from 4GB SD Card. Connected a USB 3.0 external disk drive (already formatted w/ 2 linux partitions). Drive is a Seagate 2TB 2.5" Hybrid drive, in a bus powered JMicron based external housing.

Mounted both partitions under /media/sda1 & /media/sda3. Did 'ls -ahl' on both mounts. Then unmounted both partitions, and verified with "mount". Next unplugged USB drive.

The jessie image console output at disconnect was : [ 873.393783] usb usb5-port1: Cannot enable. Maybe the USB cable is bad? [ 873.394805] xhci-hcd xhci-hcd.8.auto: Cannot set link state. [ 873.395754] usb usb5-port1: cannot disable (err = -32) [ 875.910788] usb usb5-port1: Cannot enable. Maybe the USB cable is bad? [ 875.911801] xhci-hcd xhci-hcd.8.auto: Cannot set link state. [ 875.912735] usb usb5-port1: cannot disable (err = -32) [ 878.426774] usb usb5-port1: Cannot enable. Maybe the USB cable is bad? [ 878.427787] xhci-hcd xhci-hcd.8.auto: Cannot set link state. [ 878.428729] usb usb5-port1: cannot disable (err = -32) [ 880.943791] usb usb5-port1: Cannot enable. Maybe the USB cable is bad? [ 880.944809] xhci-hcd xhci-hcd.8.auto: Cannot set link state. [ 880.945741] usb usb5-port1: cannot disable (err = -32) [ 880.946543] xhci-hcd xhci-hcd.8.auto: Cannot set link state. [ 880.947492] usb usb5-port1: cannot disable (err = -32) [ 880.948328] scsi host0: uas_post_reset: alloc streams error -19 after reset [ 880.952607] sd 0:0:0:0: [sda] Synchronizing SCSI cache

Awhile later, tried to do a lsusb, and it hung. Then kernel panic was next : (attached as text file, since form is messing with content) kernelpanic.txt

ayufan commented 7 years ago

I'm facing the same problem, also on mainline kernel.

rmbusy commented 7 years ago

Randomly seeing additional related issues of unhandled level 3 translation faults :

[432893.072550] cat[11190]: unhandled level 3 translation fault (11) at 0x005017 [432893.076615] pgd = ffffffc0c2d25000 [432893.080031] [005017e0] pgd=00000000f1227003, pud=00000000f1227003, *pmd=00000000c2e610030 [432893.084400] [432893.087993] CPU: 2 PID: 11190 Comm: cat Not tainted 4.4.77-rockchip-ayufan-101 #1 [432893.091970] Hardware name: Rockchip RK3328 Rock64 (DT) [432893.095965] task: ffffffc0f4c73600 ti: ffffffc0c2d38000 task.ti: ffffffc0c2d38000 [432893.100084] PC is at 0x5017e0 [432893.103887] LR is at 0x401cb8 [432893.107979] pc : [<00000000005017e0>] lr : [<0000000000401cb8>] pstate: 60000000 [432893.112271] sp : 0000007fc1beaec0 [432893.116452] x29: 0000007fc1beaec0 x28: 0000000000000000 [432893.120658] x27: 0000000000000000 x26: 0000000000000000 [432893.124747] x25: 0000000000000000 x24: 0000000000000000 [432893.128803] x23: 0000000000000000 x22: 0000000000000000 [432893.132866] x21: 0000000000402850 x20: 0000007fc1beb1b8 [432893.136859] x19: 0000000000000000 x18: 0000007fc1beaf10 [432893.140844] x17: 00000000005017e0 x16: 000000000041a0f8 [432893.144822] x15: 0000007fae102000 x14: 0000000000000040 [432893.148857] x13: 0000007fae102028 x12: 0000000000008730 [432893.152861] x11: 0000000000000090 x10: 00000000ffffffff [432893.156698] x9 : 0000007fae0ef0b8 x8 : 0000007fae0edad8 [432893.160541] x7 : 00000000001a233a x6 : 0000007fae0d1aa0 [432893.164229] x5 : fe42e3dc82313c67 x4 : 0000000000000000 [432893.167763] x3 : 0000000000401c70 x2 : 0000007fc1beb1d0 [432893.171428] x1 : 0000000000000000 x0 : 000000000041a000 [432893.174936]

This is after 5 days of uptime, running Motion 4.0.1 application. The USB drive is still responsive, but I can produce a similar failure by running lsusb. I changed to a different USB drive since the original posting. The new drive is a self powered 8TB Seagate Backup Plus. Also, the lsusb does not return anything but "Segmentation fault"

The console error reported by lsusb is : root@rock64: # lsusb [434630.457329] lsusb[11357]: unhandled level 2 translation fault (11) at 0x00000008, esr 0x926 [434630.461079] pgd = ffffffc0e3c82000 [434630.464594] [00000008] pgd=00000000c2ce4003, pud=00000000c2ce4003, *pmd=0000000000000000 [434630.468436] [434630.471613] CPU: 1 PID: 11357 Comm: lsusb Not tainted 4.4.77-rockchip-ayufan-101 #1 [434630.475538] Hardware name: Rockchip RK3328 Rock64 (DT) Segmentation fault root@rock64: # [434630.475544] task: ffffffc0e3d00d80 ti: ffffffc0c2d34000 task.ti: ffffffc0c20 [434630.475553] PC is at 0x7fa5ef413c [434630.475555] LR is at 0x7fa5ef3e08 [434630.475558] pc : [<0000007fa5ef413c>] lr : [<0000007fa5ef3e08>] pstate: 80000000 [434630.475559] sp : 0000007ffcca6880 [434630.475564] x29: 0000007ffcca68b0 x28: 0000007fa5f16568 [434630.475568] x27: 0000007ffcca6b30 x26: 0000007ffcca6780 [434630.475572] x25: 0000000000000001 x24: 0000007ffcca6af0 [434630.475575] x23: 0000000000000000 x22: 0000000000000002 [434630.475578] x21: 0000000000000006 x20: 0000007fa5f19000 [434630.475581] x19: 0000000000024518 x18: 0000000000000000 [434630.475585] x17: 0000007fa5f01b28 x16: 0000007fa5f1a000 [434630.475588] x15: 0000007fa5f01590 x14: 0000007fa5f01668 [434630.475592] x13: 00000000000253df x12: 0000000000000ad0 [434630.475595] x11: 0000000000023d78 x10: 000000037ffffa00 [434630.475599] x9 : 000000037ffff1a0 x8 : 0000007fa5eed518 [434630.475602] x7 : 0000000000000000 x6 : 0000000001ffff0f [434630.475606] x5 : 0000000000000031 x4 : 0000007fa5ec9000 [434630.475609] x3 : 0000007fa5f165a8 x2 : 0000000070000021 [434630.475612] x1 : 0000007fa5ecb238 x0 : 0000000000000000 [434630.475613]

ayufan commented 7 years ago

@wzyy2 does this solve problem with USB3 unable to change link state? It seems that this solves some other problem

wzyy2 commented 7 years ago

No.... It's just auto referenced by github...

ayufan commented 7 years ago

OK. Thanks :) Do you have some idea why the usb fails?

f5Qz commented 6 years ago

https://github.com/ayufan-rock64/linux-build/issues/140

ayufan commented 6 years ago

@wzyy2 we still have this problem, it seems that for whatever reason the USB3 PHY is not being properly reset after soft reboot.

ayufan commented 6 years ago

@wzyy2 @keveryang We are still seeing these problems, for example here: https://github.com/ayufan-rock64/linux-build/issues/112

Redwid commented 6 years ago

Might be this one could help: https://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/550846?USB-3-port-file-copy-leads-to-kernel-Panic-with-Processor-SDK There are 3 patch files at the last comment.

Can't verify that as I don't know Linux architecture.