Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cannot figuring out the event causing wakeup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
AprilGrimoire
n00b
n00b


Joined: 05 Jun 2020
Posts: 57

PostPosted: Wed Sep 18, 2024 4:57 am    Post subject: Cannot figuring out the event causing wakeup Reply with quote

Hi! I'm using Gentoo on a Laptop. However, after suspending, sometimes it wakes up unexpectedly. I found that closing and opening the lid seems to cause wakeups. My lid isn't recognized as a lid, so modifying systemd config didn't work:

Code:

➜  ~ cat /proc/acpi/wakeup
Device   S-state     Status   Sysfs node
GP11     S4   *disabled
SWUS     S4   *disabled
GP12     S4   *disabled
SWUS     S4   *disabled
XHC0     S4   *enabled   pci:0000:07:00.3
XHC1     S4   *enabled   pci:0000:07:00.4
XHC2     S4   *disabled  pci:0000:09:00.0
XHC3     S4   *enabled   pci:0000:09:00.3
XHC4     S4   *enabled   pci:0000:09:00.4
NHI0     S4   *disabled
NHI1     S4   *disabled
GPP5     S0   *enabled   pci:0000:00:02.1
GPP6     S0   *enabled   pci:0000:00:02.2
GPP0     S4   *enabled   pci:0000:00:01.1


In dmesg, while I already have detailed logging enabled
Code:

➜  ~ cat /proc/cmdline         
BOOT_IMAGE=/kernel-6.10.9-gentoo root=/dev/mapper/vg0-gentoo--rootvol ro root=UUID=778ffb43-269a-4ac3-8786-ccddcfbe8140 rd.luks.uuid=b02398b6-9c80-4ea2-a188-76d6c3fc2a3b rd.luks.uuid=188c0d5e-4344-42cd-9b99-b9a581fab427 rd.luks.options=discard,cache_keyring rd.lvm.vg=vg0 atkbd.reset iommu=pt amd_iommu=on pcie_acs_override=downstream,multifunction acpi.debug_layer=0x00200000 acpi.debug_level=0x02 loglevel=8


I only see some generic info, without detail of what event from what device triggered the wakeup:

Code:

