USBs not detected sometimes

Hi, I have an Asus ROG G513QC-HN126T laptop on which I dual boot Manjaro + KDE and Windows. It has 3 USB 3.0 ports, and occasionally on booting Manjaro, only one of them works, the other two don’t.

From looking into other posts, I tried checking the output of journalctl --follow. It shows the output when any USBs such as a mouse or keyboard are connected or disconnected from that one USB port that works, but there’s no output for the other two ports.

All 3 ports always work on Windows, and on Manjaro too this issue happens only sporadically. A hard reset was used to solve this issue earlier, but that doesn’t work anymore either. I have tried flipping through Kernels 5.15 to 5.18 (currently using) with no effect.

Here’s the output of inxi -Fxxxza:

System:
  Kernel: 5.18.12-3-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.18-x86_64
    root=UUID=13722ff1-558f-4b11-abcc-507d9928b5a0 rw amdgpu.runpm=0 quiet
    apparmor=1 security=apparmor
    resume=UUID=35a772f1-dd8a-4bb5-af20-44aa9c90cab8 udev.log_priority=3
  Desktop: KDE Plasma v: 5.24.6 tk: Qt v: 5.15.5 wm: kwin_x11 vt: 1
    dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Strix G513QC_G513QC v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: G513QC v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: G513QC.313 date: 03/29/2022
Battery:
  ID-1: BAT0 charge: 31.3 Wh (59.1%) condition: 53.0/56.0 Wh (94.7%)
    volts: 15.8 min: 15.9 model: AS3GWZC3KC G513-36 type: Li-ion
    serial: <filter> status: N/A
