My framework laptop can suspend/resume without problems most of the time, though resume takes a long time (~10s, maybe related to some nvme time messages that I see). Suspend occasionally hangs. When this happens, the display stays on, and I see a number of messages of the form hdac0: Unexpected unsolicited response from address 0: 00000000 These messages don't appear when suspend succeeds. After that, some other devices detach, and the system hangs (can't switch to other vtys, no network, etc.). It responds to keyboard input and I can scroll in the terminal but DDB prints output very slowly. All CPUs are idle, but by inserting print statements I can see that the hang occurred somewhere in DEVICE_SUSPEND(root_bus). I haven't been able to reproduce this problem if I manually detach hdac0 before suspending.
> All CPUs are idle Oops, I lied. There is an ithread executing hdac_intr_handler() when the system is hung.
This reminded me of base r342170. I am not sure if there is any relation, but it perhaps there is a problem of a similar nature.
https://reviews.freebsd.org/D34117
*** Bug 255745 has been marked as a duplicate of this bug. ***
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=077564cfdb7285ff7d256424715e563cbac36f8b commit 077564cfdb7285ff7d256424715e563cbac36f8b Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-03-16 16:09:17 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-03-17 19:39:00 +0000 hdac: Handle interrupts racing with device suspend - Avoid looping forever if a concurrent reset causes a read of the interrupt status register to return all ones. - Lock the softc before reading the interrupt status, so as to avoid a similar infinite loop in hdac_one_intr(). This fixes suspend-to-S3 on some laptops. PR: 261207 Reviewed by: mav, imp Tested by: uqs MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34117 sys/dev/sound/pci/hda/hdac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=18a3bada308d89928f170f4098c85cd3f11db864 commit 18a3bada308d89928f170f4098c85cd3f11db864 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-03-16 16:09:17 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-03-24 14:28:14 +0000 hdac: Handle interrupts racing with device suspend - Avoid looping forever if a concurrent reset causes a read of the interrupt status register to return all ones. - Lock the softc before reading the interrupt status, so as to avoid a similar infinite loop in hdac_one_intr(). This fixes suspend-to-S3 on some laptops. PR: 261207 Reviewed by: mav, imp Tested by: uqs Sponsored by: The FreeBSD Foundation (cherry picked from commit 077564cfdb7285ff7d256424715e563cbac36f8b) sys/dev/sound/pci/hda/hdac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
A commit in branch releng/13.1 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9f83c6fa52fb7c5a256fed2f1a13735b66b8f7c2 commit 9f83c6fa52fb7c5a256fed2f1a13735b66b8f7c2 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2022-03-16 16:09:17 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2022-03-24 15:42:11 +0000 hdac: Handle interrupts racing with device suspend - Avoid looping forever if a concurrent reset causes a read of the interrupt status register to return all ones. - Lock the softc before reading the interrupt status, so as to avoid a similar infinite loop in hdac_one_intr(). This fixes suspend-to-S3 on some laptops. Approved by: re (gjb) PR: 261207 Reviewed by: mav, imp Tested by: uqs Sponsored by: The FreeBSD Foundation (cherry picked from commit 077564cfdb7285ff7d256424715e563cbac36f8b) (cherry picked from commit 18a3bada308d89928f170f4098c85cd3f11db864) sys/dev/sound/pci/hda/hdac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)