Re: lidaction on an M1 macbook

2023-06-23 Thread Jan Stary
On Jun 22 16:57:45, tobias.hei...@stusta.de wrote:
> > > >  The arm64 default for the machdep.lidaction is 1, making the
> > > >  system suspend when the lid is closed.
> > 
> > On this M1 macbook (dmesg below), I see no difference
> > between lidaction=0 and lidaction=1; with both,
> > closing and opening the lid does this:
> > 
> Is this still the case?

Yes.

> For me lidaction=0 seems to only disable the screen which is inteded,
> lidaction=1 triggers a suspend.

For me, both lidaction=0 and lidaction=1
turn the screen off, but do not suspend.
Only apm -z suspends.


closing the lid with machdep.lidaction=0

Jun 23 10:33:40 mb /bsd: uhub0 detached
Jun 23 10:33:40 mb /bsd: uhub1 detached
Jun 23 10:34:57 mb /bsd: wsdisplay_switch2: not switching
Jun 23 10:34:57 mb /bsd: cpu0: 1 wakeup events
Jun 23 10:34:57 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:34:57 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:34:57 mb /bsd: cpu7: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu4: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu6: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu5: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu1: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu2: 1 wakeup events
Jun 23 10:34:57 mb /bsd: cpu3: 1 wakeup events
Jun 23 10:34:57 mb root: running /etc/apm/resume
Jun 23 10:35:03 mb apmd: system resumed from sleep
Jun 23 10:35:03 mb apmd: battery status: high. external power status: 
connected. estimated battery life 100%

closing the lid with machdep.lidaction=1

Jun 23 10:35:56 mb /bsd: uhub0 detached
Jun 23 10:35:56 mb /bsd: uhub1 detached
Jun 23 10:36:47 mb /bsd: wsdisplay_switch2: not switching
Jun 23 10:36:47 mb /bsd: cpu0: 1 wakeup events
Jun 23 10:36:47 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:36:47 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:36:47 mb /bsd: cpu7: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu5: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu4: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu6: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu3: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu1: 1 wakeup events
Jun 23 10:36:47 mb /bsd: cpu2: 1 wakeup events
Jun 23 10:36:47 mb root: running /etc/apm/resume
Jun 23 10:36:53 mb apmd: system resumed from sleep
Jun 23 10:36:53 mb apmd: battery status: high. external power status: 
connected. estimated battery life 100%

running apm -z

Jun 23 10:37:16 mb apmd: system suspending
Jun 23 10:37:16 mb apmd: battery status: high. external power status: 
connected. estimated battery life 100%
Jun 23 10:37:16 mb root: running /etc/apm/suspend
Jun 23 10:37:17 mb /bsd: uhub0 detached
Jun 23 10:37:17 mb /bsd: uhub1 detached
Jun 23 10:38:00 mb /bsd: wsdisplay_switch2: not switching
Jun 23 10:38:00 mb /bsd: cpu0: 1 wakeup events
Jun 23 10:38:00 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:38:00 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Jun 23 10:38:00 mb /bsd: cpu7: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu4: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu5: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu6: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu1: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu3: 1 wakeup events
Jun 23 10:38:00 mb /bsd: cpu2: 1 wakeup events
Jun 23 10:38:01 mb root: running /etc/apm/resume
Jun 23 10:38:06 mb apmd: system resumed from sleep
Jun 23 10:38:06 mb apmd: battery status: high. external power status: 
connected. estimated battery life 100%


Jan


/etc/apm/{suspend,resume} are the same file:

#!/bin/sh
logger running $0

dmesg:

