diff options
author | 2012-10-08 21:47:45 +0000 | |
---|---|---|
committer | 2012-10-08 21:47:45 +0000 | |
commit | 1e4b376cc93a4177cfbe219c9001277edc699d6c (patch) | |
tree | 3a10a5466f2dc80a042bbdf6dadcba6f503a8dee /sys/dev/acpi/acpi.c | |
parent | disk space is cheap but we still want to limit the default size of a body (diff) | |
download | wireguard-openbsd-1e4b376cc93a4177cfbe219c9001277edc699d6c.tar.xz wireguard-openbsd-1e4b376cc93a4177cfbe219c9001277edc699d6c.zip |
Revamp the sequences for suspend/hibernate -> resume so that the code
paths are reflexive. It is now possible to fail part-way through a
suspend sequence, and recover along the resume code path.
Split DVACT_SUSPEND by adding a new DVACT_POWERDOWN method is used
after hibernate (and suspend too) to finish the job. Some drivers
must be converted at the same time to use this instead of shutdown hooks
(the others will follow at a later time)
ok kettenis mlarkin
Diffstat (limited to 'sys/dev/acpi/acpi.c')
-rw-r--r-- | sys/dev/acpi/acpi.c | 431 |
1 files changed, 176 insertions, 255 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index b3468d22cb6..5bd1162cf6a 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.240 2012/10/04 08:32:20 ehrhardt Exp $ */ +/* $OpenBSD: acpi.c,v 1.241 2012/10/08 21:47:50 deraadt Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -102,7 +102,6 @@ void acpi_pbtn_task(void *, int); int acpi_thinkpad_enabled; int acpi_toshiba_enabled; int acpi_asus_enabled; -int acpi_saved_spl; int acpi_saved_boothowto; int acpi_enabled; @@ -112,9 +111,8 @@ int acpi_matchhids(struct acpi_attach_args *aa, const char *hids[], void acpi_thread(void *); void acpi_create_thread(void *); void acpi_init_pm(struct acpi_softc *); - -void acpi_handle_suspend_failure(struct acpi_softc *); void acpi_init_gpes(struct acpi_softc *); +void acpi_indicator(struct acpi_softc *, int); int acpi_founddock(struct aml_node *, void *); int acpi_foundpss(struct aml_node *, void *); @@ -140,7 +138,6 @@ struct idechnl { int64_t sta; }; -void acpi_resume(struct acpi_softc *, int); int acpi_add_device(struct aml_node *node, void *arg); struct gpe_block *acpi_find_gpe(struct acpi_softc *, int); @@ -579,20 +576,21 @@ acpi_pci_min_powerstate(pci_chipset_tag_t pc, pcitag_t tag) { struct acpi_pci *pdev; int bus, dev, fun; - int state; + int state = -1, defaultstate = pci_get_powerstate(pc, tag); pci_decompose_tag(pc, tag, &bus, &dev, &fun); TAILQ_FOREACH(pdev, &acpi_pcidevs, next) { if (pdev->bus == bus && pdev->dev == dev && pdev->fun == fun) { - switch (acpi_softc->sc_nextstate) { + switch (acpi_softc->sc_state) { case ACPI_STATE_S3: + defaultstate = PCI_PMCSR_STATE_D3; state = MAX(pdev->_s3d, pdev->_s3w); break; case ACPI_STATE_S4: state = MAX(pdev->_s4d, pdev->_s4w); break; + case ACPI_STATE_S5: default: - state = -1; break; } @@ -602,7 +600,7 @@ acpi_pci_min_powerstate(pci_chipset_tag_t pc, pcitag_t tag) } } - return PCI_PMCSR_STATE_D3; + return defaultstate; } void @@ -637,6 +635,7 @@ acpi_attach(struct device *parent, struct device *self, void *aux) struct device *dev; struct acpi_ac *ac; struct acpi_bat *bat; + int s; #endif /* SMALL_KERNEL */ paddr_t facspa; @@ -761,7 +760,9 @@ acpi_attach(struct device *parent, struct device *self, void *aux) #ifndef SMALL_KERNEL /* Initialize GPE handlers */ + s = spltty(); acpi_init_gpes(sc); + splx(s); /* some devices require periodic polling */ timeout_set(&sc->sc_dev_timeout, acpi_poll, sc); @@ -1456,6 +1457,9 @@ acpi_reset(void) struct acpi_softc *sc = acpi_softc; struct acpi_fadt *fadt = sc->sc_fadt; + if (acpi_enabled == 0) + return; + /* * RESET_REG_SUP is not properly set in some implementations, * but not testing against it breaks more machines than it fixes @@ -1695,43 +1699,36 @@ void acpi_enable_onegpe(struct acpi_softc *sc, int gpe) { uint8_t mask, en; - int s; /* Read enabled register */ - s = spltty(); mask = (1L << (gpe & 7)); en = acpi_read_pmreg(sc, ACPIREG_GPE_EN, gpe>>3); dnprintf(50, "enabling GPE %.2x (current: %sabled) %.2x\n", gpe, (en & mask) ? "en" : "dis", en); acpi_write_pmreg(sc, ACPIREG_GPE_EN, gpe>>3, en | mask); - splx(s); } /* Clear all GPEs */ void acpi_disable_allgpes(struct acpi_softc *sc) { - int idx, s; + int idx; - s = spltty(); for (idx = 0; idx < sc->sc_lastgpe; idx += 8) { acpi_write_pmreg(sc, ACPIREG_GPE_EN, idx >> 3, 0); acpi_write_pmreg(sc, ACPIREG_GPE_STS, idx >> 3, -1); } - splx(s); } /* Enable runtime GPEs */ void acpi_enable_rungpes(struct acpi_softc *sc) { - int s, idx; + int idx; - s = spltty(); for (idx = 0; idx < sc->sc_lastgpe; idx++) if (sc->gpe_table[idx].handler) acpi_enable_onegpe(sc, idx); - splx(s); } /* Enable wakeup GPEs */ @@ -1739,9 +1736,7 @@ void acpi_enable_wakegpes(struct acpi_softc *sc, int state) { struct acpi_wakeq *wentry; - int s; - s = spltty(); SIMPLEQ_FOREACH(wentry, &sc->sc_wakedevs, q_next) { dnprintf(10, "%.4s(S%d) gpe %.2x\n", wentry->q_node->name, wentry->q_state, @@ -1749,7 +1744,6 @@ acpi_enable_wakegpes(struct acpi_softc *sc, int state) if (state <= wentry->q_state) acpi_enable_onegpe(sc, wentry->q_gpe); } - splx(s); } int @@ -1778,19 +1772,15 @@ acpi_gpe(struct acpi_softc *sc, int gpe, void *arg) { struct aml_node *node = arg; uint8_t mask, en; - int s; dnprintf(10, "handling GPE %.2x\n", gpe); aml_evalnode(sc, node, 0, NULL, NULL); - s = spltty(); mask = (1L << (gpe & 7)); if (!sc->gpe_table[gpe].edge) acpi_write_pmreg(sc, ACPIREG_GPE_STS, gpe>>3, mask); en = acpi_read_pmreg(sc, ACPIREG_GPE_EN, gpe>>3); acpi_write_pmreg(sc, ACPIREG_GPE_EN, gpe>>3, en | mask); - splx(s); - return (0); } @@ -1894,45 +1884,21 @@ acpi_init_pm(struct acpi_softc *sc) sc->sc_sst = aml_searchname(&aml_root, "_SI_._SST"); } -int -acpi_sleep_state(struct acpi_softc *sc, int state) +void +acpi_sleep_pm(struct acpi_softc *sc, int state) { - int ret; - - switch (state) { - case ACPI_STATE_S0: - case ACPI_STATE_S1: - case ACPI_STATE_S2: - case ACPI_STATE_S5: - return (0); - } + uint16_t rega, regb, regra, regrb; + int retry = 0; - if (sc->sc_sleeptype[state].slp_typa == -1 || - sc->sc_sleeptype[state].slp_typb == -1) - return (EOPNOTSUPP); - - if ((ret = acpi_prepare_sleep_state(sc, state)) != 0) - return (ret); - - ret = acpi_sleep_machdep(sc, state); - -#ifndef SMALL_KERNEL - acpi_resume(sc, state); -#endif /* !SMALL_KERNEL */ - return (ret); -} - -int -acpi_enter_sleep_state(struct acpi_softc *sc, int state) -{ - uint16_t rega, regb; - int retries; + disable_intr(); /* Clear WAK_STS bit */ acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_WAK_STS); - /* Disable BM arbitration */ - acpi_write_pmreg(sc, ACPIREG_PM2_CNT, 0, ACPI_PM2_ARB_DIS); + /* Disable BM arbitration at deep sleep and beyond */ + if (state >= ACPI_STATE_S3 && + sc->sc_fadt->pm2_cnt_blk && sc->sc_fadt->pm2_cnt_len) + acpi_write_pmreg(sc, ACPIREG_PM2_CNT, 0, ACPI_PM2_ARB_DIS); /* Write SLP_TYPx values */ rega = acpi_read_pmreg(sc, ACPIREG_PM1A_CNT, 0); @@ -1944,259 +1910,194 @@ acpi_enter_sleep_state(struct acpi_softc *sc, int state) acpi_write_pmreg(sc, ACPIREG_PM1A_CNT, 0, rega); acpi_write_pmreg(sc, ACPIREG_PM1B_CNT, 0, regb); - /* Set SLP_EN bit */ + /* Loop on WAK_STS, setting the SLP_EN bits once in a while */ rega |= ACPI_PM1_SLP_EN; regb |= ACPI_PM1_SLP_EN; + while (1) { + if (retry == 0) { + acpi_write_pmreg(sc, ACPIREG_PM1A_CNT, 0, rega); + acpi_write_pmreg(sc, ACPIREG_PM1B_CNT, 0, regb); + } + retry = (retry + 1) % 100000; - /* - * Let the machdep code flush caches and do any other necessary - * tasks before going away. - */ - acpi_cpu_flush(sc, state); - - /* - * XXX The following sequence is probably not right. - */ - acpi_write_pmreg(sc, ACPIREG_PM1A_CNT, 0, rega); - acpi_write_pmreg(sc, ACPIREG_PM1B_CNT, 0, regb); - - /* Loop on WAK_STS */ - for (retries = 1000; retries > 0; retries--) { - rega = acpi_read_pmreg(sc, ACPIREG_PM1A_STS, 0); - regb = acpi_read_pmreg(sc, ACPIREG_PM1B_STS, 0); - if ((rega & ACPI_PM1_WAK_STS) || - (regb & ACPI_PM1_WAK_STS)) + regra = acpi_read_pmreg(sc, ACPIREG_PM1A_STS, 0); + regrb = acpi_read_pmreg(sc, ACPIREG_PM1B_STS, 0); + if ((regra & ACPI_PM1_WAK_STS) || + (regrb & ACPI_PM1_WAK_STS)) break; - DELAY(1000); } - - return (-1); } void -acpi_resume(struct acpi_softc *sc, int state) +acpi_resume_pm(struct acpi_softc *sc, int fromstate) { - struct aml_value env; + uint16_t rega, regb, en; - memset(&env, 0, sizeof(env)); - env.type = AML_OBJTYPE_INTEGER; - env.v_integer = sc->sc_state; + /* Write SLP_TYPx values */ + rega = acpi_read_pmreg(sc, ACPIREG_PM1A_CNT, 0); + regb = acpi_read_pmreg(sc, ACPIREG_PM1B_CNT, 0); + rega &= ~(ACPI_PM1_SLP_TYPX_MASK | ACPI_PM1_SLP_EN); + regb &= ~(ACPI_PM1_SLP_TYPX_MASK | ACPI_PM1_SLP_EN); + rega |= ACPI_PM1_SLP_TYPX(sc->sc_sleeptype[ACPI_STATE_S0].slp_typa); + regb |= ACPI_PM1_SLP_TYPX(sc->sc_sleeptype[ACPI_STATE_S0].slp_typb); + acpi_write_pmreg(sc, ACPIREG_PM1A_CNT, 0, rega); + acpi_write_pmreg(sc, ACPIREG_PM1B_CNT, 0, regb); /* Force SCI_EN on resume to fix horribly broken machines */ acpi_write_pmreg(sc, ACPIREG_PM1_CNT, 0, ACPI_PM1_SCI_EN); /* Clear fixed event status */ - acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, - ACPI_PM1_ALL_STS); + acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS); - if (sc->sc_bfs) - if (aml_evalnode(sc, sc->sc_bfs, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _BFS failed.\n", - DEVNAME(sc)); - } - - if (sc->sc_wak) - if (aml_evalnode(sc, sc->sc_wak, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _WAK failed.\n", - DEVNAME(sc)); - } - - /* Reset the indicator lights to "waking" */ - if (sc->sc_sst) { - env.v_integer = ACPI_SST_WAKING; - aml_evalnode(sc, sc->sc_sst, 1, &env, NULL); - } + /* acpica-reference.pdf page 148 says do not call _BFS */ + /* 1st resume AML step: _BFS(fromstate) */ + aml_node_setval(sc, sc->sc_bfs, fromstate); /* Enable runtime GPEs */ acpi_disable_allgpes(sc); acpi_enable_rungpes(sc); - if (state == ACPI_STATE_S4) - boothowto = acpi_saved_boothowto; - - config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); - - cold = 0; - enable_intr(); - splx(acpi_saved_spl); + acpi_indicator(sc, ACPI_SST_WAKING); - acpi_resume_machdep(); + /* 2nd resume AML step: _WAK(fromstate) */ + aml_node_setval(sc, sc->sc_wak, fromstate); - sc->sc_state = ACPI_STATE_S0; - if (sc->sc_tts) { - env.v_integer = sc->sc_state; - if (aml_evalnode(sc, sc->sc_tts, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _TTS failed.\n", - DEVNAME(sc)); - } - } + /* Clear WAK_STS bit */ + acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_WAK_STS); - /* disable _LID for wakeup */ - acpibtn_disable_psw(); + en = acpi_read_pmreg(sc, ACPIREG_PM1_EN, 0); + if (!(sc->sc_fadt->flags & FADT_PWR_BUTTON)) + en |= ACPI_PM1_PWRBTN_EN; + if (!(sc->sc_fadt->flags & FADT_SLP_BUTTON)) + en |= ACPI_PM1_SLPBTN_EN; + acpi_write_pmreg(sc, ACPIREG_PM1_EN, 0, en); - /* Reset the indicator lights to "working" */ - if (sc->sc_sst) { - env.v_integer = ACPI_SST_WORKING; - aml_evalnode(sc, sc->sc_sst, 1, &env, NULL); + /* + * If PM2 exists, re-enable BM arbitration (reportedly some + * BIOS forget to) + */ + if (sc->sc_fadt->pm2_cnt_blk && sc->sc_fadt->pm2_cnt_len) { + rega = acpi_read_pmreg(sc, ACPIREG_PM2_CNT, 0); + rega &= ~ACPI_PM2_ARB_DIS; + acpi_write_pmreg(sc, ACPIREG_PM2_CNT, 0, rega); } - -#ifdef MULTIPROCESSOR - sched_start_secondary_cpus(); -#endif - - acpi_record_event(sc, APM_NORMAL_RESUME); - - bufq_restart(); - -#if NWSDISPLAY > 0 - wsdisplay_resume(); -#endif /* NWSDISPLAY > 0 */ } +/* Set the indicator light to some state */ void -acpi_handle_suspend_failure(struct acpi_softc *sc) +acpi_indicator(struct acpi_softc *sc, int led_state) { - struct aml_value env; + static int save_led_state = -1; - /* Undo a partial suspend. Devices will have already been resumed */ - cold = 0; - enable_intr(); - splx(acpi_saved_spl); - - /* Tell ACPI to go back to S0 */ - memset(&env, 0, sizeof(env)); - env.type = AML_OBJTYPE_INTEGER; - sc->sc_state = ACPI_STATE_S0; - if (sc->sc_tts) { - env.v_integer = sc->sc_state; - if (aml_evalnode(sc, sc->sc_tts, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _TTS failed.\n", - DEVNAME(sc)); - } + if (save_led_state != led_state) { + aml_node_setval(sc, sc->sc_sst, led_state); + save_led_state = led_state; } - - /* disable _LID for wakeup */ - acpibtn_disable_psw(); - - /* Reset the indicator lights to "working" */ - if (sc->sc_sst) { - env.v_integer = ACPI_SST_WORKING; - aml_evalnode(sc, sc->sc_sst, 1, &env, NULL); - } - -#ifdef MULTIPROCESSOR - sched_start_secondary_cpus(); -#endif } int -acpi_prepare_sleep_state(struct acpi_softc *sc, int state) +acpi_sleep_state(struct acpi_softc *sc, int state) { - struct aml_value env; - int error = 0; + int error = ENXIO; + int s; - if (sc == NULL || state == ACPI_STATE_S0) - return(0); + switch (state) { + case ACPI_STATE_S0: + return (0); + case ACPI_STATE_S1: + return (EOPNOTSUPP); + case ACPI_STATE_S5: /* only sleep states handled here */ + return (EOPNOTSUPP); + } if (sc->sc_sleeptype[state].slp_typa == -1 || sc->sc_sleeptype[state].slp_typb == -1) { printf("%s: state S%d unavailable\n", sc->sc_dev.dv_xname, state); - return (ENXIO); + return (EOPNOTSUPP); } -#ifdef MULTIPROCESSOR - sched_stop_secondary_cpus(); - KASSERT(CPU_IS_PRIMARY(curcpu())); -#endif - - sc->sc_nextstate = state; - - memset(&env, 0, sizeof(env)); - env.type = AML_OBJTYPE_INTEGER; - env.v_integer = state; - /* _TTS(state) */ - if (sc->sc_tts) - if (aml_evalnode(sc, sc->sc_tts, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _TTS failed.\n", - DEVNAME(sc)); - return (ENXIO); - } - - if (state == ACPI_STATE_S4) - printf("%s: hibernating to disk ...\n", DEVNAME(sc)); + /* 1st suspend AML step: _TTS(tostate) */ + if (aml_node_setval(sc, sc->sc_tts, state) != 0) + goto fail_tts; + acpi_indicator(sc, ACPI_SST_WAKING); /* blink */ #if NWSDISPLAY > 0 - if (state == ACPI_STATE_S3 || state == ACPI_STATE_S4) - wsdisplay_suspend(); + wsdisplay_suspend(); #endif /* NWSDISPLAY > 0 */ + bufq_quiesce(); - if (state == ACPI_STATE_S3) - resettodr(); + if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_QUIESCE)) + goto fail_quiesce; - bufq_quiesce(); - config_suspend(TAILQ_FIRST(&alldevs), DVACT_QUIESCE); +#ifdef MULTIPROCESSOR + acpi_sleep_mp(); +#endif - acpi_saved_spl = splhigh(); - disable_intr(); - cold = 1; - if (state == ACPI_STATE_S4) { - acpi_saved_boothowto = boothowto; - boothowto = RB_RDONLY; - } - if (state == ACPI_STATE_S3 || state == ACPI_STATE_S4) - if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND) != 0) { - acpi_handle_suspend_failure(sc); - error = ENXIO; - goto fail; - } + resettodr(); - /* _PTS(state) */ - if (sc->sc_pts) - if (aml_evalnode(sc, sc->sc_pts, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _PTS failed.\n", - DEVNAME(sc)); - error = ENXIO; - goto fail; - } + s = splhigh(); + disable_intr(); /* PSL_I for resume; PIC/APIC broken until repair */ + cold = 1; /* Force other code to delay() instead of tsleep() */ - /* enable _LID for wakeup */ - acpibtn_enable_psw(); + if (config_suspend(TAILQ_FIRST(&alldevs), DVACT_SUSPEND) != 0) + goto fail_suspend; + acpi_sleep_clocks(sc, state); - /* Reset the indicator lights to "sleeping" */ - if (sc->sc_sst) { - env.v_integer = ACPI_SST_SLEEPING; - aml_evalnode(sc, sc->sc_sst, 1, &env, NULL); - } - env.v_integer = state; + /* 2nd suspend AML step: _PTS(tostate) */ + if (aml_node_setval(sc, sc->sc_pts, state) != 0) + goto fail_pts; - sc->sc_state = state; - /* _GTS(state) */ - if (sc->sc_gts) - if (aml_evalnode(sc, sc->sc_gts, 1, &env, NULL) != 0) { - dnprintf(10, "%s evaluating method _GTS failed.\n", - DEVNAME(sc)); - error = ENXIO; - goto fail; - } + acpibtn_enable_psw(); /* enable _LID for wakeup */ + acpi_indicator(sc, ACPI_SST_SLEEPING); + + /* 3rd suspend AML step: _GTS(tostate) */ + aml_node_setval(sc, sc->sc_gts, state); /* Clear fixed event status */ - acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, - ACPI_PM1_ALL_STS); + acpi_write_pmreg(sc, ACPIREG_PM1_STS, 0, ACPI_PM1_ALL_STS); /* Enable wake GPEs */ acpi_disable_allgpes(sc); acpi_enable_wakegpes(sc, state); -fail: - if (error) { - bufq_restart(); + /* Sleep */ + sc->sc_state = state; + error = acpi_sleep_cpu(sc, state); + sc->sc_state = ACPI_STATE_S0; + /* Resume */ + + acpi_resume_clocks(sc); /* AML may need clocks */ + acpi_resume_pm(sc, state); + acpi_resume_cpu(sc); + acpibtn_disable_psw(); /* disable _LID for wakeup */ + +fail_pts: + config_suspend(TAILQ_FIRST(&alldevs), DVACT_RESUME); + +fail_suspend: + cold = 0; + enable_intr(); + splx(s); + + inittodr(time_second); + /* 3rd resume AML step: _TTS(runstate) */ + aml_node_setval(sc, sc->sc_tts, sc->sc_state); + +#ifdef MULTIPROCESSOR + acpi_resume_mp(); +#endif + +fail_quiesce: + bufq_restart(); #if NWSDISPLAY > 0 - wsdisplay_resume(); + wsdisplay_resume(); #endif /* NWSDISPLAY > 0 */ - } + acpi_record_event(sc, APM_NORMAL_RESUME); + acpi_indicator(sc, ACPI_SST_WORKING); +fail_tts: return (error); } @@ -2209,17 +2110,37 @@ acpi_wakeup(void *arg) wakeup(sc); } +/* XXX + * We are going to do AML execution but are not in the acpi thread. + * We do not know if the acpi thread is sleeping on acpiec in some + * intermediate context. Wish us luck. + */ void acpi_powerdown(void) { - /* - * In case acpi_prepare_sleep fails, we shouldn't try to enter - * the sleep state. It might cost us the battery. - */ - acpi_disable_allgpes(acpi_softc); - acpi_enable_wakegpes(acpi_softc, ACPI_STATE_S5); - if (acpi_prepare_sleep_state(acpi_softc, ACPI_STATE_S5) == 0) - acpi_enter_sleep_state(acpi_softc, ACPI_STATE_S5); + int state = ACPI_STATE_S5, s; + struct acpi_softc *sc = acpi_softc; + + if (acpi_enabled == 0) + return; + + s = splhigh(); + disable_intr(); + cold = 1; + + /* 1st powerdown AML step: _PTS(tostate) */ + aml_node_setval(sc, sc->sc_pts, state); + + acpi_disable_allgpes(sc); + acpi_enable_wakegpes(sc, state); + + /* 2nd powerdown AML step: _GTS(tostate) */ + aml_node_setval(sc, sc->sc_gts, state); + + acpi_sleep_pm(sc, state); + panic("acpi S5 transition did not happen"); + while (1) + ; } void @@ -2254,10 +2175,10 @@ acpi_thread(void *arg) if (!(sc->sc_fadt->flags & FADT_SLP_BUTTON)) en |= ACPI_PM1_SLPBTN_EN; acpi_write_pmreg(sc, ACPIREG_PM1_EN, 0, en); - splx(s); /* Enable handled GPEs here */ acpi_enable_rungpes(sc); + splx(s); } while (thread->running) { |