NixOS loses ALL USB ports when undocked on Thinkpad T495

Thanks for the help, y’all! This has been the root of most of my struggles with my (decreasingly) new laptop.

I know we’re all working from home, but it’d be nice to move to the couch or something without having to restart everything to reactivate my USB ports. This includes the USB ports on the laptop itself, which become unresponsive after undocking.

I’m using the 40AJ docking station.

Here’s some hopefully relevant output:

uname -a
Linux nixos 5.4.51 #1-NixOS SMP Thu Jul 9 07:37:57 UTC 2020 x86_64 GNU/Linux

Here I undock and redock with udevadm monitor running. You can see way fewer things reconnecting than disconnecting. I had found an error during undocking in udevadm monitor but I can’t seem to find it this time around…

Please help! Thank you! <3

I began to write more about this this morning, and suddenly found that this is all power management related. USB devices are not detected on battery at all!

This led me to install TLP… and powertop… and…

Now it hardly works. I can undock/redock once but only if I have freshly modified powertop settings. but still only once. then I can reboot and do it again. once. and even still, it doesn’t seem reliable!

any help would be GREATLY appreciated!

Not sure how to help your specific issue, but I can say I have a 4800h laptop, and I’ve been having the USB3 Port I’m connected to completely die after a while. Sometimes it takes a few days, sometimes it’s a few hours. Eventually once all my USB ports die, I have to reboot. I believe it’s something bios/firmware related with my model, but I’m not sure yet. I have yet to dive into logs.