You are not logged in.

#1 2025-02-10 23:11:09

GOKOP
Member
Registered: 2018-04-29
Posts: 51

[SOLVED] Reload a kernel module that's built in?

So I've been having an issue where USB hubs on my KVMs die occasionally, and only resume working after a reboot. Reconnecting them doesn't help.
This appears in the dmesg log when it happens:

kernel: xhci_hcd 0000:0f:00.3: xHCI host not responding to stop endpoint command
xhci_hcd 0000:0f:00.3: xHCI host controller not responding, assume dead
xhci_hcd 0000:0f:00.3: HC died; cleaning up

From what I've found it may caused by the hubs misbehaving; but I don't consider buying new hardware a solution to a problem that can be solved in software.
A workaround I've found sufficient is that instead of rebooting the system, I can just reload the xhci_hcd module like so:

rmmod xhci_hcd
modprobe xhci_hcd

So I have a script running that greps dmesg for "xhci_hcd 0000:0f:00.3: HC died; cleaning up" and runs those commands when it founds that line.
Unfortunately it doesn't work anymore, because xhci_hcd is a built in module now so I can't rmmod it. I've postponed thinking about it until that change hits the LTS kernel and, well, it did.
So is there something else I can do to achieve the same effect?

Last edited by GOKOP (2025-02-12 10:41:32)

Offline

#2 2025-02-11 05:37:26

a7
Member
Registered: 2012-04-01
Posts: 27

Re: [SOLVED] Reload a kernel module that's built in?

Tomorrow is today huh?

I don't know of any way to 'unload' that portion of the kernel aside from removing the module.  As you know, its the point of a module. So your two options are a new kernel or a new device.

--- But this is undesirable behavior and I'm curious if its a hardware problem and if software could learn from it. 

Are you willing to share some details about the device and its logs?  I suspect a gremlin is burrowed between the KVM and handling of the USB host so some details of the virtual machine and the settings it runs at would be needed too.


- my nerd tuple is arch/systemd/ext4/nano/go/lurk

Offline

#3 2025-02-11 10:02:43

xerxes_
Member
Registered: 2018-04-29
Posts: 1,053

Re: [SOLVED] Reload a kernel module that's built in?

Post output of 'lsmod'.

Offline

#4 2025-02-11 10:17:58

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,142

Re: [SOLVED] Reload a kernel module that's built in?

You can unbind/rebind the corresponding PCI device, i.e. googling the thread title brings up: https://stackoverflow.com/questions/667 … nto-kernel does that not work?

@xerxes_ built-in modules won't show up there

Offline

#5 2025-02-11 11:22:18

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,951

Re: [SOLVED] Reload a kernel module that's built in?

A DDG search for 'xHCI host controller not responding, assume dead' lead to a thread on our forum where bind/unbind method was used to solve the issue.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#6 2025-02-11 22:15:15

GOKOP
Member
Registered: 2018-04-29
Posts: 51

Re: [SOLVED] Reload a kernel module that's built in?

@V1del @Lone_Wolf
Thanks, I didn't see this. It's exactly what I wanted

@a7 Unfortunately I'm not sure what device logs are you referring to.
I can add though that when researching the issue originally I've found a suggested solution to disable USB autosuspend, which I'm sure I've checked that it was disabled. But now I've checked again out of curiosity and I see that it isn't - I'll try properly disabling it and see if the problem reoccurs.

Offline

#7 2025-02-12 04:08:52

a7
Member
Registered: 2012-04-01
Posts: 27

Re: [SOLVED] Reload a kernel module that's built in?

GOKOP wrote:

@V1del @Lone_Wolf
Thanks, I didn't see this. It's exactly what I wanted

@a7 Unfortunately I'm not sure what device logs are you referring to.
I can add though that when researching the issue originally I've found a suggested solution to disable USB autosuspend, which I'm sure I've checked that it was disabled. But now I've checked again out of curiosity and I see that it isn't - I'll try properly disabling it and see if the problem reoccurs.

I was just looking for hints about how the USB devices went away but suspending is suspect for sure.  I wasn't aware of unbinding and rebinding in the kernel like that, so today I learned. Neat!


- my nerd tuple is arch/systemd/ext4/nano/go/lurk

Offline

#8 2025-02-12 10:21:07

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,093

Re: [SOLVED] Reload a kernel module that's built in?

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

#9 2025-02-12 10:41:41

GOKOP
Member
Registered: 2018-04-29
Posts: 51

Re: [SOLVED] Reload a kernel module that's built in?

Done

Offline

Board footer

Powered by FluxBB