Lost USB connection between USB hard drive and Phicomm N1 after a whileMy N1 box lost connection to USB hard drive after a while, and dmesg
shows something like this:
12345 [ 1.000000] usb usb1-port1: disabled by hub (EMI?), re-enabling...[ 1.000000] usb 1-1: USB disconnect, device number 2[ 1.000000] print_req_error: I/O error, dev sda, sector 0[ 1.000000] sd 0:0:0:0: [sda] Synchronizing SCSI cache[ 1.100000] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00
I tried replacing my cable, moving the USB hard drive to somewhere electromagnetic signals are less, replacing the power adapter, use another N1 box, …, none of them worked.
After trial and error for several weeks, I moved my eyes to the device tree.
I found dwc3’s documentation, which led me further to usb-xhci’s.
I was not clear about those optional properties, and tried enabling some of them to see if it would make a change.
It turns out that Phicomm N1’s USB port seems to have a broken LPM implementation (or no hardware LPM at all?). By specifying optional property usb2-lpm-disable
, my box runs for about a day without errors with USB.
Not sure if it’s specific to N1 or an amlogic/S905D issue, though.
Update: It is said that most USB 3.0 devices indicate L1 support in their descriptor when they don’t support it. It might be because of the requirement for USB 3.0 devices to support LPM while operating in the 2.0 mode. That is, there’s a possibility that my USB hard drive’s LPM implementation is broken.
Here’s the diff of dtb.
123456789101112131415161718 --- a.dts 2018-01-01 00:00:00.000000000 +0000+++ b.dts 2018-01-01 00:00:00.000000000 +0000@@ -1334,14 +1334,15 @@ dwc3@c9000000 { compatible = "snps,dwc3"; reg = <0x0 0xc9000000 0x0 0x100000>; interrupts = <0x0 0x1e 0x4>; dr_mode = "host"; maximum-speed = "high-speed"; snps,dis_u2_susphy_quirk;+ usb2-lpm-disable; phys = <0x30 0x31 0x32>; }; }; }; aliases { serial0 = "/soc/bus@c8100000/serial@4c0";
Here is the dtb with the patch above: meson-gxl-s905d-phicomm-n1-usbfix.zip. Patched upon yangxuan8282‘s meson-gxl-s905d-phicomm-n1.dtb (which disables EEE of NIC), credits to him.
btw, IIRC my first SSD also had a broken LPM implementation, freezing my whole system after running a while..
My N1 box lost connection to USB hard drive after a while, and dmesg
shows something like this:
1 2 3 4 5 | [ 1.000000] usb usb1-port1: disabled by hub (EMI?), re-enabling... [ 1.000000] usb 1-1: USB disconnect, device number 2 [ 1.000000] print_req_error: I/O error, dev sda, sector 0 [ 1.000000] sd 0:0:0:0: [sda] Synchronizing SCSI cache [ 1.100000] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=0x07 driverbyte=0x00 |
I tried replacing my cable, moving the USB hard drive to somewhere electromagnetic signals are less, replacing the power adapter, use another N1 box, …, none of them worked.
After trial and error for several weeks, I moved my eyes to the device tree.
I found dwc3’s documentation, which led me further to usb-xhci’s.
I was not clear about those optional properties, and tried enabling some of them to see if it would make a change.
It turns out that Phicomm N1’s USB port seems to have a broken LPM implementation (or no hardware LPM at all?). By specifying optional property usb2-lpm-disable
, my box runs for about a day without errors with USB.
Not sure if it’s specific to N1 or an amlogic/S905D issue, though.
Update: It is said that most USB 3.0 devices indicate L1 support in their descriptor when they don’t support it. It might be because of the requirement for USB 3.0 devices to support LPM while operating in the 2.0 mode. That is, there’s a possibility that my USB hard drive’s LPM implementation is broken.
Here’s the diff of dtb.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | --- a.dts 2018-01-01 00:00:00.000000000 +0000 +++ b.dts 2018-01-01 00:00:00.000000000 +0000 @@ -1334,14 +1334,15 @@ dwc3@c9000000 { compatible = "snps,dwc3"; reg = <0x0 0xc9000000 0x0 0x100000>; interrupts = <0x0 0x1e 0x4>; dr_mode = "host"; maximum-speed = "high-speed"; snps,dis_u2_susphy_quirk; + usb2-lpm-disable; phys = <0x30 0x31 0x32>; }; }; }; aliases { serial0 = "/soc/bus@c8100000/serial@4c0"; |
Here is the dtb with the patch above: meson-gxl-s905d-phicomm-n1-usbfix.zip. Patched upon yangxuan8282‘s meson-gxl-s905d-phicomm-n1.dtb (which disables EEE of NIC), credits to him.
btw, IIRC my first SSD also had a broken LPM implementation, freezing my whole system after running a while..