A Dell Precision 5510 produces two _LID events when the lid is closed.
This results in acpibtn_notify() adding two sleep tasks. The laptop
suspends and resumes successfully, but on resume the second sleep
task runs and it goes right back to sleep. Making the lid transition
a no-op when the existing value matches new _LID value works around
the problem. OK miod@ jcs@
-/* $OpenBSD: acpibtn.c,v 1.49 2022/04/06 18:59:27 naddy Exp $ */
+/* $OpenBSD: acpibtn.c,v 1.50 2023/04/03 13:38:18 millert Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
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)