suspected GPIO pin 18 causing s2idle to immediately wakeup from suspend on Lenovo AMD laptops
Brief summary of the problem:
Since Kernel 6.2.13 there is a high chance that s2idle would immediately wake up again. See log below for detail. As recent as Kernel 6.1.18, s2idle still worked reliably on this system. This has been observed on Lenovo Thinkpad T14 gen3 AMD, and strongly suspected on Lenovo Thinkpad T14s gen3 AMD as well.
Hardware description:
- amd_s2idle report: <TODO: When debugging a s2idle issue, please capture a log using amd_s2idle.py > s2idle_report-2023-05-02.txt
s2idle_report_2023-05-02_on_battery.txt
s2idle_report-2023-05-02_ac_success.txt
Debugging script for s2idle on AMD systems │
💻 LENOVO 21CRS0DG00 (ThinkPad T14s Gen 3) running BIOS 1.30 (R22ET60W (1.30 )) released 02/09/2│
023 │
🐧 Kernel 6.2.13-200.fc37.x86_64 │
🔋 Battery BAT0 (SMP failed to decode) is operating at 85.25% of design │
Checking prerequisites for s2idle │
🚦Logs are provided via dmesg, timestamps may not be accurate over multiple cycles │
✅ AMD Ryzen 7 PRO 6850U with Radeon Graphics (family 19 model 44) │
✅ LPS0 _DSM enabled │
✅ ACPI FADT supports Low-power S0 idle │
✅ HSMP driver `amd_hsmp` not detected (blocked: False) │
✅ PMC driver `amd_pmc` loaded (Program 4 Firmware 69.55.0) │
✅ USB4 driver `thunderbolt` loaded │
✅ GPU driver `amdgpu` available │
✅ System is configured for s2idle │
✅ NVME Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 (SSD 970 EVO) is config│
ured for s2idle in BIOS │
✅ GPIO driver `pinctrl_amd` available │
GPIO dynamic debugging information unavailable │
✅ WCN6855 WLAN (fw version 0x110b196e) │
✅ WCN6855 WLAN (fw version 0x110b196e)
System information:
- Distro name and Version: Fedora Kinoite 37
- Kernel version: Linux 6.2.13-200.fc37.x86_64 #1 (closed) SMP PREEMPT_DYNAMIC Wed Apr 26 20:15:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
- Operating System: Fedora Linux 37
- KDE Plasma Version: 5.27.4
- KDE Frameworks Version: 5.105.0
- Qt Version: 5.15.9
- Kernel Version: 6.2.13-200.fc37.x86_64 (64-bit)
- Graphics Platform: Wayland
- Processors: 16 × AMD Ryzen 7 PRO 6850U with Radeon Graphics
- Memory: 14,4 GiB of RAM
- Graphics Processor: AMD Radeon Graphics
- Manufacturer: LENOVO
- Product Name: 21CRS0DG00
- System Version: ThinkPad T14s Gen 3
- kargs:
acpi.ec_no_wakeup=1 amd_pstate=passive quiet splash rw amdgpu.ppfeaturemask=0xfff7ffff
(ppfeaturemask was set to help workaround #1974 )`
How to reproduce the issue:
- suspend laptop by closing lid
- observe sign of initial success of s2idle (e.g. power led blinks instead of staying on)
- observe sign of system coming out of s2idle (e.g. power led stays on instead of blinks)
(kernel logs also confirms immediate wakeup from s2idle, not just the LED)
May 02 11:59:50 kernel: PM: suspend entry (s2idle)
May 02 11:59:50 kernel: Filesystems sync: 0.024 seconds
May 02 12:00:05 kernel: Freezing user space processes
May 02 12:00:05 kernel: Freezing user space processes completed (elapsed 0.008 seconds)
May 02 12:00:05 kernel: OOM killer disabled.
May 02 12:00:05 kernel: Freezing remaining freezable tasks
May 02 12:00:05 kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
May 02 12:00:05 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
May 02 12:00:05 kernel: ------------[ cut here ]------------
May 02 12:00:05 kernel: WARNING: CPU: 6 PID: 337912 at drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c:600 amdgpu_irq_put+0x45/0x70 [amdgpu]
May 02 12:00:05 kernel: Modules linked in: rfcomm bnep btusb btrtl btbcm btintel btmtk bluetooth michael_mic uinput snd_seq_dummy snd_hrtimer nf_conntrack_netbios_ns nf_conntrack_broadcast nf>
May 02 12:00:05 kernel: libarc4 kvm snd_rpl_pci_acp6x cfg80211 snd_seq_device snd_pci_acp6x think_lmi irqbypass snd_pci_acp5x snd_pcm firmware_attributes_class rapl snd_rn_pci_acp3x snd_acp_>
May 02 12:00:05 kernel: CPU: 6 PID: 337912 Comm: kworker/u32:3 Tainted: G W 6.2.13-200.fc37.x86_64 #1
May 02 12:00:05 kernel: Hardware name: LENOVO 21CRS0DG00/21CRS0DG00, BIOS R22ET60W (1.30 ) 02/09/2023
May 02 12:00:05 kernel: Workqueue: events_unbound async_run_entry_fn
May 02 12:00:05 kernel: RIP: 0010:amdgpu_irq_put+0x45/0x70 [amdgpu]
May 02 12:00:05 kernel: Code: 48 8b 4e 10 48 83 39 00 74 2c 89 d1 48 8d 04 88 8b 08 85 c9 74 14 f0 ff 08 b8 00 00 00 00 74 05 c3 cc cc cc cc e9 5b fd ff ff <0f> 0b b8 ea ff ff ff c3 cc cc cc >
May 02 12:00:05 kernel: RSP: 0018:ffffb64b22f97d50 EFLAGS: 00010246
May 02 12:00:05 kernel: RAX: ffff982f80c362d0 RBX: ffff982f90420000 RCX: 0000000000000000
May 02 12:00:05 kernel: RDX: 0000000000000000 RSI: ffff982f904224d8 RDI: ffff982f90420000
May 02 12:00:05 kernel: RBP: ffff982f90420000 R08: 0000000000100000 R09: 000000000033e300
May 02 12:00:05 kernel: R10: ffffb64b22f97c48 R11: 0000000000000000 R12: 0000000000001050
May 02 12:00:05 kernel: R13: ffff982f90438968 R14: ffffffffae923fb7 R15: ffff98312eb23b08
May 02 12:00:05 kernel: FS: 0000000000000000(0000) GS:ffff9832aef80000(0000) knlGS:0000000000000000
May 02 12:00:05 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
May 02 12:00:05 kernel: CR2: 00007f09f40029e6 CR3: 0000000355010000 CR4: 0000000000750ee0
May 02 12:00:05 kernel: PKRU: 55555554
May 02 12:00:05 kernel: Call Trace:
May 02 12:00:05 kernel: <TASK>
May 02 12:00:05 kernel: gmc_v10_0_hw_fini+0x46/0x80 [amdgpu]
May 02 12:00:05 kernel: gmc_v10_0_suspend+0xa/0x20 [amdgpu]
May 02 12:00:05 kernel: amdgpu_device_ip_suspend_phase2+0x101/0x1a0 [amdgpu]
May 02 12:00:05 kernel: amdgpu_device_suspend+0x10b/0x180 [amdgpu]
May 02 12:00:05 kernel: pci_pm_suspend+0x7b/0x170
May 02 12:00:05 kernel: ? __pfx_pci_pm_suspend+0x10/0x10
May 02 12:00:05 kernel: dpm_run_callback+0x8c/0x1e0
May 02 12:00:05 kernel: __device_suspend+0x10a/0x560
May 02 12:00:05 kernel: async_suspend+0x1a/0x70
May 02 12:00:05 kernel: async_run_entry_fn+0x30/0x130
May 02 12:00:05 kernel: process_one_work+0x1c8/0x3c0
May 02 12:00:05 kernel: worker_thread+0x4d/0x380
May 02 12:00:05 kernel: ? _raw_spin_lock_irqsave+0x23/0x50
May 02 12:00:05 kernel: ? __pfx_worker_thread+0x10/0x10
May 02 12:00:05 kernel: kthread+0xe9/0x110
May 02 12:00:05 kernel: ? __pfx_kthread+0x10/0x10
May 02 12:00:05 kernel: ret_from_fork+0x2c/0x50
May 02 12:00:05 kernel: </TASK>
May 02 12:00:05 kernel: ---[ end trace 0000000000000000 ]---
May 02 12:00:05 kernel: PM: suspend devices took 0.336 seconds
May 02 12:00:05 kernel: ACPI: EC: interrupt blocked
May 02 12:00:05 kernel: ACPI: EC: interrupt unblocked
May 02 12:00:05 kernel: [drm] PCIE GART of 1024M enabled (table at 0x000000F43FC00000).
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: SMU is resuming...
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: SMU is resumed successfully!
May 02 12:00:05 kernel: [drm] Watermarks table not configured properly by SMU
May 02 12:00:05 kernel: nvme nvme0: Shutdown timeout set to 8 seconds
May 02 12:00:05 kernel: nvme nvme0: 16/0/0 default/read/poll queues
May 02 12:00:05 kernel: [drm] VCN decode and encode initialized successfully(under DPG Mode).
May 02 12:00:05 kernel: [drm] JPEG decode initialized successfully.
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 5 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 6 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 7 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 8 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 9 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 10 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring kiq_2.1.0 uses VM inv eng 11 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring vcn_dec_0 uses VM inv eng 0 on hub 1
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring vcn_enc_0.0 uses VM inv eng 1 on hub 1
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring vcn_enc_0.1 uses VM inv eng 4 on hub 1
May 02 12:00:05 kernel: amdgpu 0000:33:00.0: amdgpu: ring jpeg_dec uses VM inv eng 5 on hub 1
May 02 12:00:05 kernel: PM: resume devices took 0.225 seconds
May 02 12:00:05 kernel: OOM killer enabled.
May 02 12:00:05 kernel: Restarting tasks ... done.
May 02 12:00:05 kernel: random: crng reseeded on system resumption
May 02 12:00:05 kernel: PM: suspend exit
Edited by Ghost User