[  106.026829] PM: suspend entry (s2idle)
[  106.102622] Filesystems sync: 0.075 seconds
[  106.321886] rfkill: input handler enabled
[  106.340423] Loading firmware: rtl_nic/rtl8168h-2.fw
[  106.340440] Loading firmware: mediatek/WIFI_RAM_CODE_MT7922_1.bin
[  106.340447] Loading firmware: mediatek/WIFI_MT7922_patch_mcu_1_1_hdr.bin
[  106.340448] Loading firmware: amdgpu/psp_13_0_4_toc.bin
[  106.340455] Loading firmware: amdgpu/psp_13_0_4_ta.bin
[  106.340464] Loading firmware: amdgpu/gc_11_0_1_pfp.bin
[  106.340463] Loading firmware: amdgpu/dcn_3_1_4_dmcub.bin
[  106.340468] Loading firmware: amdgpu/gc_11_0_1_me.bin
[  106.340473] Loading firmware: amdgpu/gc_11_0_1_mec.bin
[  106.340473] Loading firmware: amdgpu/gc_11_0_1_imu.bin
[  106.340472] Loading firmware: amdgpu/gc_11_0_1_rlc.bin
[  106.340476] Loading firmware: amdgpu/sdma_6_0_1.bin
[  106.340477] Loading firmware: amdgpu/vcn_4_0_2.bin
[  106.340481] Loading firmware: amdgpu/gc_11_0_1_mes1.bin
[  106.340480] Loading firmware: amdgpu/gc_11_0_1_mes_2.bin
[  106.340783] Freezing user space processes
[  106.342972] Freezing user space processes completed (elapsed 0.002 seconds)
[  106.342996] OOM killer disabled.
[  106.343005] Freezing remaining freezable tasks
[  106.344256] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  106.344267] printk: Suspending console(s) (use no_console_suspend to debug)
[  106.355092] queueing ieee80211 work while going to suspend
[  106.473306] ACPI: EC: interrupt blocked
[  113.657838] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.ACDC.RTAC], AE_NOT_FOUND (20240322/psargs-330)
[  113.657847] ACPI Error: Aborting method \_SB.PEP._DSM due to previous error (AE_NOT_FOUND) (20240322/psparse-529)
[  113.658037] ACPI: EC: interrupt unblocked
[  114.549804] [drm] PCIE GART of 512M enabled (table at 0x000000801FD00000).
[  114.549846] amdgpu 0000:07:00.0: amdgpu: SMU is resuming...
[  114.551256] nvme nvme0: 16/0/0 default/read/poll queues
[  114.552983] amdgpu 0000:07:00.0: amdgpu: SMU is resumed successfully!
[  114.570742] nvme nvme1: 16/0/0 default/read/poll queues
[  114.821688] amdgpu 0000:07:00.0: [drm:jpeg_v4_0_hw_init [amdgpu]] JPEG decode initialized successfully.
[  114.821901] amdgpu 0000:07:00.0: amdgpu: ring gfx_0.0.0 uses VM inv eng 0 on hub 0
[  114.821904] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.0 uses VM inv eng 1 on hub 0
[  114.821905] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.0 uses VM inv eng 4 on hub 0
[  114.821906] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.0 uses VM inv eng 6 on hub 0
[  114.821907] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.0 uses VM inv eng 7 on hub 0
[  114.821908] amdgpu 0000:07:00.0: amdgpu: ring comp_1.0.1 uses VM inv eng 8 on hub 0
[  114.821909] amdgpu 0000:07:00.0: amdgpu: ring comp_1.1.1 uses VM inv eng 9 on hub 0
[  114.821910] amdgpu 0000:07:00.0: amdgpu: ring comp_1.2.1 uses VM inv eng 10 on hub 0
[  114.821911] amdgpu 0000:07:00.0: amdgpu: ring comp_1.3.1 uses VM inv eng 11 on hub 0
[  114.821912] amdgpu 0000:07:00.0: amdgpu: ring sdma0 uses VM inv eng 12 on hub 0
[  114.821914] amdgpu 0000:07:00.0: amdgpu: ring vcn_unified_0 uses VM inv eng 0 on hub 8
[  114.821915] amdgpu 0000:07:00.0: amdgpu: ring jpeg_dec uses VM inv eng 1 on hub 8
[  114.821916] amdgpu 0000:07:00.0: amdgpu: ring mes_kiq_3.1.0 uses VM inv eng 13 on hub 0
[  114.854754] [drm] ring gfx_32771.1.1 was added
[  114.855956] [drm] ring compute_32771.2.2 was added
[  114.857134] [drm] ring sdma_32771.3.3 was added
[  114.857202] [drm] ring gfx_32771.1.1 ib test pass
[  114.857280] [drm] ring compute_32771.2.2 ib test pass
[  114.857401] [drm] ring sdma_32771.3.3 ib test pass
[  114.862886] OOM killer enabled.
[  114.862892] Restarting tasks ... done.
[  114.864757] random: crng reseeded on system resumption
[  114.866692] PM: suspend exit


How can I track down the issue? Thanks!
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20490

PostPosted: Wed Sep 18, 2024 5:59 pm    Post subject: Reply with quote

Do you have kernel support for ACPI and related features?

For example, I can see this on my laptop:
Code:
$ grep . /sys/bus/acpi/drivers/button/*:00/input/input*/name
/sys/bus/acpi/drivers/button/LNXPWRBN:00/input/input2/name:Power Button
/sys/bus/acpi/drivers/button/PNP0C0D:00/input/input1/name:Lid Switch
/sys/bus/acpi/drivers/button/PNP0C0E:00/input/input0/name:Sleep Button


Sleep states were also messed with at the hardware level some time ago. If I recall correctly, newer hardware only supports some sort of sleep state, not hibernation. I believe this keeps the management engines of the processor running, so there's a chance it might not be an event that you can block.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
AprilGrimoire
n00b
n00b


Joined: 05 Jun 2020
Posts: 57

PostPosted: Wed Sep 18, 2024 6:15 pm    Post subject: Reply with quote

pjp wrote:
Do you have kernel support for ACPI and related features?

For example, I can see this on my laptop:
Code:
$ grep . /sys/bus/acpi/drivers/button/*:00/input/input*/name
/sys/bus/acpi/drivers/button/LNXPWRBN:00/input/input2/name:Power Button
/sys/bus/acpi/drivers/button/PNP0C0D:00/input/input1/name:Lid Switch
/sys/bus/acpi/drivers/button/PNP0C0E:00/input/input0/name:Sleep Button


Sleep states were also messed with at the hardware level some time ago. If I recall correctly, newer hardware only supports some sort of sleep state, not hibernation. I believe this keeps the management engines of the processor running, so there's a chance it might not be an event that you can block.


