Index | Thread | Search

From:
Heyang Zhou <hello@su3.io>
Subject:
aplsmc: fix suspend fall-through for lidaction=0
To:
tech@openbsd.org
Date:
Sat, 25 Jul 2026 21:55:56 +0800

Download raw body.

Thread
  • Heyang Zhou:

    aplsmc: fix suspend fall-through for lidaction=0

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);