On Fri, Jan 30, 2015 at 05:44:25PM -0500, Ted Unangst wrote: > On Sat, Jan 31, 2015 at 00:24, Ville Valkonen wrote: > > Hello Mike and Max, > > > > my work laptop is running Windows and on there one must press power button > > to wake up the machine. If I connect the dots right, current behaviour was > > implemented to prevent a "hot bag" problem. Mimicking the Windows behaviour > > would also prevent laptop wake ups on a bumpy road. > > > > Would it make any sense to mimic this behaviour in obsd? > > This obviously depends on your windows config. My windows laptop > resumes whenver I open the lid. > > Now what can maybe be improved would be to add a check for which wakeup > event we received. If somebody pushed the power button, the lid > closed check should probably be skipped. If the wakeup event was lid > opening, then making sure the lid really is open makes sense.
What Ted says makes sense. Unfortunately, it's a bit more difficult than it seems to obtain the wake source. 1. Not all machines (very few in fact) implement _SWS 2. Instrumenting a few machines to check GPEs on wake, I found that none of them were asserted in the lid-open case, the power-button case, and a few others as well. This likely means we are wiping out the status before we check it. When I checked the status during early init instead, the GPE status bits were either all on, or all off, or filled with random data. In a nutshell, I haven't yet found a good way to determine the wake source that works on all machines. A diff that properly does this would certainly be welcome and go a long way toward fixing a lot of this nonsense. -ml
