The resume powerhooks were always in the wrong place. Then when replaced by the device-tree activate walk it even worse since we were doing so much more work.  apm_suspend() could return into the event handler and thus tsleep() -- all this while we are supposedly trying to maintain splhigh because our DVACT_SUSPEND mechanism has temporarily totally wrecked the machine. Move the hardware restoration code (DVACT_RESUME + other goo) to the same function, and recognize that apm_resume() is just a boring event handler which punts the event to userland. ok oga
The resume powerhooks were always in the wrong place. Then when replaced
by the device-tree activate walk it even worse since we were doing so much
more work.  apm_suspend() could return into the event handler and thus
tsleep() -- all this while we are supposedly trying to maintain splhigh
because our DVACT_SUSPEND mechanism has temporarily totally wrecked the
machine.
Move the hardware restoration code (DVACT_RESUME + other goo) to the same
function, and recognize that apm_resume() is just a boring event handler
which punts the event to userland.
ok oga

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars