You are not logged in.

#1 2020-10-29 14:49:14

purzel
Member
Registered: 2012-01-05
Posts: 54

[SOLVED] Laptop kills all USB ports randomly

Hi all,

got a huawei matebook d14 and randomly all USB ports just turn off. Most annoyingly my mouse turns off, touchpad still works fine though. unplugging and replugging doesn't help.

I've cought dmesg output just when it happened but have very little idea what to make of it...

[23860.475229] usb usb1-port2: disabled by hub (EMI?), re-enabling...
[23860.475237] usb 1-2: USB disconnect, device number 13
[23860.784440] usb 1-2: new full-speed USB device number 14 using xhci_hcd
[23860.947242] usb 1-2: New USB device found, idVendor=046d, idProduct=c245, bcdDevice=69.00
[23860.947248] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[23860.947251] usb 1-2: Product: Gaming Mouse G400
[23860.947253] usb 1-2: Manufacturer: Logitech
[23860.962712] input: Logitech Gaming Mouse G400 as /devices/pci0000:00/0000:00:08.1/0000:03:00.3/usb1/1-2/1-2:1.0/0003:046D:C245.0015/input/input27
[23860.962986] hid-generic 0003:046D:C245.0015: input,hidraw0: USB HID v1.10 Mouse [Logitech Gaming Mouse G400] on usb-0000:03:00.3-2/input0
[23860.967996] hid-generic 0003:046D:C245.0016: hiddev0,hidraw1: USB HID v1.10 Device [Logitech Gaming Mouse G400] on usb-0000:03:00.3-2/input1
[24588.556802] perf: interrupt took too long (3136 > 3127), lowering kernel.perf_event_max_sample_rate to 63600
[29046.563216] usb 1-2: USB disconnect, device number 14
[29051.717786] xhci_hcd 0000:03:00.3: xHCI host not responding to stop endpoint command.
[29051.717791] xhci_hcd 0000:03:00.3: USBSTS:
[29051.729632] xhci_hcd 0000:03:00.3: xHCI host controller not responding, assume dead
[29051.729642] xhci_hcd 0000:03:00.3: HC died; cleaning up
[29051.788020] usb 1-3: USB disconnect, device number 5
[29051.788443] blk_update_request: I/O error, dev sda, sector 128 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[29051.788447] Buffer I/O error on dev sda1, logical block 0, lost async page write
[29051.809220] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[29051.809270] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[29051.831654] usb 1-4: USB disconnect, device number 3

Last edited by purzel (2020-11-27 14:43:15)

Offline

#2 2020-10-29 14:52:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: [SOLVED] Laptop kills all USB ports randomly

Sounds similar to https://bbs.archlinux.org/viewtopic.php?id=260179, disable usb autosuspend, if you use TLP or laptop-mode-tools or so blacklist the controller that's currently dying from the autosuspend

Last edited by V1del (2020-10-29 14:53:35)

Offline

#3 2020-10-29 15:04:21

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Checked, I have tlp installed but is not loaded by systemctl and disabled via tlpui anyway. I also checked powertop and USB autosuspend is set to "bad".

I played around with USB autosuspend via powertop before which will disable the mouse within 5 seconds or so, however it will restart on button-press.

Offline

#4 2020-10-29 15:10:19

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: [SOLVED] Laptop kills all USB ports randomly

https://wiki.archlinux.org/index.php/Po … utosuspend load the usbcore module pass -1 to the autosuspend option to be sure, can you reproduce this with another mouse?

Offline

#5 2020-10-29 15:52:47

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Hmm I can't figure out how to persistently set autosuspend to -1.

echo -1 >/sys/module/usbcore/parameters/autosuspend

This works, and I've generated /etc/modprobe.d/usb-autosuspend.conf and added the file to FILES in mkinitcpio.conf and mkinitcpio -p linux. But usbautosuspend is persistently 2.

Offline

#6 2020-10-29 15:56:51

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

Does it work if you append the parameter to the kernel commandline?

Otherwise it smells like something™ overrides it at runtime.
Something being some power management daemon.

Online

#7 2020-10-29 16:04:48

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Ha! Progress, yes it does.

Offline

#8 2020-10-29 16:10:34

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

Please post /etc/modprobe.d/usb-autosuspend.conf and check

lsinitcpio /boot/initramfs-linux.img | grep autosuspend

You maybe want to go for the modconf hook.

Online

#9 2020-10-29 16:42:23

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

$ cat  /etc/modprobe.d/usb-autosuspend.conf 
options usbcore autosuspend=-1

$ lsinitcpio /boot/initramfs-linux.img | grep autosuspend
etc/modprobe.d/usb-autosuspend.conf

$ cat /etc/mkinitcpio.conf 
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=(/etc/modprobe.d/usb-autosuspend.conf)

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

To use the hook, do I just add usbcore to the list?

Offline

#10 2020-10-29 17:05:36

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

HOOKS=(base udev autodetect modconf block filesystems keyboard fsck)

The hook is actually active.

Also the config file is there - do you use a boot partition and maybe forgot to boot it?
(Or boot a different kernel, lts, zen, …)?

Online

#11 2020-10-29 17:13:57

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

No separate boot partition, I used linux-ck for a while but am now back to "standard".

uname -r
5.9.1-arch1-1

Offline

#12 2020-10-29 18:00:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,422

Re: [SOLVED] Laptop kills all USB ports randomly

Can't this also be the case/necessary to use the kernel param method if the module is builtin? Wasn't on my Arch until now so only  had a vague feeling but...