OpenBSD 7.3-current (GENERIC.MP) #2170: Thu Jun 22 14:47:18 MDT 2023
dera...@arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 8001478656 (7630MB)
avail mem = 7634296832 (7280MB)
random: good seed from bootblocks
mainbus0 at root: Apple MacBook Air (M1, 2020)
cpu0 at mainbus0 mpidr 0: Apple Icestorm r1p1
cpu0: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache
cpu0: 4096KB 128b/line 16-way L2 cache
cpu0: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,VH,CSV3,CSV2,DIT,SBSS+MSR
cpu1 at mainbus0 mpidr 1: Apple Icestorm r1p1
cpu1: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache
cpu1: 4096KB 128b/line 16-way L2 cache
cpu1: 
TLBIOS+IRANGE,TS+AXFLAG,FHM,DP,SHA3,RDM,Atomic,CRC32,SHA2+SHA512,SHA1,AES+PMULL,SPECRES,SB,FRINTTS,GPI,LRCPC+LDAPUR,FCMA,JSCVT,API+PAC,DPB,SpecSEI,PAN+ATS1E1,LO,HPDS,VH,CSV3,CSV2,DIT,SBSS+MSR
cpu2 at mainbus0 mpidr 2: Apple Icestorm r1p1
cpu2: 128KB 64b/line 8-way L1 VIPT I-cache, 64KB 64b/line 8-way L1 D-cache
cpu2: 4096KB 128b/line 16-way L2 cache

Re: lidaction on an M1 macbook

2023-06-22 Thread Tobias Heider
On Tue, Apr 11, 2023 at 06:29:50PM +0200, Jan Stary wrote:
> > o On arm64, add a machdep.lidaction sysctl(8)
> > for aplsmc(4) Apple Silicon laptops.
> 
> Should that be mentioned in the arm64 examples/sysctl.conf
> as on other such architectures?
> 
> Index: etc/etc.arm64/sysctl.conf
> ===
> RCS file: /cvs/src/etc/etc.arm64/sysctl.conf,v
> retrieving revision 1.1
> diff -u -p -r1.1 sysctl.conf
> --- etc.arm64/sysctl.conf 11 Jan 2017 22:57:34 -  1.1
> +++ etc.arm64/sysctl.conf 11 Apr 2023 15:40:50 -
> @@ -0,0 +1 @@
> +#machdep.lidaction=0 # 1=suspend, 2=hibernate laptop upon lid closing
> 
> 
> > aplsmc(4) provides support for the lid position sensor.
> 
> Should that be mentioned in aplsmc(4)?

Sounds like a good idea.

> 
> Index: aplsmc.4
> ===
> RCS file: /cvs/src/share/man/man4/man4.arm64/aplsmc.4,v
> retrieving revision 1.2
> diff -u -p -r1.2 aplsmc.4
> --- aplsmc.4  10 Jan 2022 21:16:44 -  1.2
> +++ aplsmc.4  11 Apr 2023 15:49:20 -
> @@ -28,7 +28,7 @@ The
>  driver provides support for the System Management Controller (SMC)
>  found on various Apple SoCs.
>  The driver provides a collection of current, fan, power, temperature,
> -voltage and battery information sensors.
> +voltage, lid position and battery information sensors.
>  .Pp
>  Sensor values are made available through the
>  .Xr sysctl 8

ok too.

> 
> 
> > >  The arm64 default for the machdep.lidaction is 1, making the
> > >  system suspend when the lid is closed.
> 
> On this M1 macbook (dmesg below), I see no difference
> between lidaction=0 and lidaction=1; with both,
> closing and opening the lid does this:
> 
> (lidaction=0)

Is this still the case?
For me lidaction=0 seems to only disable the screen which is inteded,
lidaction=1 triggers a suspend.

