Session deadlocks itself when external monitor is connected during standby

I am encountering a strange behavior with my laptop and my external monitor, which happens to have a docking station built in, so I connect it via USB-C to my laptop and use the mouse and keyboard that are connected to the docking station. The problem is, that when my laptop is in standby, I connect it to my external monitor and switch it on (in that order) the previous session doesn’t come up, but I have to manually unlock the session to get it working again.

Steps to reproduce:

  1. Have a laptop and put it in standby by closing the lid.
  2. Plug an external monitor or docking station in.
  3. Power on the laptop and leave the lid closed.

Expected behavior:
My desktop (or unlock password prompt) appears on the external monitor and I can use my laptop as normal.

Actual behavior:
The screen stays black, no prompt and no desktop appears. After a while the message on the attached image appears and forces me to manually unlock my session in a console.

I am running Kernel 6.2.8-1 and I am on the stable channel. I applied today’s stable update, so I am running KDE Plasma 5.27 LTS. I had this behavior before on Plasma 5.26 but I hoped that 5.27 would fix it. It didn’t.

Any suggestions?

inxi:

System:
  Kernel: 6.2.8-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.1
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-6.2-x86_64
    root=UUID=bd4700ef-c0e6-4481-bd1a-2709e1b4dd1f rw rootflags=subvol=@
    quiet splash resume=UUID=9da6751d-15f6-43a1-88f6-ffb35d2e4359
    udev.log_priority=3
  Desktop: KDE Plasma v: 5.27.3 tk: Qt v: 5.15.8 info: latte-dock
    wm: kwin_wayland vt: 2 dm: SDDM Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 20QD0037GE v: ThinkPad X1 Carbon 7th
    serial: <superuser required> Chassis: type: 10 serial: <superuser required>
  Mobo: LENOVO model: 20QD0037GE v: SDK0J40697 WIN
    serial: <superuser required> UEFI: LENOVO v: N2HET68W (1.51 )
    date: 03/22/2022
Battery:
  ID-1: BAT0 charge: 52.0 Wh (100.0%) condition: 52.0/51.0 Wh (101.9%)
    volts: 17.4 min: 15.4 model: LGC 02DL004 type: Li-poly serial: <filter>
    status: charging cycles: 381
CPU:
  Info: model: Intel Core i7-8565U bits: 64 type: MT MCP
    arch: Comet/Whiskey Lake note: check gen: core 8 level: v3 note: check
    built: 2018 process: Intel 14nm family: 6 model-id: 0x8E (142)
    stepping: 0xC (12) microcode: 0xF4
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
    L3: 8 MiB desc: 1x8 MiB
  Speed (MHz): avg: 684 high: 700 min/max: 400/4600 scaling:
    driver: intel_pstate governor: powersave cores: 1: 700 2: 700 3: 643 4: 634
    5: 700 6: 700 7: 700 8: 700 bogomips: 32012
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: Enhanced IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB
    filling, PBRSB-eIBRS: SW sequence
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Lenovo
    driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm built: 2016-20
    ports: active: DP-1 off: eDP-1 empty: DP-2,HDMI-A-1 bus-ID: 00:02.0
    chip-ID: 8086:3ea0 class-ID: 0300
  Device-2: Dell Webcam WB7022 type: USB driver: uvcvideo
    bus-ID: 2-2.2.2.1.1:31 chip-ID: 413c:c015 class-ID: 0e02 serial: <filter>
  Device-3: Chicony Integrated Camera type: USB driver: uvcvideo
    bus-ID: 2-8:2 chip-ID: 04f2:b67c class-ID: 0e02 serial: <filter>
  Display: wayland server: X.org v: 1.21.1.8 with: Xwayland v: 23.1.0
    compositor: kwin_wayland driver: X: loaded: modesetting
    alternate: fbdev,vesa dri: iris gpu: i915 display-ID: 0
  Monitor-1: DP-1 res: 3840x1600 size: N/A modes: N/A
  API: OpenGL v: 4.6 Mesa 23.0.1 renderer: Mesa Intel UHD Graphics 620 (WHL
    GT2) direct-render: Yes
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo
    driver: sof-audio-pci-intel-cnl alternate: snd_hda_intel, snd_soc_skl,
    snd_sof_pci_intel_cnl bus-ID: 00:1f.3 chip-ID: 8086:9dc8 class-ID: 0403
  API: ALSA v: k6.2.8-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsamixer,amixer
  Server-1: PipeWire v: 0.3.67 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:9df0 class-ID: 0280
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: kernel
    port: N/A bus-ID: 00:1f.6 chip-ID: 8086:15be class-ID: 0200
  IF: enp0s31f6 state: down mac: <filter>
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152
    bus-ID: 2-2.1:21 chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
  IF: enp0s20f0u2u1 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: wwan0 state: down mac: N/A
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 2-10:4 chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends
Drives:
  Local Storage: total: 476.94 GiB used: 49.86 GiB (10.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital model: PC SN730
    SDBQNTY-512G-1001 size: 476.94 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: 11170101 temp: 37.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 459.8 GiB size: 459.8 GiB (100.00%)
    used: 49.67 GiB (10.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 608 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 459.8 GiB size: 459.8 GiB (100.00%)
    used: 49.67 GiB (10.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 459.8 GiB size: 459.8 GiB (100.00%)
    used: 49.67 GiB (10.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 16.84 GiB used: 195.5 MiB (1.1%)
    priority: -2 dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
  System Temperatures: cpu: 48.0 C pch: 53.0 C mobo: N/A
  Fan Speeds (RPM): fan-1: 0
Info:
  Processes: 273 Uptime: 5h 6m wakeups: 179 Memory: 15.31 GiB
  used: 5.09 GiB (33.3%) Init: systemd v: 252 default: graphical
  tool: systemctl Compilers: gcc: 12.2.1 clang: 15.0.7 Packages: pm: pacman
  pkgs: 1217 libs: 357 tools: pamac pm: flatpak pkgs: 0 Shell: Zsh v: 5.9
  default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.26

Does this occur under x11 session too with kwin_x11 ?
Did you try to connect you external monitor before the session is locked or standby?
Is your Desktop Session settings set to Start with empty session or something else?

image

On X11, the session does not deadlock, but the login screen doesn’t appear on my external monitor either. It appears on my laptop’s screen which is closed at that point.

When I am already logged in an acrtive session, everything works as expected.

What comes to my mind, could this be an SDDM issue? I did a little bit of research and is seems that it struggles with changing monitor configurations.

On the fly and from sleep, most likely …