5

I have some issues with USB3 flash drives in Ubuntu 16.04. They keep going into U1/U2 mode (see here for more information), occasionally resulting in I/O errors. I already disabled traditional (software-controlled) USB power management by putting this into /etc/rc.local (yes, it is redundant):

for i in /sys/bus/usb/devices/*/power/autosuspend_delay_ms;
    do echo -1 > $i;
done
for foo in /sys/bus/usb/devices/*/power/control;
    do echo on > $foo;
done

Also I tried the kernel boot option usbcore.autosuspend=-1. But according to dmesg, the flash drives still keep going into U1/U2 mode. The documentation says that USB3 LPM can be disabled using /sys/bus/usb/devices/.../(hub interface)/portX/usb3_lpm_permit but this file does not exist for any USB device on my computer, at least find /sys -iname "*usb3*" does not show it. What find does show are these read-only files:

/sys/devices/pci0000:00/0000:00:14.0/usb2/2-1/power/usb3_hardware_lpm_u1
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-1/power/usb3_hardware_lpm_u2
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/power/usb3_hardware_lpm_u1
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-2/power/usb3_hardware_lpm_u2
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/power/usb3_hardware_lpm_u1
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/power/usb3_hardware_lpm_u2
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/power/usb3_hardware_lpm_u1
/sys/devices/pci0000:00/0000:00:14.0/usb2/2-4/power/usb3_hardware_lpm_u2
/sys/devices/pci0000:00/0000:00:14.0/usb2/power/usb3_hardware_lpm_u1
/sys/devices/pci0000:00/0000:00:14.0/usb2/power/usb3_hardware_lpm_u2

the first eight contain the string "enabled", only the last two (the hub, I guess) say "disabled".

How can I override this and disable USB3 LPM for good, for all four devices? Writing to those files doesn't work, I tried.

Here is my system information: HP Chromebox

# lsusb
Bus 002 Device 009: ID 05dc:a838 Lexar Media, Inc. 
Bus 002 Device 006: ID 05dc:a838 Lexar Media, Inc. 
Bus 002 Device 010: ID 05dc:a838 Lexar Media, Inc. 
Bus 002 Device 008: ID 05dc:a838 Lexar Media, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0cf3:311e Atheros Communications, Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Kernel:

# uname -a
Linux FileserverA112 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# lspci -knn 00:00.0 Host bridge [0600]: Intel Corporation Haswell-ULT DRAM Controller [8086:0a04] (rev 0b) Subsystem: Google, Inc. Haswell-ULT DRAM Controller [1ae0:c000] Kernel driver in use: hsw_uncore 00:02.0 VGA compatible controller [0300]: Intel Corporation Haswell-ULT Integrated Graphics Controller [8086:0a06] (rev 0b) Subsystem: Google, Inc. Haswell-ULT Integrated Graphics Controller [1ae0:c000] Kernel driver in use: i915 Kernel modules: i915 00:03.0 Audio device [0403]: Intel Corporation Haswell-ULT HD Audio Controller [8086:0a0c] (rev 0b) Subsystem: Google, Inc. Haswell-ULT HD Audio Controller [1ae0:c000] Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel 00:14.0 USB controller [0c03]: Intel Corporation 8 Series USB xHCI HC [8086:9c31] (rev 04) Subsystem: Google, Inc. 8 Series USB xHCI HC [1ae0:c000] Kernel driver in use: xhci_hcd 00:16.0 Communication controller [0780]: Intel Corporation 8 Series HECI #0 [8086:9c3a] (rev 04) Subsystem: Google, Inc. 8 Series HECI [1ae0:c000] Kernel driver in use: mei_me Kernel modules: mei_me 00:1b.0 Audio device [0403]: Intel Corporation 8 Series HD Audio Controller [8086:9c20] (rev 04) Subsystem: Google, Inc. 8 Series HD Audio Controller [1ae0:c000] Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel 00:1c.0 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 3 [8086:9c14] (rev e4) Kernel driver in use: pcieport Kernel modules: shpchp 00:1c.1 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 4 [8086:9c16] (rev e4) Kernel driver in use: pcieport Kernel modules: shpchp 00:1c.2 PCI bridge [0604]: Intel Corporation 8 Series PCI Express Root Port 5 [8086:9c18] (rev e4) Kernel driver in use: pcieport Kernel modules: shpchp 00:1f.0 ISA bridge [0601]: Intel Corporation 8 Series LPC Controller [8086:9c45] (rev 04) Subsystem: Google, Inc. 8 Series LPC Controller [1ae0:c000] Kernel driver in use: lpc_ich Kernel modules: lpc_ich 00:1f.2 SATA controller [0106]: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] [8086:9c03] (rev 04) Subsystem: Google, Inc. 8 Series SATA Controller 1 [AHCI mode] [1ae0:c000] Kernel driver in use: ahci Kernel modules: ahci 00:1f.3 SMBus [0c05]: Intel Corporation 8 Series SMBus Controller [8086:9c22] (rev 04) Subsystem: Google, Inc. 8 Series SMBus Controller [1ae0:c000] Kernel modules: i2c_i801 00:1f.6 Signal processing controller [1180]: Intel Corporation 8 Series Thermal [8086:9c24] (rev 04) Subsystem: Google, Inc. 8 Series Thermal [1ae0:c000] 01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0c) Subsystem: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller [10ec:8168] Kernel driver in use: r8169 Kernel modules: r8169 02:00.0 Network controller [0280]: Qualcomm Atheros AR9462 Wireless Network Adapter [168c:0034] (rev 01) Subsystem: Hewlett-Packard Company AR9462 Wireless Network Adapter [103c:1864] Kernel driver in use: ath9k Kernel modules: ath9k

1 Answer 1

1

I know this is a really old question, but if anyone's still interested, I have a pointer to a decent workaround - although still not a full solution. Since this patch, Linux has a command line parameter called usbcore.quirks which can disable LPM on a per-device basis. So if you have a known list of devices (identified by their VID and PID, the pair of 4-digit hex numbers shown by lsusb) that you want to use without LPM, add the following kernel parameter to your bootloader:

usbcore.quirks=<vid1>:<pid1>:k,<vid2>:<pid2>,k

The k stands for disabling LPM, don't ask me why. You can list as many devices as you like. For the particular Lexar Media flash drive referenced by the question, add usbcore.quirks=05dc:a838:k - it will apply to all instances of the device.

1
  • Thank you for the useful follow-up! I was actually planning to dig out that old HP Chromebox again when the notification came.
    – ppq
    Mar 17, 2023 at 23:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .