Results 1 to 6 of 6

Thread: Laptop shuts down on undock when lid is closed

  1. #1
    Join Date
    Jul 2024
    Beans
    4

    Laptop shuts down on undock when lid is closed

    Hello!
    I've recently switched to Ubuntu 24.04 from Windows 11.

    I'm experiencing a weird bug though: When undocking (usb-c dock) while the lid is closed, the computer shuts down (not hibernate, it really shuts down).
    At most, it should go to sleep since that's what it does if I close the lid while undocked.

    If I close the lid while unplugged, it sleeps. If I close the lid while on power but not docked, it sleeps. If I close the lid while on power and docked (dock can't supply enough power through usb-c so I need external power) it does nothing except turn of the internal screen.
    So each individual state works, but the transition from docked to undocked with the lid closed for some reason causes a shutdown.

    This behaviour was not present on Windows so I don't believe it's a hardware issue.

    Laptop is a Lenovo Legion Slim 5, with AMD CPU+GPU and discrete Nvidia GPU.
    Ubuntu 24.04 LTS, kernel 6.8.0-36-generic.

    The problem seems similar to this kernel bug: https://bugzilla.kernel.org/show_bug.cgi?id=108801
    But not quite identical.

    I've tried looking at journalctl but it looks like it suspends properly and then suddenly boots:

    Code:
    jul 10 14:44:20 erik-Legion-Slim-5-16APH8 systemd[1]: nvidia-suspend.service: Deactivated successfully.
    jul 10 14:44:20 erik-Legion-Slim-5-16APH8 systemd[1]: Finished nvidia-suspend.service - NVIDIA system suspend actions.
    jul 10 14:44:20 erik-Legion-Slim-5-16APH8 systemd[1]: Starting systemd-suspend.service - System Suspend...
    jul 10 14:44:20 erik-Legion-Slim-5-16APH8 systemd-sleep[56233]: Performing sleep operation 'suspend'...
    jul 10 14:44:20 erik-Legion-Slim-5-16APH8 kernel: PM: suspend entry (s2idle)
    -- Boot d7aa4d044bb24d76957b76979ee67141 --
    jul 10 14:45:03 erik-Legion-Slim-5-16APH8 kernel: Linux version 6.8.0-36-generic (buildd@lcy02-amd64-077) (x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-23ubuntu4) 13.2.0, GNU ld (GNU Binutils for Ubuntu) 2.42)>
    jul 10 14:45:03 erik-Legion-Slim-5-16APH8 kernel: Command line: BOOT_IMAGE=/vmlinuz-6.8.0-36-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro quiet splash vt.handoff=7
    Anyone seen anything similar or know where I should look?

  2. #2
    Join Date
    Jun 2024
    Beans
    24
    Distro
    Ubuntu Development Release

    Re: Laptop shuts down on undock when lid is closed

    Have you tried changing your lid behavior? This thread could help: https://ubuntuforums.org/showthread.php?t=2475520

    Modify this file:

    /etc/systemd/logind.conf

    with nano or any editor.

    I found this article very helpful: https://fostips.com/lid-close-action...-21-04-laptop/
    Last edited by 0f4d0335; 1 Week Ago at 03:04 PM.

  3. #3
    Join Date
    May 2024
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Laptop shuts down on undock when lid is closed

    This script by Intel helps diagnose Linux sleep issues: https://github.com/intel/S0ixSelftes...lftest-tool.sh

  4. #4
    Join Date
    Jul 2024
    Beans
    4

    Re: Laptop shuts down on undock when lid is closed

    Quote Originally Posted by 0f4d0335 View Post
    Have you tried changing your lid behavior? This thread could help: https://ubuntuforums.org/showthread.php?t=2475520

    Modify this file:

    /etc/systemd/logind.conf

    with nano or any editor.

    I found this article very helpful: https://fostips.com/lid-close-action...-21-04-laptop/
    I've tried that already. But as I said the individual states work fine already!
    The laptop sleeps if I close the lid while undocked.
    The laptop does nothing (except turn of the internal screen) if I close the lid when docked.

    However, when going from docked to undocked with the lid closed causes it to shutdown. No setting in logind.conf says shutdown so I have no idea where it comes from.

  5. #5
    Join Date
    Jul 2024
    Beans
    4

    Re: Laptop shuts down on undock when lid is closed

    Quote Originally Posted by currentshaft View Post
    This script by Intel helps diagnose Linux sleep issues: https://github.com/intel/S0ixSelftes...lftest-tool.sh
    Is that supposed to work on AMD CPUs?

    I get a bunch of errors that I'm unsure if they are because I don't have Intel or something else:

    Code:
    root@erik-Legion-Slim-5-16APH8:/tmp# ./sleeptest.sh -s
    
    ---Check S2idle path S0ix Residency---:
    
    The system OS Kernel version is:
    Linux erik-Legion-Slim-5-16APH8 6.8.0-36-generic #36-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 10 10:49:14 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
    
    ---Check whether your system supports S0ix or not---:
    
    Low Power S0 Idle is:1
    Your system supports low power S0 idle capability.
    
    
    
    ---Check whether intel_pmc_core sysfs files exit---:
    ls: cannot access '/sys/kernel/debug/pmc_core': No such file or directory
    
    The pmc_core debug sysfs file is empty on your system.
    Isolation suggestions:     
    Please check whether intel_pmc_core driver is loaded.
    
    
    The intel_pmc_core sysfs missing will impact S0ix failure analyze.
    
    
    ---Judge PC10, S0ix residency available status---:
    cat: /sys/kernel/debug/pmc_core/substate_residencies: No such file or directory
    grep: /sys/kernel/debug/pmc_core/substate_residencies: No such file or directory
    Test system does not support S0ix.y substate
    
    The system failed to place S2idle entry command by turbostat,     
    please check if the suspend is failed or turbostat tool version is old     
    e.g. did you make turbostat tool executable or separately run S2idle command:     
    rtcwake -m freeze -s 15

  6. #6
    Join Date
    Jul 2024
    Beans
    4

    Re: Laptop shuts down on undock when lid is closed

    Okay, I got the Intel script to go further by symlinking turbostat to the local directory but I have no idea how to read the output.

    There were no obvious errors at least. Am I looking for anything in particular?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •