Bug 2077808

Summary: System wakes up from suspend after seconds to minutes without user interaction
Product: [Fedora] Fedora Reporter: Martin Wolf <mwolf>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: acaringi, adscvr, airlied, alciregi, bskeggs, hdegoede, hpa, jarodwilson, jglisse, jonathan, josef, kernel-maint, lgoncalv, linville, mail, masami256, mchehab, ppitonak, ptalbert, robin.a.meade, steved
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-25 17:03:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
dmesg after wake-up
none
interrupts before suspend
none
interrupts after suspend
none
acpidump before suspend
none
acpidump after suspend none

Description Martin Wolf 2022-04-22 09:49:46 UTC
Created attachment 1874362 [details]
dmesg after wake-up

I am not sure if the kernel is causing this, because with Fedora 35 and Kernel 5.17.2 I did not had these issues, but I really have no idea where to start searching for the error.

I am even quite certain, that after the initial update to Fedora 36 it worked fine, so the problem seems to have occured afterwards.

Comment 1 Martin Wolf 2022-04-22 09:50:21 UTC
Created attachment 1874363 [details]
interrupts before suspend

Comment 2 Martin Wolf 2022-04-22 09:50:48 UTC
Created attachment 1874364 [details]
interrupts after suspend

Comment 3 Martin Wolf 2022-04-22 09:51:17 UTC
Created attachment 1874365 [details]
acpidump before suspend

Comment 4 Martin Wolf 2022-04-22 09:51:44 UTC
Created attachment 1874366 [details]
acpidump after suspend

Comment 5 Martin Wolf 2022-04-22 11:25:30 UTC
I experimented a bit with acpitool and found out, that if I disable Nr. 17
[root@el-ryzerino rpms]# acpitool -w
   Device	S-state	  Status   Sysfs node
  ---------------------------------------
  1. GP12	  S4	*enabled   pci:0000:00:07.1
  2. GP13	  S4	*enabled   pci:0000:00:08.1
  3. XHC0	  S4	*enabled   pci:0000:0d:00.3
  4. GP30	  S4	*disabled
  5. GP31	  S4	*disabled
  6. PS2K	  S3	*disabled
  7. PS2M	  S3	*disabled
  8. GPP0	  S4	*enabled   pci:0000:00:01.1
  9. GPP8	  S4	*enabled   pci:0000:00:03.1
  10. GPP1	  S4	*enabled   pci:0000:00:01.2
  11. PTXH	  S4	*enabled   pci:0000:02:00.0
  12. PT20	  S4	*disabled
  13. PT24	  S4	*disabled
  14. PT26	  S4	*disabled
  15. PT27	  S4	*disabled
  16. PT28	  S4	*enabled   pci:0000:03:08.0
  17. PT29	  S4	*enabled   pci:0000:03:09.0

03:09.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Device 43ea (prog-if 00 [Normal decode])
   Flags: bus master, fast devsel, latency 0, IRQ 40, IOMMU group 0
   Bus: primary=03, secondary=06, subordinate=0a, sec-latency=0
   I/O behind bridge: 0000d000-0000efff [size=8K]
   Memory behind bridge: fc600000-fc7fffff [size=2M]
   Prefetchable memory behind bridge: [disabled]
   Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
   Capabilities: [78] Power Management version 3
   Capabilities: [80] Express Downstream Port (Slot+), MSI 00
   Capabilities: [c0] Subsystem: ASMedia Technology Inc. Device 3308
   Capabilities: [100] Advanced Error Reporting
   Capabilities: [200] Secondary PCI Express
   Kernel driver in use: pcieport

The system stays in standby (for now)

Comment 6 Robin A. Meade 2022-05-03 05:34:38 UTC
My *F35* computer started waking 3 seconds after suspend when I updated to kernel-5.17.4 two days ago.

If I revert to the previous kernel that is installed on my computer, kernel-5.16.20, the problem goes away.

Same thing happened to me back when I was running Fedora 31. The workaround given in this answer fixed it for me back then:

https://askubuntu.com/a/1124301

And it fixes for me now too. 

Summary of the workaround:

cat <<'EOF' | sudo tee /lib/systemd/system-sleep/bluetooth-suspend
#!/bin/bash
# Makes sure bluetooth service is not running while suspended.

if [ "${1}" == "pre" ]; then
    service bluetooth stop
elif [ "${1}" == "post" ]; then
    service bluetooth start
fi
EOF

sudo chmod +x /lib/systemd/system-sleep/bluetooth-suspend

Comment 7 Robin A. Meade 2022-05-05 04:59:44 UTC
I updated my *F35* computer to kernel-5.17.5-200.fc35.x86_64 and the problem is still present. I'll continue to use the workaround shown in my previous comment.

Possibly related:

Bug 215768 - Kernel 5.17 can't suspend while bluetooth is enabled. 
https://bugzilla.kernel.org/show_bug.cgi?id=215768

via https://bbs.archlinux.org/viewtopic.php?pid=2034525#p2034525

Comment 8 Robin A. Meade 2022-06-05 21:37:21 UTC
I upgraded to F36. My computer still wakes after two seconds.

I tried kernel-5.18.1-200.fc36 (https://koji.fedoraproject.org/koji/buildinfo?buildID=1976683). Computer still wakes after two seconds.

The workaround of Comment #6 still works. I refined it as follows:

#!/bin/bash
if [[ $1 = pre ]]; then
    btmgmt power off
elif [[ $1 = post ]]; then
    btmgmt power on
fi
EOF
sudo chmod +x /lib/systemd/system-sleep/bluetooth-suspend

Comment 9 Pavol Pitonak 2022-07-12 11:06:59 UTC
Possibly a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2069499

Comment 10 Ben Cotton 2023-04-25 17:02:25 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 11 Ludek Smid 2023-05-25 17:03:04 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.