Problems with external monitor wake up after suspend

Since one of the latest manjaro updates I have problems with external monitor wakeup after suspend on Thinkpad X13 AMD Gen2 Notebook.

Notebook is in docking station. Suspend & Resume. The monitor gets no signal. After randomly typing Ctrl+Alt+Fn for switchung consoles the monitor at some point gets signal and is usable again.

I tried several kernels.

It works with:

  • 5.10.200
  • 5.15.138
  • 6.1.44
  • 6.1.55
  • 6.1.56

It doesn’t work with:

  • 6.1.57
  • 6.1.58
  • 6.1.60
  • 6.1.62
  • 6.5.11
  • 6.6.1

Any idea what else can be done or tried?

Don’t let the connection power off.

find -L /sys/class/drm/ -maxdepth 3 -type f \( -path "*/control" -or -path "*/enabled" \) -exec bash -c 'echo -e "{} -> $(cat "{}")" ' \; 2>/dev/null 

Then set the connection from auto to on. Example:

sudo bash -c 'echo "on" > /sys/class/drm/card1/card1-DP-0/power/control'

Now try to suspend and wake up. Should work now. Note that this is temporary and will not survive a reboot.

Also keep in mind that there is difference between AC and BC mode. When you suspend in BC mode, it will not automatically power on the connection, same for USB, only if explicitly set.

Usually the DE should trigger a wake up, but sometimes it doesn’t work properly.

On Kernel 6.5.11 I tried your suggestion

$ find -L /sys/class/drm/ -maxdepth 3 -type f \( -path "*/control" -or -path "*/enabled" \) -exec bash -c 'echo -e "{} -> $(cat "{}")" ' \; 2>/dev/null 
/sys/class/drm/renderD128/power/control -> on
/sys/class/drm/card1-DP-4/enabled -> disabled
/sys/class/drm/card1-DP-4/power/control -> on
/sys/class/drm/card1/card1-DP-4/enabled -> disabled
/sys/class/drm/card1/card1-HDMI-A-1/enabled -> disabled
/sys/class/drm/card1/card1-DP-2/enabled -> disabled
/sys/class/drm/card1/power/control -> on
/sys/class/drm/card1/card1-eDP-1/enabled -> disabled
/sys/class/drm/card1/card1-DP-5/enabled -> enabled
/sys/class/drm/card1/card1-DP-3/enabled -> disabled
/sys/class/drm/card1/card1-DP-1/enabled -> disabled
/sys/class/drm/card1-HDMI-A-1/enabled -> disabled
/sys/class/drm/card1-HDMI-A-1/power/control -> on
/sys/class/drm/card1-DP-2/enabled -> disabled
/sys/class/drm/card1-DP-2/power/control -> on
/sys/class/drm/card1-eDP-1/enabled -> disabled
/sys/class/drm/card1-eDP-1/power/control -> on
/sys/class/drm/card1-DP-5/enabled -> enabled
/sys/class/drm/card1-DP-5/power/control -> on
/sys/class/drm/card1-DP-3/enabled -> disabled
/sys/class/drm/card1-DP-3/power/control -> on
/sys/class/drm/card1-DP-1/enabled -> disabled
/sys/class/drm/card1-DP-1/power/control -> on

However it didn’t make any difference, the monitor does not get signal after resume from suspend :frowning:

P.S. I also tried Kernels 6.1.60 & 6.1.62 with above suggestion and with no difference, it still doesn’t work.

I tried some more kernels (see above, I updated the list in the initial post). The problem was introduced in kernel 6.1.57. It works on 6.1.56 and all tested kernels before and on no kernel after 6.1.56.

From Kernel 6.1.57 ChangeLog (https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.57):

commit 71472872932b11ca2591104eb73255fecaae9d33
Author: Wayne Lin <wayne.lin@amd.com>
Date:   Tue Aug 22 16:03:17 2023 +0800

    drm/amd/display: Adjust the MST resume flow
    
    commit ec5fa9fcdeca69edf7dab5ca3b2e0ceb1c08fe9a upstream.
    
    [Why]
    In drm_dp_mst_topology_mgr_resume() today, it will resume the
    mst branch to be ready handling mst mode and also consecutively do
    the mst topology probing. Which will cause the dirver have chance
    to fire hotplug event before restoring the old state. Then Userspace
    will react to the hotplug event based on a wrong state.
    
    [How]
    Adjust the mst resume flow as:
    1. set dpcd to resume mst branch status
    2. restore source old state
    3. Do mst resume topology probing
    
    For drm_dp_mst_topology_mgr_resume(), it's better to adjust it to
    pull out topology probing work into a 2nd part procedure of the mst
    resume. Will have a follow up patch in drm.

Could this be the relevant change?

The answer is “Yes”:

I was able to build a working kernel 6.1.57 using Manjaro’s PKGBUILD from https://gitlab.manjaro.org/packages/core/linux61 and reverted the changes from the kernel commit in drm/amd/display: Adjust the MST resume flow · torvalds/linux@ec5fa9f · GitHub in the file drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c.

With this modified 6.1.57 kernel, suspend and resume is working with the external monitor.

Is this a bug in the kernel introduced by commit ec5fa9f? How to deal with this? Could this be reported somehow to the kernel developers?

@osch Since the Manjaro Kernel is unmodified and has only a few patches, you can call it an upstream kernel. I would suggest reporting it to: https://bugzilla.kernel.org/

1 Like

OK, I reported it, see: 218211 – Thinkpad X13 AMD: Problems with external monitor wake up after suspend

1 Like

After updating the docking station’s firmware, the problem was solved :slight_smile:

It is a ThinkPad Ultra Dockingstation, part number 40AJ0135EU, see also ThinkPad Ultra Docking Station - Overview and Service Parts - Lenovo Support US

Firmware Update: ThinkPad Docking Station Firmware Utility v3.3.4 (cs18dkfw334_web.exe) from ThinkPad Basic Docking Station (40AG), Pro Docking Station (40AH), Ultra Docking Station (40AJ) Station Firmware Utility - Lenovo Support US

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.