1

I am trying to make a Lenovo Thinkpad P52 work with an Lenovo USB-C Hybrid Dock (40AF, see docks to avoid ...) on Linux Mint 20.3 Una a.k.a. Ubuntu 20.04. What a ... journey ...

The laptop has its /home folder sitting on a ZFS file system (zpool). The operating system itself runs on btrfs. Graphics are switched to dedicated (i.e. Nvidia) in the BIOS and driven by Nvidia's proprietary driver. The laptop's BIOS has been updated to the latest version beforehand to avoid bricking the mainboard in this kind of setup (really impressive BIOS bugs). Thunderbold security has been switched off in the BIOS as well. Interestingly, the dock does not show up when running boltctl list - although I had to disable Thunderbold security. I guess this is where the "hybrid" comes in. DisplayLink drivers have been installed from here. I should be ready to go.

When I boot the laptop with the dock disconnected, everything works fine. I can then plug the dock in once the computer is up and network plus USB on the dock are working as expected. (I am not yet far enough down the rabbit hole to trouble-shoot the display connection.)

When I boot with the dock plugged into the laptop, the boot hangs for about two minutes just before the login screen should appear. It usually shows a single line of console output, usually some error, but different ones every time (e.g. ucsi_acpi USBC000:00 con1 failed to register alternate modes or bluetooth hci0 setting interface failed (71)). I figure that those errors also happen without the dock - it's due to the hang that I can see them, I guess. When I wait for some timeout to pass, I am presented with the usual graphical login screen, though login attempts fail. This is when I discovered that my zpool was gone (every time when I booted with the dock connected), hence there was no user folder to log a user into. I switched to the command line (Ctrl+F1) and checked zpool status - nothing. A manual zpool import data, the contents of /home showed up again, back the the login screen (Ctrl+F7) and everything worked fine.

The timeout and the fact that my zpool is gone suggest some sort of error during kernel module loading or initialization, perhaps the order in which things happen - though I am not sure how to debug this or what is going on. Without the dock, everything works as expected.


I am troubleshooting this system for a visually impaired person. The whole point of the docking station is that there are fewer cables to connect/disconnect from the laptop. It's the general difficulty of plugging the cables in and out that has created my scenario. Therefore, it's a tough sell for me to say "just unplug the cable every time before you boot the machine even if you do not carry it with you" even if it's only this one cable.

s-m-e
  • 455
  • 6
  • 19

1 Answers1

2

ZFS pools are imported during boot via the zfs-import-cache.service service. This one failed in my case with result dependency.

Going through the dependencies, I found that systemd-udev-settle.service had failed beforehand, reporting Main process exited, code=exited, status=1/FAILURE and Failed with result 'exit-code'.

Because this only happens when the Dock is attached, I ended up looking at DisplayLink and related bugs. I found this gem. As it turns out, /opt/displaylink/udev.sh is called by the udev service and times out, which is sort of a known issue - no relationship to ZFS whatsoever, just an unfortunate chain of events. The issue has been known for over two years and remains unfixed in the DisplayLink drivers, though various packagers have hacked around it.

I applied this hack, i.e. starting the displaylink-driver service from within /opt/displaylink/udev.sh as follows: systemctl start --no-block displaylink-driver

I literally only added the --no-block parameter. This solves my problem and the external display attached to the docking station actually also works as expected.

s-m-e
  • 455
  • 6
  • 19