> 
> Apr 11 16:54:22 mb /bsd: uhub0 detached
> Apr 11 16:54:22 mb /bsd: uhub1 detached
> 
> Apr 11 16:54:31 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 16:54:31 mb /bsd: cpu0: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:54:31 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:54:31 mb /bsd: cpu7: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu4: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu6: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu5: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu1: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu3: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cp
> Apr 11 16:54:31 mb /bsd: u2: 1 wakeup events
> Apr 11 16:54:31 mb root: running /etc/apm/resume
> Apr 11 16:54:36 mb apmd: system resumed from sleep
> Apr 11 16:54:36 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 99% (834 minutes life time estimate)
> 
> (lidaction=1)
> 
> Apr 11 17:05:12 mb /bsd: uhub0 detached
> Apr 11 17:05:12 mb /bsd: uhub1 detached
> 
> Apr 11 17:05:20 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 17:05:20 mb /bsd: cpu0: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 17:05:20 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 17:05:20 mb /bsd: cpu7: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu5: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu4: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu6: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu2: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu3: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu1: 1 wakeup events
> Apr 11 17:05:20 mb root: running /etc/apm/resume
> Apr 11 17:05:26 mb apmd: system resumed from sleep
> Apr 11 17:05:26 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 98% (796 minutes life time estimate)
> 
> So even with lidaction=0 it kind-of-suspends,
> and kind-of-resumes, running /etc/apm/resume.
> Is that expected?
> 
> There also seems to be a difference between suspending with apm -z
> and suspending by closing the lid; namely, apm -z does call
> /etc/apm/suspend but the lid does not. Is that intended?
> 
> (apm -z)
> 
> Apr 11 16:55:30 mb apmd: system suspending
>^^^
> Apr 11 16:55:30 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 99% (712 minutes life time estimate)
> Apr 11 16:55:30 mb root: running /etc/apm/suspend
>  
> Apr 11 16:55:31 mb /bsd: uhub0 detached
> Apr 11 16:55:31 mb /bsd: uhub1 detached
> 
> Apr 11 16:55:37 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 16:55:37 mb /bsd: cpu0: 1 wakeup events
> Apr 11 16:55:37 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 

Re: lidaction on an M1 macbook

2023-06-22 Thread Jan Stary
ping

