You are not logged in.
Hello everyone,
I'm experiencing an issue with my Lenovo ThinkPad (AMD processor), and I'm hoping someone might have a solution.
Problem Summary:
- Scenario: When I manually suspend the notebook while the dock is connected, the suspend process starts, but the notebook wakes up immediately.
- Condition: This issue occurs only when the dock is connected. If the dock is disconnected, the notebook suspends and stays suspended as expected.
System Details:
- Laptop: Lenovo ThinkPad with AMD processor
- Docking Station: Dell Thunderbolt Dock
- External Keyboard: Keychron C1 connected via the dock
- Kernel Version: 6.10.11
What I've Tried:
1. Checked dmesg Output:
Relevant message:
[18422.916489] amd_pmc AMDI0009:00: Last suspend didn't reach deepest state
2. Investigated ACPI Wakeup Devices:
Output of
cat /proc/acpi/wakeupshows several devices enabled, including
XHC0, XHC1, XHC3, NHI1, XHC4, LID, and SLPB3. Identified the Culprit:
- Through bisecting, I discovered that the device
NHI1 (Thunderbolt controller) is causing the immediate wake-ups.
- Disabling wakeup for
NHI1prevents the unwanted wake-ups after suspend.
4. Modified Wakeup Settings:
I have a configuration file at
/etc/tmpfiles.d/docking-station-wakeup.conf
# /etc/tmpfiles.d/docking-station-wakeup.conf
# Enable wakeup for the main Thunderbolt controller.
w /sys/bus/thunderbolt/devices/0-0/power/wakeup - - - - enabled
# Enable wakeup for USB4 port 2 on the Thunderbolt controller.
w /sys/bus/thunderbolt/devices/0-0/usb4_port2/power/wakeup - - - - enabled
# Enable wakeup for USB devices connected through the dock.
w /sys/bus/usb/devices/7-1/power/wakeup - - - - enabled
w /sys/bus/usb/devices/7-1/7-1.3/power/wakeup - - - - enabled
w /sys/bus/usb/devices/7-1/7-1.3/7-1.3.3/power/wakeup - - - - enabled
# Enable wakeup for the Thunderbolt PCI bridge device.
w /sys/bus/pci/devices/0000:00:08.3/power/wakeup - - - - enabled
The last four allow the external keyboard waking up the notebook if I suspend it without disconnecting the dock before waking it up again.
The first two lines allow waking up the notebook upon dock connection if I suspend the notebook and then disconnect the dock (to use it with another notebook).
Outcome:
- If I disable wakeup for the Thunderbolt controller (`0-0`) and USB4 port, the notebook doesn't wake immediately after suspend. However, my external keyboard can't wake the notebook if the dock was reconnected while the notebook was asleep.
- If I enable wakeup for the Thunderbolt controller, the notebook wakes up immediately after I manually suspend when the dock is connected. (This happens only the first time I try to put it asleep, the second time I put it at sleep the process completes).
Constraints:
- I can't use the built-in keyboard or power button to wake the notebook because the lid is closed, and the power button is inaccessible.
- I have multiple notebooks, and I prefer to keep the keyboard connected to the dock for convenience.
Question:
Is there a way to configure the system so that the notebook doesn't wake immediately upon manual suspend when the dock is connected, but still allows the external keyboard to wake it after reconnection? I'm looking for a solution that accommodates the closed lid and doesn't require accessing the notebook's built-in controls.
Any insights or suggestions would be greatly appreciated!
Thank you in advance for your help.
Last edited by simgunz (2024-10-05 17:26:16)
Offline
It seems I manged to fix my own problem (as usual just after asking for help).
This is the updated config file
# /etc/tmpfiles.d/docking-station-wakeup.conf
# Disable wakeup for NHI1, which is the Thunderbolt controller responsible for immediate wake-ups.
# This controller handles Thunderbolt connectivity, and disabling it prevents unwanted wake events.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.6/power/wakeup
w /sys/bus/pci/devices/0000:66:00.6/power/wakeup - - - - disabled
# Enable wakeup for the Thunderbolt PCI bridge device.
# This device manages internal Thunderbolt connections for the dock and allows peripherals connected through Thunderbolt to wake the notebook.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/power/wakeup
w /sys/bus/pci/devices/0000:00:08.3/power/wakeup - - - - enabled
# Enable wakeup for the USB controller integrated into the notebook.
# This controller is responsible for managing USB ports used by the dock, allowing connected USB devices to wake the system.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/power/wakeup
w /sys/bus/pci/devices/0000:66:00.4/power/wakeup - - - - enabled
# Enable wakeup for the USB hub managed by the kernel driver that controls USB connections via Thunderbolt.
# This driver allows the USB hub functionality within the dock to wake the notebook when a connected device initiates activity.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/usb7/power/wakeup
w /sys/bus/usb/devices/usb7/power/wakeup - - - - enabled
# Enable wakeup for the USB hub on port 7-1, which represents the docking station.
# This setting ensures that the docking station itself can wake the system, allowing USB devices connected to the dock to trigger a wake event.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/usb7/7-1/power/wakeup
w /sys/bus/usb/devices/7-1/power/wakeup - - - - enabled
# Enable wakeup for the USB hub connected through sub-port 7-1.3 on the docking station.
# This sub-port allows for cascading USB devices (such as hubs or additional devices connected through the dock) to wake the system.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/usb7/7-1/7-1.3/power/wakeup
w /sys/bus/usb/devices/7-1/7-1.3/power/wakeup - - - - enabled
# Enable wakeup external keyboard connected to the docking station.
# The keyboard is plugged into the upper USB port on the dock (near the power cable), and enabling wakeup allows the keyboard to wake the notebook from suspend.
# Real path: /sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/usb7/7-1/7-1.3/7-1.3.3/power/wakeup
w /sys/bus/usb/devices/7-1/7-1.3/7-1.3.3/power/wakeup - - - - enabledBasically I was missing some rules to enable the wakeup of devices in the middle of the chain
/sys/devices/pci0000:00/0000:00:08.3/0000:66:00.4/usb7/7-1/7-1.3/7-1.3.3/power/wakeup If a single one is not enabled, the wakeup of the leaf device is ignored.
With this fix I don't need the wakeup on the thuderbolt device
/sys/devices/pci0000:00/0000:00:08.3/0000:66:00.6/, which is the one causing all the issues (instant wakeup).
Offline