Dell Laptop Immediately wakes up from suspend. Dell wmi unknown key pressed

After it enters suspend and screen turns black, it wakes up immediately.

dmesg

[ 6291.925934] PM: suspend entry (s2idle)
[ 6291.951740] Filesystems sync: 0.023 seconds
[ 6291.979094] Freezing user space processes
[ 6291.980953] Freezing user space processes completed (elapsed 0.001 seconds)
[ 6291.980956] OOM killer disabled.
[ 6291.980957] Freezing remaining freezable tasks
[ 6291.982200] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 6291.982202] printk: Suspending console(s) (use no_console_suspend to debug)
[ 6292.250791] PM: suspend devices took 0.246 seconds
[ 6292.251741] ACPI: EC: interrupt blocked
[ 6292.423982] dell_wmi: Unknown key with type 0x0010 and code 0x0140 pressed
[ 6292.426922] dell_wmi: Unknown key with type 0x0010 and code 0x0140 pressed
[ 6293.137704] ACPI: EC: interrupt unblocked
[ 6293.146926] dell_wmi: Unknown key with type 0x0010 and code 0x0130 pressed
[ 6293.479176] [drm] PCIE GART of 1024M enabled.
[ 6293.479181] [drm] PTB located at 0x000000F417C00000
[ 6293.479199] amdgpu 0000:04:00.0: amdgpu: SMU is resuming...
[ 6293.480898] amdgpu 0000:04:00.0: amdgpu: dpm has been disabled
[ 6293.481685] amdgpu 0000:04:00.0: amdgpu: SMU is resumed successfully!
[ 6293.523231] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 6293.523672] [drm] JPEG decode initialized successfully.
[ 6293.523677] amdgpu 0000:04:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
[ 6293.523680] amdgpu 0000:04:00.0: amdgpu: ring gfx_low uses VM inv eng 1 on hub 0
[ 6293.523682] amdgpu 0000:04:00.0: amdgpu: ring gfx_high uses VM inv eng 4 on hub 0
[ 6293.523684] amdgpu 0000:04:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 5 on hub 0
[ 6293.523685] amdgpu 0000:04:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 6 on hub 0
[ 6293.523687] amdgpu 0000:04:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 7 on hub 0
[ 6293.523689] amdgpu 0000:04:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 8 on hub 0
[ 6293.523690] amdgpu 0000:04:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 9 on hub 0
[ 6293.523692] amdgpu 0000:04:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 10 on hub 0
[ 6293.523694] amdgpu 0000:04:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 11 on hub 0
[ 6293.523695] amdgpu 0000:04:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 12 on hub 0
[ 6293.523697] amdgpu 0000:04:00.0: amdgpu: ring kiq_0.2.1.0 uses VM inv eng 13 on hub 0
[ 6293.523699] amdgpu 0000:04:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 8
[ 6293.523701] amdgpu 0000:04:00.0: amdgpu: ring vcn_dec uses VM inv eng 1 on hub 8
[ 6293.523702] amdgpu 0000:04:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 4 on hub 8
[ 6293.523704] amdgpu 0000:04:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 5 on hub 8
[ 6293.523705] amdgpu 0000:04:00.0: amdgpu: ring jpeg_dec uses VM inv eng 6 on hub 8
[ 6293.638918] nvme nvme0: 16/0/0 default/read/poll queues
[ 6293.813589] ata2: SATA link down (SStatus 0 SControl 300)
[ 6293.813614] ata1: SATA link down (SStatus 0 SControl 300)
[ 6294.143466] PM: resume devices took 0.610 seconds
[ 6294.143733] OOM killer enabled.
[ 6294.143734] Restarting tasks ... done.
[ 6294.148364] random: crng reseeded on system resumption
[ 6294.151246] PM: suspend exit
[ 6298.067067] wlp3s0: authenticate with 5e:ed:f4:cf:65:88
[ 6298.067083] wlp3s0: 80 MHz not supported, disabling VHT
[ 6298.081437] wlp3s0: send auth to 5e:ed:f4:cf:65:88 (try 1/3)
[ 6298.114894] wlp3s0: authenticated
[ 6298.115812] wlp3s0: associate with 5e:ed:f4:cf:65:88 (try 1/3)
[ 6298.122788] wlp3s0: RX AssocResp from 5e:ed:f4:cf:65:88 (capab=0x1431 status=0 aid=9)
[ 6298.157621] wlp3s0: associated
[ 6648.467376] wlp3s0: deauthenticating from 5e:ed:f4:cf:65:88 by local choice (Reason: 3=DEAUTH_LEAVING)
[ 6652.897168] PM: suspend entry (s2idle)
[ 6652.927697] Filesystems sync: 0.027 seconds
[ 6652.958084] Freezing user space processes
[ 6652.960042] Freezing user space processes completed (elapsed 0.001 seconds)
[ 6652.960045] OOM killer disabled.
[ 6652.960046] Freezing remaining freezable tasks
[ 6652.961162] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[ 6652.961164] printk: Suspending console(s) (use no_console_suspend to debug)
[ 6653.242936] PM: suspend devices took 0.258 seconds
[ 6653.244067] ACPI: EC: interrupt blocked
[ 6653.420083] dell_wmi: Unknown key with type 0x0010 and code 0x0140 pressed
[ 6653.423023] dell_wmi: Unknown key with type 0x0010 and code 0x0140 pressed
[ 6654.131708] ACPI: EC: interrupt unblocked
[ 6654.140984] dell_wmi: Unknown key with type 0x0010 and code 0x0130 pressed
[ 6654.491879] [drm] PCIE GART of 1024M enabled.
[ 6654.491889] [drm] PTB located at 0x000000F417C00000
[ 6654.491914] amdgpu 0000:04:00.0: amdgpu: SMU is resuming...
[ 6654.492896] amdgpu 0000:04:00.0: amdgpu: dpm has been disabled
[ 6654.493700] amdgpu 0000:04:00.0: amdgpu: SMU is resumed successfully!
[ 6654.535422] [drm] VCN decode and encode initialized successfully(under DPG Mode).
[ 6654.535708] [drm] JPEG decode initialized successfully.
[ 6654.535713] amdgpu 0000:04:00.0: amdgpu: ring gfx uses VM inv eng 0 on hub 0
[ 6654.535716] amdgpu 0000:04:00.0: amdgpu: ring gfx_low uses VM inv eng 1 on hub 0
[ 6654.535718] amdgpu 0000:04:00.0: amdgpu: ring gfx_high uses VM inv eng 4 on hub 0
[ 6654.535720] amdgpu 0000:04:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 5 on hub 0
[ 6654.535722] amdgpu 0000:04:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 6 on hub 0
[ 6654.535723] amdgpu 0000:04:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 7 on hub 0
[ 6654.535725] amdgpu 0000:04:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 8 on hub 0
[ 6654.535727] amdgpu 0000:04:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 9 on hub 0
[ 6654.535728] amdgpu 0000:04:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 10 on hub 0
[ 6654.535730] amdgpu 0000:04:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 11 on hub 0
[ 6654.535732] amdgpu 0000:04:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 12 on hub 0
[ 6654.535733] amdgpu 0000:04:00.0: amdgpu: ring kiq_0.2.1.0 uses VM inv eng 13 on hub 0
[ 6654.535735] amdgpu 0000:04:00.0: amdgpu: ring sdma0 uses VM inv eng 0 on hub 8
[ 6654.535737] amdgpu 0000:04:00.0: amdgpu: ring vcn_dec uses VM inv eng 1 on hub 8
[ 6654.535739] amdgpu 0000:04:00.0: amdgpu: ring vcn_enc0 uses VM inv eng 4 on hub 8
[ 6654.535740] amdgpu 0000:04:00.0: amdgpu: ring vcn_enc1 uses VM inv eng 5 on hub 8
[ 6654.535742] amdgpu 0000:04:00.0: amdgpu: ring jpeg_dec uses VM inv eng 6 on hub 8
[ 6654.651608] nvme nvme0: 16/0/0 default/read/poll queues
[ 6654.826347] ata2: SATA link down (SStatus 0 SControl 300)
[ 6654.826349] ata1: SATA link down (SStatus 0 SControl 300)
[ 6656.454469] PM: resume devices took 1.801 seconds
[ 6656.454694] OOM killer enabled.
[ 6656.454696] Restarting tasks ... done.
[ 6656.458812] random: crng reseeded on system resumption
[ 6656.458819] thermal thermal_zone0: failed to read out thermal zone (-61)
[ 6656.459859] PM: suspend exit

