aplsmc: fix suspend fall-through for lidaction=0

Heyang Zhou <[email protected]> Sat, 25 Jul 2026 21:55:56 +0800 (CST)
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
Hi,

On my 2020 M1 Macbook Air closing the lid still suspends the machine
when machdep.lidaction is set to 0. Setting lidaction to 2 works around
this and it turns out to be a missing break in the SMC_EV_TYPE_LID
handling path in aplsmc. This causes the switch to fall through into
the request_sleep(SLEEP_SUSPEND) case.

Here's a patch:

Index: sys/arch/arm64/dev/aplsmc.c
===================================================================
RCS file: /cvs/src/sys/arch/arm64/dev/aplsmc.c,v
diff -u -p -r1.32 aplsmc.c
--- sys/arch/arm64/dev/aplsmc.c 30 Sep 2025 14:29:54 -0000      1.32
+++ sys/arch/arm64/dev/aplsmc.c 25 Jul 2026 13:47:19 -0000
@@ -467,6 +467,7 @@ aplsmc_handle_notification(struct aplsmc
                                       sc->sc_dev.dv_xname, data);
                                break;
                        }
+                       break;
                case 1:
 #ifdef SUSPEND
                        request_sleep(SLEEP_SUSPEND);