On Apr 11 18:29:50, h...@stare.cz wrote:
> > o On arm64, add a machdep.lidaction sysctl(8)
> > for aplsmc(4) Apple Silicon laptops.
> 
> Should that be mentioned in the arm64 examples/sysctl.conf
> as on other such architectures?
> 
> Index: etc/etc.arm64/sysctl.conf
> ===
> RCS file: /cvs/src/etc/etc.arm64/sysctl.conf,v
> retrieving revision 1.1
> diff -u -p -r1.1 sysctl.conf
> --- etc.arm64/sysctl.conf 11 Jan 2017 22:57:34 -  1.1
> +++ etc.arm64/sysctl.conf 11 Apr 2023 15:40:50 -
> @@ -0,0 +1 @@
> +#machdep.lidaction=0 # 1=suspend, 2=hibernate laptop upon lid closing
> 
> 
> > aplsmc(4) provides support for the lid position sensor.
> 
> Should that be mentioned in aplsmc(4)?
> 
> Index: aplsmc.4
> ===
> RCS file: /cvs/src/share/man/man4/man4.arm64/aplsmc.4,v
> retrieving revision 1.2
> diff -u -p -r1.2 aplsmc.4
> --- aplsmc.4  10 Jan 2022 21:16:44 -  1.2
> +++ aplsmc.4  11 Apr 2023 15:49:20 -
> @@ -28,7 +28,7 @@ The
>  driver provides support for the System Management Controller (SMC)
>  found on various Apple SoCs.
>  The driver provides a collection of current, fan, power, temperature,
> -voltage and battery information sensors.
> +voltage, lid position and battery information sensors.
>  .Pp
>  Sensor values are made available through the
>  .Xr sysctl 8
> 
> 
> > >  The arm64 default for the machdep.lidaction is 1, making the
> > >  system suspend when the lid is closed.
> 
> On this M1 macbook (dmesg below), I see no difference
> between lidaction=0 and lidaction=1; with both,
> closing and opening the lid does this:
> 
> (lidaction=0)
> 
> Apr 11 16:54:22 mb /bsd: uhub0 detached
> Apr 11 16:54:22 mb /bsd: uhub1 detached
> 
> Apr 11 16:54:31 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 16:54:31 mb /bsd: cpu0: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:54:31 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:54:31 mb /bsd: cpu7: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu4: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu6: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu5: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu1: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cpu3: 1 wakeup events
> Apr 11 16:54:31 mb /bsd: cp
> Apr 11 16:54:31 mb /bsd: u2: 1 wakeup events
> Apr 11 16:54:31 mb root: running /etc/apm/resume
> Apr 11 16:54:36 mb apmd: system resumed from sleep
> Apr 11 16:54:36 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 99% (834 minutes life time estimate)
> 
> (lidaction=1)
> 
> Apr 11 17:05:12 mb /bsd: uhub0 detached
> Apr 11 17:05:12 mb /bsd: uhub1 detached
> 
> Apr 11 17:05:20 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 17:05:20 mb /bsd: cpu0: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 17:05:20 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 17:05:20 mb /bsd: cpu7: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu5: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu4: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu6: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu2: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu3: 1 wakeup events
> Apr 11 17:05:20 mb /bsd: cpu1: 1 wakeup events
> Apr 11 17:05:20 mb root: running /etc/apm/resume
> Apr 11 17:05:26 mb apmd: system resumed from sleep
> Apr 11 17:05:26 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 98% (796 minutes life time estimate)
> 
> So even with lidaction=0 it kind-of-suspends,
> and kind-of-resumes, running /etc/apm/resume.
> Is that expected?
> 
> There also seems to be a difference between suspending with apm -z
> and suspending by closing the lid; namely, apm -z does call
> /etc/apm/suspend but the lid does not. Is that intended?
> 
> (apm -z)
> 
> Apr 11 16:55:30 mb apmd: system suspending
>^^^
> Apr 11 16:55:30 mb apmd: battery status: high. external power status: not 
> connected. estimated battery life 99% (712 minutes life time estimate)
> Apr 11 16:55:30 mb root: running /etc/apm/suspend
>  
> Apr 11 16:55:31 mb /bsd: uhub0 detached
> Apr 11 16:55:31 mb /bsd: uhub1 detached
> 
> Apr 11 16:55:37 mb /bsd: wsdisplay_switch2: not switching
> Apr 11 16:55:37 mb /bsd: cpu0: 1 wakeup events
> Apr 11 16:55:37 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:55:37 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
> xHCI root hub" rev 3.00/1.00 addr 1
> Apr 11 16:55:37 mb /bsd: cpu7: 1 wakeup 

lidaction on an M1 macbook

2023-04-11 Thread Jan Stary
> o On arm64, add a machdep.lidaction sysctl(8)
> for aplsmc(4) Apple Silicon laptops.

Should that be mentioned in the arm64 examples/sysctl.conf
as on other such architectures?

Index: etc/etc.arm64/sysctl.conf
===
RCS file: /cvs/src/etc/etc.arm64/sysctl.conf,v
retrieving revision 1.1
diff -u -p -r1.1 sysctl.conf
--- etc.arm64/sysctl.conf   11 Jan 2017 22:57:34 -  1.1
+++ etc.arm64/sysctl.conf   11 Apr 2023 15:40:50 -
@@ -0,0 +1 @@
+#machdep.lidaction=0   # 1=suspend, 2=hibernate laptop upon lid closing


> aplsmc(4) provides support for the lid position sensor.

Should that be mentioned in aplsmc(4)?

Index: aplsmc.4
===
RCS file: /cvs/src/share/man/man4/man4.arm64/aplsmc.4,v
retrieving revision 1.2
diff -u -p -r1.2 aplsmc.4
--- aplsmc.410 Jan 2022 21:16:44 -  1.2
+++ aplsmc.411 Apr 2023 15:49:20 -
@@ -28,7 +28,7 @@ The
 driver provides support for the System Management Controller (SMC)
 found on various Apple SoCs.
 The driver provides a collection of current, fan, power, temperature,
