On Thu, 23 Mar 2023 11:41:13 -0600, [email protected] wrote:
> >Synopsis: Dell Precision 5510 immediately suspends after lid is opened
> >Category: amd64
> >Environment:
> System : OpenBSD 7.3
> Details : OpenBSD 7.3 (GENERIC.MP) #1123: Tue Mar 21 07:11:25 MDT 2
> 023
> [email protected]:/usr/src/sys/arch/amd64/comp
> ile/GENERIC.MP
>
> Architecture: OpenBSD.amd64
> Machine : amd64
> >Description:
> My Dell Precision 5510 (latest BOIS) suspends successfully when
> the lid is closed. When the lid is opened again it comes back
> from suspend very briefly before suspending once again. At this
> point I have to press the power button to unsuspend it.
>
> Suspending using zzz works as expected and the laptop resumes
> when the power button is pressed. It is only when suspended
> by closing the lid that the problem occurs.
The problem is that we get two lid closed events, one after the
other. If we ignore closed -> closed state transitions, the laptop
resumes on lid open without going back to sleed immediately.
Does this seem like a reasonable approach?
- todd
Index: sys/dev/acpi/acpibtn.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpibtn.c,v
retrieving revision 1.49
diff -u -p -u -r1.49 acpibtn.c
--- sys/dev/acpi/acpibtn.c 6 Apr 2022 18:59:27 -0000 1.49
+++ sys/dev/acpi/acpibtn.c 2 Apr 2023 00:33:56 -0000
@@ -232,6 +232,8 @@ acpibtn_notify(struct aml_node *node, in
if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode,
"_LID", 0, NULL, &lid))
return (0);
+ if (sc->sc_sens.value == lid)
+ break;
sc->sc_sens.value = lid;
if (lid != 0)