CPU:
  Info: model: AMD Ryzen 9 5900HX with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 4 built: 2021-22 process: TSMC n7 (7nm) family: 0x19 (25)
    model-id: 0x50 (80) stepping: 0 microcode: 0xA50000C
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 1232 high: 1387 min/max: 1200/4889 boost: enabled
    scaling: driver: acpi-cpufreq governor: ondemand cores: 1: 1133 2: 1135
    3: 1160 4: 1238 5: 1135 6: 1135 7: 1297 8: 1295 9: 1134 10: 1134 11: 1387
    12: 1353 13: 1295 14: 1297 15: 1295 16: 1295 bogomips: 105442
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GA107M [GeForce RTX 3050 Mobile] vendor: ASUSTeK
    driver: nvidia v: 515.57 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Ampere process: TSMC n7 (7nm)
    built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: 01:00.0 chip-ID: 10de:25a5
    class-ID: 0300
  Device-2: AMD Cezanne vendor: ASUSTeK driver: amdgpu v: kernel
    arch: GCN 5.1 process: TSMC n7 (7nm) built: 2018-21 pcie: gen: 3
    speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s ports:
    active: HDMI-A-1,eDP-1 empty: none bus-ID: 05:00.0 chip-ID: 1002:1638
    class-ID: 0300
  Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3
    compositor: kwin_x11 driver: X: loaded: amdgpu,nvidia
    unloaded: modesetting,nouveau alternate: fbdev,nv,vesa gpu: amdgpu
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 3286x1080 s-dpi: 96 s-size: 869x285mm (34.21x11.22")
    s-diag: 915mm (36.01")
  Monitor-1: HDMI-A-1 mapped: HDMI-A-0 pos: primary,left model: VGA
    serial: <filter> built: 2019 res: 1366x768 hz: 60 dpi: 77 gamma: 1.2
    size: 452x254mm (17.8x10") diag: 470mm (18.5") ratio: 16:9 modes:
    max: 1366x768 min: 720x400
  Monitor-2: eDP-1 mapped: eDP pos: primary,right
    model: Najing CEC Panda 0x004d built: 2019 res: 1920x1080 hz: 144 dpi: 142
    gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5") ratio: 16:9
    modes: max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD RENOIR (LLVM 14.0.6 DRM 3.46 5.18.12-3-MANJARO)
    v: 4.6 Mesa 22.1.3 direct render: Yes
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie:
    gen: 1 speed: 2.5 GT/s lanes: 8 link-max: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 01:00.1 chip-ID: 10de:2291 class-ID: 0403
  Device-2: AMD Renoir Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.1 chip-ID: 1002:1637
    class-ID: 0403
  Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK
    driver: N/A alternate: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x,
    snd_pci_acp6x, snd_acp_pci, snd_sof_amd_renoir
    pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s
    bus-ID: 05:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-4: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 05:00.6 chip-ID: 1022:15e3
    class-ID: 0403
  Sound Server-1: ALSA v: k5.18.12-3-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: no
  Sound Server-4: PipeWire v: 0.3.56 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: e000 bus-ID: 02:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp2s0 state: down mac: <filter>
  Device-2: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: AzureWave driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 03:00.0 chip-ID: 14c3:7961 class-ID: 0280
  IF: wlp3s0 state: up mac: <filter>
Drives:
  Local Storage: total: 953.87 GiB used: 784.49 GiB (82.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: MZVLQ1T0HBLB-00B00 size: 953.87 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: FXM7201Q temp: 35.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 97.5 GiB size: 95.41 GiB (97.86%) used: 83.89 GiB (87.9%)
    fs: ext4 dev: /dev/nvme0n1p7 maj-min: 259:7
  ID-2: /boot/efi raw-size: 512.7 MiB size: 511.7 MiB (99.80%)
    used: 292 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p5 maj-min: 259:5
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 2 GiB used: 707.9 MiB (34.6%)
    priority: -2 dev: /dev/nvme0n1p6 maj-min: 259:6
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 43.0 C
  Fan Speeds (RPM): cpu: 1900
Info:
  Processes: 357 Uptime: 1h 39m wakeups: 10 Memory: 15.04 GiB
  used: 4.09 GiB (27.2%) Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.1.0 clang: 14.0.6 Packages: pacman: 1396
  lib: 345 flatpak: 0 Shell: Zsh v: 5.9 running-in: yakuake inxi: 3.3.19

Any hints will be very appreciated :pray:

  1. Powersaving? → TLP
  2. Are the ports even listed? → lsusb -vt

Output of lsusb -vt when All USB ports are working:

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 12M
        ID 0a05:7211 Unknown Manufacturer hub
        |__ Port 2: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 1bcf:08a0 Sunplus Innovation Technology Inc. Gaming mouse [Philips SPK9304]
    |__ Port 2: Dev 5, If 1, Class=Vendor Specific Class, Driver=, 480M
        ID 22d9:2765 OPPO Electronics Corp. Oppo N1
    |__ Port 2: Dev 5, If 0, Class=Imaging, Driver=, 480M
        ID 22d9:2765 OPPO Electronics Corp. Oppo N1
    |__ Port 4: Dev 2, If 0, Class=Wireless, Driver=btusb, 480M
        ID 13d3:3563 IMC Networks
    |__ Port 4: Dev 2, If 1, Class=Wireless, Driver=btusb, 480M
        ID 13d3:3563 IMC Networks
    |__ Port 4: Dev 2, If 2, Class=Wireless, Driver=, 480M
        ID 13d3:3563 IMC Networks
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 0b05:1866 ASUSTek Computer, Inc.

Output of lsusb -vt when only one port is working and the other two aren’t:

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/4p, 12M
        ID 0a05:7211 Unknown Manufacturer hub
        |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
            ID 1bcf:08a0 Sunplus Innovation Technology Inc. Gaming mouse [Philips SPK9304]
    |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 0b05:1866 ASUSTek Computer, Inc.

I’m not sure about tlp, I just limit my laptop battery level to 60% through Advanced Power Settings, not sure what’s used by that.

That looks definitely like power saving, which doesn’t turn on properly again. Worth a try would be disabling autosuspend for usb by editing /etc/tlp.conf and switch from USB_AUTOSUSPEND=1 to USB_AUTOSUSPEND=0.