-voltage and battery information sensors.
+voltage, lid position and battery information sensors.
 .Pp
 Sensor values are made available through the
 .Xr sysctl 8


> >  The arm64 default for the machdep.lidaction is 1, making the
> >  system suspend when the lid is closed.

On this M1 macbook (dmesg below), I see no difference
between lidaction=0 and lidaction=1; with both,
closing and opening the lid does this:

(lidaction=0)

Apr 11 16:54:22 mb /bsd: uhub0 detached
Apr 11 16:54:22 mb /bsd: uhub1 detached

Apr 11 16:54:31 mb /bsd: wsdisplay_switch2: not switching
Apr 11 16:54:31 mb /bsd: cpu0: 1 wakeup events
Apr 11 16:54:31 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 16:54:31 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 16:54:31 mb /bsd: cpu7: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cpu4: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cpu6: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cpu5: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cpu1: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cpu3: 1 wakeup events
Apr 11 16:54:31 mb /bsd: cp
Apr 11 16:54:31 mb /bsd: u2: 1 wakeup events
Apr 11 16:54:31 mb root: running /etc/apm/resume
Apr 11 16:54:36 mb apmd: system resumed from sleep
Apr 11 16:54:36 mb apmd: battery status: high. external power status: not 
connected. estimated battery life 99% (834 minutes life time estimate)

(lidaction=1)

Apr 11 17:05:12 mb /bsd: uhub0 detached
Apr 11 17:05:12 mb /bsd: uhub1 detached

Apr 11 17:05:20 mb /bsd: wsdisplay_switch2: not switching
Apr 11 17:05:20 mb /bsd: cpu0: 1 wakeup events
Apr 11 17:05:20 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 17:05:20 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 17:05:20 mb /bsd: cpu7: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu5: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu4: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu6: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu2: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu3: 1 wakeup events
Apr 11 17:05:20 mb /bsd: cpu1: 1 wakeup events
Apr 11 17:05:20 mb root: running /etc/apm/resume
Apr 11 17:05:26 mb apmd: system resumed from sleep
Apr 11 17:05:26 mb apmd: battery status: high. external power status: not 
connected. estimated battery life 98% (796 minutes life time estimate)

So even with lidaction=0 it kind-of-suspends,
and kind-of-resumes, running /etc/apm/resume.
Is that expected?

There also seems to be a difference between suspending with apm -z
and suspending by closing the lid; namely, apm -z does call
/etc/apm/suspend but the lid does not. Is that intended?

(apm -z)

Apr 11 16:55:30 mb apmd: system suspending
   ^^^
Apr 11 16:55:30 mb apmd: battery status: high. external power status: not 
connected. estimated battery life 99% (712 minutes life time estimate)
Apr 11 16:55:30 mb root: running /etc/apm/suspend
 
Apr 11 16:55:31 mb /bsd: uhub0 detached
Apr 11 16:55:31 mb /bsd: uhub1 detached

Apr 11 16:55:37 mb /bsd: wsdisplay_switch2: not switching
Apr 11 16:55:37 mb /bsd: cpu0: 1 wakeup events
Apr 11 16:55:37 mb /bsd: uhub0 at usb0 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 16:55:37 mb /bsd: uhub1 at usb1 configuration 1 interface 0 "Generic 
xHCI root hub" rev 3.00/1.00 addr 1
Apr 11 16:55:37 mb /bsd: cpu7: 1 wakeup events
Apr 11 16:55:37 mb /bsd: cpu4: 1 wakeup events
Apr 11 16:55:37 mb /bsd: cpu5: 1 wakeup events
Apr 11 16:55:37 mb /bsd: cpu6: 1 wakeup events
Apr 11 16:55:37 mb /bsd: cpu2: 1 wakeup events
Apr 11 16:55:37 mb /bsd: cp
Apr 11 16:55:37 mb /bsd: u3: 1 wakeup events
Apr 11