Yes, I do have ACPI support enabled.

Code:

➜  ~ grep . /sys/bus/acpi/drivers/button/*:00/input/input*/name
/sys/bus/acpi/drivers/button/PNP0C0C:00/input/input0/name:Power Button
/sys/bus/acpi/drivers/button/PNP0C0D:00/input/input2/name:Lid Switch
/sys/bus/acpi/drivers/button/PNP0C0E:00/input/input1/name:Sleep Button
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20490

PostPosted: Wed Sep 18, 2024 10:22 pm    Post subject: Reply with quote

I don't know what systemd does, but since Linux can see the hardware, it seems like it should be configurable. If I didn't misunderstand, systemd subsumed udev, so I wonder if a udev rule could be created. That is if it isn't something else causing the state change.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
AprilGrimoire
n00b
n00b


Joined: 05 Jun 2020
Posts: 57

PostPosted: Thu Sep 19, 2024 12:30 am    Post subject: Reply with quote

pjp wrote:
I don't know what systemd does, but since Linux can see the hardware, it seems like it should be configurable. If I didn't misunderstand, systemd subsumed udev, so I wonder if a udev rule could be created. That is if it isn't something else causing the state change.


Yeah, I'm considering if I can confirm the event causing wakeup first before configuring.
Back to top
View user's profile Send private message
AprilGrimoire
n00b
n00b


Joined: 05 Jun 2020
Posts: 57

PostPosted: Thu Sep 19, 2024 12:43 am    Post subject: Reply with quote

pjp wrote:
I don't know what systemd does, but since Linux can see the hardware, it seems like it should be configurable. If I didn't misunderstand, systemd subsumed udev, so I wonder if a udev rule could be created. That is if it isn't something else causing the state change.


Code:

➜  ~ grep . /sys/bus/acpi/drivers/button/*/power/wakeup                     
/sys/bus/acpi/drivers/button/PNP0C0C:00/power/wakeup:disabled
/sys/bus/acpi/drivers/button/PNP0C0D:00/power/wakeup:disabled
/sys/bus/acpi/drivers/button/PNP0C0E:00/power/wakeup:disabled


I think I've disabled all of them, however it is still not working.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20490

PostPosted: Thu Sep 19, 2024 2:25 am    Post subject: Reply with quote

I presume you've tried searching for anything related to your specific laptop.

The only other thing that comes to mind would be something in the BIOS.

Quote:
Code:
[  113.657838] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.ACDC.RTAC], AE_NOT_FOUND (20240322/psargs-330)
I didn't find much on that earlier other than there being no official Linux support. I wonder if there might be other parts of the system which are unsupported or at least not supported well.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
AprilGrimoire
n00b
n00b


Joined: 05 Jun 2020
Posts: 57

PostPosted: Thu Sep 19, 2024 2:17 pm    Post subject: Reply with quote

pjp wrote:
I presume you've tried searching for anything related to your specific laptop.

The only other thing that comes to mind would be something in the BIOS.

Quote:
Code:
[  113.657838] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.ACDC.RTAC], AE_NOT_FOUND (20240322/psargs-330)
I didn't find much on that earlier other than there being no official Linux support. I wonder if there might be other parts of the system which are unsupported or at least not supported well.


I'm confused. In order for Linux to enter suspension, it needs to react to some kind of signal, which should be logged in any case.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20490

PostPosted: Thu Sep 19, 2024 7:34 pm    Post subject: Reply with quote

Right. So it's about finding out what that is. If it should be logged and isn't, what is responsible for that?

My question about the BIOS was whether or not it had any settings related to power management, ACPI, or the functionality of any related buttons, such as the lid or power button.

Related is that laptops are known to be "odd" with varying degrees of support available for them. The log you posted referenced two items (_SB.ACDC.RTAC and _SB.PEP._DSM) reporting errors, and at least one lacks (or lacked) in-kernel support. Might there be other parts of the laptop that are unsupported or poorly supported?

Given that the standard method of telling systemd to do something with the lid isn't working, that suggests either something lower level with systemd needs to be configured for this hardware, or that the lack of logging could be related to a lack of support / poor support.

So are there any reports of this laptop working well with Linux, or are there reports of things known to not work, .etc.

The Gentoo guide on Suspend and hibernate references a debugging document at kenrel.org, Debugging hibernation and suspend. Maybe that has something useful.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum