The ACPI specification requires us to call _PTS (prepare to sleep) and _TTS (transition to state) before we write to PM1a_CNT_BLK and PM1b_CNT_BLK. --- diff e3cd2bf512fee93d44d1f48c9813f15f81b21938 f72335db09b994351eed11ec537b329903b6731a --- a/sys/src/cmd/aux/acpi.c +++ b/sys/src/cmd/aux/acpi.c @@ -256,6 +256,7 @@ poweroff(void) { int n; + void *tts, *pts; if(facp == 0){ werrstr("no FACP"); @@ -263,6 +264,16 @@ } wirecpu0(); + + /* The ACPI spec requires we call _TTS and _PTS to prepare + * the system to go to _S5 state. If they fail, too bad, + * try to go to _S5 state anyway. */ + pts = amlval(amlwalk(amlroot, "_PTS")); + tts = amlval(amlwalk(amlroot, "_TTS")); + if(pts) + amleval(pts, "i", 5, nil); + if(tts) + amleval(tts, "i", 5, nil); /* disable GPEs */ for(n = 0; GPE0_BLK > 0 && n < GPE0_BLK_LEN/2; n += 2){