Framework crashes during Ubuntu shutdown when USB Hub is connected

Which Linux distro are you using?

Ubuntu

Which release version?
24.04LTS

Which kernel are you using?

6.8

Which BIOS version are you using?

3.08

Which Framework Laptop 13 model are you using? (AMD Ryzen™ AI 300 Series, AMD Ryzen™ 7040 Series, Intel® Core™ Ultra Series 1, 13th Gen Intel® Core™ , 12th Gen Intel® Core™, 11th Gen Intel® Core™)

13th Gen Intel Core

My Framework laptop works properly on Windows 11. With Ubuntu the system crashes during system shutdown if it is connected via USB-C to my Anker USB Hub 11-in-1 Model 565. Today, I replaced it with another USB-C Hub from Ugreen, unfortunately with the same problem.

It does not matter whether USB PD is active via the Framework power adapter plugged into the USB-C hub or not. What might be the reason for the crash?

I just figured out one interesting thing: The crash only occurs if my two monitors are connected to the USB-C hub via HDMI and my keyboard/mouse. After I clicked the shutdown button in Ubuntu first everything seems to work, the spinner appears, then the two displays switch off to energy saving mode. But then, and this is very strange, suddenly the monitors switch on again and show the spinner. But then long time nothing happens, finally they switch off again and then after a lot of time the laptop’s screen is filled with a lot of text messages, but finally does not switch off.

As I mentioned, with Windows 11 everything is fine, the monitors switch once off and then the system powers off without hanging and without displays being reactivated during the system shutdown.

I found a solution in the meanwhile. :slight_smile:

At first it looked like the hub itself (Anker / Ugreen) was at fault, but testing showed that the issue only happened if my Eizo monitor with its integrated USB HID control was connected. With the hub alone (no monitors or keyboard/mouse attached), shutdown was clean.

Root Cause

The Eizo monitor exposes itself as a USB HID device (056d:0002 HID Monitor Controls) and advertise USB Remote Wakeup capability.

This caused Linux to leave the HID device “active” during poweroff.

As a result, the kernel hung for ~1 min or completely froze instead of shutting down.

Solution

The fix is to disable USB remote wakeup for the monitor HID devices at boot time.

Manual test

Run this once and then try shutting down:

for dev in /sys/bus/usb/devices/*; do
  if [ -f "$dev/idVendor" ] && [ -f "$dev/idProduct" ]; then
    if grep -q 056d "$dev/idVendor" && grep -q 0002 "$dev/idProduct"; then
      echo disabled | sudo tee "$dev/power/wakeup"
    fi
  fi
done

If shutdown works normally after this, the issue is confirmed.

Permanent fix with systemd

[Unit]
Description=Disable monitor HID Remote Wakeup
DefaultDependencies=no
Before=shutdown.target poweroff.target reboot.target suspend.target hibernate.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c '\
  for dev in /sys/bus/usb/devices/*; do \
    if [ -f "$dev/idVendor" ] && [ -f "$dev/idProduct" ]; then \
      # Replace 056d/0002 with your monitor’s vendor/product IDs
      if grep -q 056d "$dev/idVendor" && grep -q 0002 "$dev/idProduct"; then \
        echo disabled > "$dev/power/wakeup"; \
      fi; \
    fi; \
  done'

[Install]
WantedBy=multi-user.target

Then enable it:

sudo systemctl daemon-reexec
sudo systemctl enable disable-monitor-wakeup.service
sudo systemctl start disable-monitor-wakeup.service

How to adapt this for other monitors/devices

Run lsusb with your hub/monitors connected.

Identify the Vendor ID (idVendor) and Product ID (idProduct) of the suspicious HID device (often the monitor HID controls).

Replace 056d and 0002 in the script with your IDs.

Test again with the manual loop.

After applying this fix, my Framework laptop now shuts down cleanly with both monitors, keyboard, and mouse connected. Maybe this is helpful for others of you with the same trouble.