Laptop : Dell G15 5515 (AMD + Nvidia GPU)

inxi -Gfxx

CPU:
  Info: 6-core model: AMD Ryzen 5 5600H with Radeon Graphics bits: 64 type: MT MCP arch: Zen 3
    rev: 0 cache: L1: 384 KiB L2: 3 MiB L3: 16 MiB
  Speed (MHz): avg: 765 high: 2567 min/max: 400/4280 cores: 1: 400 2: 2567 3: 400 4: 400 5: 1397
    6: 1623 7: 400 8: 400 9: 400 10: 400 11: 400 12: 400 bogomips: 79051
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1 bmi2 bpext cat_l3
    cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy constant_tsc cpb cppc cpuid cqm cqm_llc
    cqm_mbm_local cqm_mbm_total cqm_occup_llc cr8_legacy cx16 cx8 de debug_swap decodeassists
    erms extapic extd_apicid f16c flushbyasid fma fpu fsgsbase fsrm fxsr fxsr_opt ht hw_pstate
    ibpb ibrs ibs invpcid irperf lahf_lm lbrv lm mba mca mce misalignsse mmx mmxext monitor movbe
    msr mtrr mwaitx nonstop_tsc nopl npt nrip_save nx ospke osvw overflow_recov pae pat
    pausefilter pclmulqdq pdpe1gb perfctr_core perfctr_llc perfctr_nb pfthreshold pge pku pni
    popcnt pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sha_ni skinit smap
    smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor svm svm_lock syscall tce
    topoext tsc tsc_scale umip user_shstk v_spec_ctrl v_vmsave_vmload vaes vgif vmcb_clean vme
    vmmcall vpclmulqdq wbnoinvd wdt xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