modinfo usbcore
name:           usbcore
filename:       (builtin)
license:        GPL
file:           drivers/usb/core/usbcore
parm:           quirks:Add/modify USB quirks by specifying quirks=vendorID:productID:quirks
parm:           usbfs_snoop:true to log all usbfs traffic (bool)
parm:           usbfs_snoop_max:maximum number of bytes to print while snooping (uint)
parm:           usbfs_memory_mb:maximum MB allowed for usbfs buffers (0 = no limit) (uint)
parm:           authorized_default:Default USB device authorization: 0 is not authorized, 1 is authorized, 2 is authorized for internal devices, -1 is authorized except for wireless USB (default, old behaviour) (int)
parm:           blinkenlights:true to cycle leds on hubs (bool)
parm:           initial_descriptor_timeout:initial 64-byte descriptor request timeout in milliseconds (default 5000 - 5.0 seconds) (int)
parm:           old_scheme_first:start with the old device initialization scheme (bool)
parm:           use_both_schemes:try the other device initialization scheme if the first one fails (bool)
parm:           nousb:bool
parm:           autosuspend:default autosuspend delay (int)

Offline

#13 2020-10-29 20:41:44

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

Yup and indeed it's built-in. Apparently since some years now…
https://raw.githubusercontent.com/torva … meters.rst

Parameters for modules which are built into the kernel need to be specified on the kernel command line.

Online

#14 2020-10-30 10:00:31

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Hm ok, I've added the option to the kernel commandline (which works). And I'll check if the error returns. It usually only happens about once a week so it might be some time to check if this fixes it.

Thanks!

Offline

#15 2020-10-30 13:36:37

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Nope, that wasn't it.

[12890.635443] usb usb1-port3: disabled by hub (EMI?), re-enabling...
[12890.635450] usb 1-3: USB disconnect, device number 2
[12890.955780] usb 1-3: new full-speed USB device number 4 using xhci_hcd
[12901.181632] xhci_hcd 0000:03:00.3: xHCI host not responding to stop endpoint command.
[12901.181637] xhci_hcd 0000:03:00.3: USBSTS:
[12901.193443] xhci_hcd 0000:03:00.3: xHCI host controller not responding, assume dead
[12901.193451] xhci_hcd 0000:03:00.3: HC died; cleaning up
[12901.193580] usb usb1-port3: couldn't allocate usb_device
[12901.193595] usb 1-4: USB disconnect, device number 3

I don't have a second mouse, but tried plugging in a USB thumb drive to no effect in either dmesg or lsusb.

Offline

#16 2020-10-30 14:12:25

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] Laptop kills all USB ports randomly

That the port is is being disabled by the hub sounds more like a hardware issue.  The kernel is reenabling and suggesting that the cause may me electromagnetic interference (EMI).  It sounds like there is noise on the port and the hub is shutting it down as the noise does not represent anything in the USB protocol.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#17 2020-10-30 14:40:16

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Well poop. Guess it's a warranty thing then.

Offline

#18 2020-10-30 15:02:45

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

What is usually on that hub?

lsusb -tv

Online

#19 2020-10-30 15:09:26

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 10000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 1: Dev 2, If 0, Class=Communications, Driver=, 12M
        ID 27c6:5110 Shenzhen Goodix Technology Co.,Ltd. 
    |__ Port 1: Dev 2, If 1, Class=CDC Data, Driver=, 12M
        ID 27c6:5110 Shenzhen Goodix Technology Co.,Ltd. 
    |__ Port 2: Dev 3, If 0, Class=Wireless, Driver=btusb, 12M
        ID 1358:c123  
    |__ Port 2: Dev 3, If 1, Class=Wireless, Driver=btusb, 12M
        ID 1358:c123  
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 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 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c245 Logitech, Inc. G400 Optical Mouse
    |__ Port 3: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c245 Logitech, Inc. G400 Optical Mouse
    |__ Port 4: Dev 3, If 1, Class=Video, Driver=uvcvideo, 480M
        ID 13d3:56f8 IMC Networks 
    |__ Port 4: Dev 3, If 0, Class=Video, Driver=uvcvideo, 480M
        ID 13d3:56f8 IMC Networks 

Offline

#20 2020-10-30 17:11:57

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

/:  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 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c245 Logitech, Inc. G400 Optical Mouse
    |__ Port 3: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        ID 046d:c245 Logitech, Inc. G400 Optical Mouse

Does it happen w/ a replacement rodent?

Online

#21 2020-10-30 19:28:03

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

Don't have one, but with anything else plugged in the port stays inactive, nothing new shows up in either dmesg or lsusb.

Offline

#22 2020-10-30 20:05:56

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

After the error or after a reboot?
You'd want to go w/o the mouse (but optionally some other device, those are different tests) from a cold boot to test the hub in a defined state.

Online

#23 2020-10-30 20:15:32

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

After the error! After a reboot, everything is back to normal.

You mean unplug the mouse and use a thumb drive and see if the port shuts down with a thumb drive and not the mouse? (Suspecting the mouse to kill the port?)

Offline

#24 2020-10-30 20:18:45

seth
Member
Registered: 2012-09-03
Posts: 49,969

Re: [SOLVED] Laptop kills all USB ports randomly

purzel wrote:

You mean unplug the mouse and use a thumb drive and see if the port shuts down with a thumb drive and not the mouse? (Suspecting the mouse to kill the port?)

Yup. (Also w/o the thumb drive - to differentiate between the mouse and "something")

Online

#25 2020-10-30 20:29:44

purzel
Member
Registered: 2012-01-05
Posts: 54

Re: [SOLVED] Laptop kills all USB ports randomly

I'll give it a try.

Offline

Board footer

Powered by FluxBB