Graphics:
  Device-1: NVIDIA GA107M [GeForce RTX 3050 Mobile] vendor: Dell driver: nvidia v: 545.29.06
    arch: Ampere pcie: speed: 8 GT/s lanes: 8 ports: active: none empty: HDMI-A-1 bus-ID: 01:00.0
    chip-ID: 10de:25a2
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series] vendor: Dell driver: amdgpu
    v: kernel arch: GCN-5 pcie: speed: 8 GT/s lanes: 16 ports: active: eDP-1 empty: DP-1
    bus-ID: 05:00.0 chip-ID: 1002:1638 temp: 40.0 C
  Device-3: Microdia [] driver: uvcvideo type: USB rev: 2.0 speed: 480 Mb/s lanes: 1
    bus-ID: 1-4:3 chip-ID: 0c45:6a09
  Display: server: X.org v: 1.20.14 with: Xwayland v: 23.2.3 compositor: kwin_wayland driver: X:
    loaded: amdgpu,modesetting unloaded: fbdev,vesa dri: radeonsi,nouveau gpu: amdgpu tty: 240x67
  Monitor-1: eDP-1 model: BOE Display 0x0a8a res: 1920x1080 dpi: 142 diag: 395mm (15.5")
  API: EGL v: 1.5 platforms: device: 0 drv: nvidia device: 1 drv: radeonsi device: 3 drv: swrast
    surfaceless: drv: nvidia inactive: gbm,wayland,x11,device-2
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: mesa v: 23.2.1 note: console (EGL sourced)
    renderer: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2, AMD Radeon Graphics (renoir LLVM 16.0.6
    DRM 3.54 6.6.6-200.fc39.x86_64), llvmpipe (LLVM 16.0.6 256 bits)
  API: Vulkan v: 1.3.268 surfaces: N/A device: 0 type: integrated-gpu driver: mesa radv
    device-ID: 1002:1638 device: 1 type: discrete-gpu driver: nvidia device-ID: 10de:25a2 device: 2
    type: cpu driver: mesa llvmpipe device-ID: 10005:0000

sudo dmidecode | grep Wake-up

Wake-up Type: Power Switch

sort /proc/acpi/wakeup | grep -v disabled

Device  S-state   Status   Sysfs node
GP17      S4    *enabled   pci:0000:00:08.1
GPP0      S4    *enabled   pci:0000:00:01.1
GPP1      S4    *enabled   pci:0000:00:01.2

I disabled all of these but suspend still doesn’t work.

You can get some info if you web search for dell_wmi: Unknown key with type 0x0010 and code 0x0140 pressed

I did get some info but I couldn’t find a way to fix it. I need to find a way to make the kernel ignore this keypress ? Can it be done via udev or do I need to ignore the keymap in driver file ?

Sorry I do not know how to do that. Maybe someone does.