Reset clock after atrtc(4) is properly resumed.
This commit is contained in:
@@ -291,7 +291,6 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
|||||||
if (!CPU_EMPTY(&wakeup_cpus))
|
if (!CPU_EMPTY(&wakeup_cpus))
|
||||||
acpi_wakeup_cpus(sc, &wakeup_cpus);
|
acpi_wakeup_cpus(sc, &wakeup_cpus);
|
||||||
#endif
|
#endif
|
||||||
acpi_resync_clock(sc);
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ static ACPI_STATUS acpi_EnterSleepState(struct acpi_softc *sc, int state);
|
|||||||
static void acpi_shutdown_final(void *arg, int howto);
|
static void acpi_shutdown_final(void *arg, int howto);
|
||||||
static void acpi_enable_fixed_events(struct acpi_softc *sc);
|
static void acpi_enable_fixed_events(struct acpi_softc *sc);
|
||||||
static BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
|
static BOOLEAN acpi_has_hid(ACPI_HANDLE handle);
|
||||||
|
static void acpi_resync_clock(struct acpi_softc *sc);
|
||||||
static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate);
|
static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate);
|
||||||
static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate);
|
static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate);
|
||||||
static int acpi_wake_prep_walk(int sstate);
|
static int acpi_wake_prep_walk(int sstate);
|
||||||
@@ -277,11 +278,13 @@ TUNABLE_INT("debug.acpi.interpreter_slack", &acpi_interpreter_slack);
|
|||||||
SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN,
|
SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN,
|
||||||
&acpi_interpreter_slack, 1, "Turn on interpreter slack mode.");
|
&acpi_interpreter_slack, 1, "Turn on interpreter slack mode.");
|
||||||
|
|
||||||
|
#ifdef __amd64__
|
||||||
/* Reset system clock while resuming. XXX Remove once tested. */
|
/* Reset system clock while resuming. XXX Remove once tested. */
|
||||||
static int acpi_reset_clock = 1;
|
static int acpi_reset_clock = 1;
|
||||||
TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock);
|
TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock);
|
||||||
SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
|
SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW,
|
||||||
&acpi_reset_clock, 1, "Reset system clock while resuming.");
|
&acpi_reset_clock, 1, "Reset system clock while resuming.");
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Allow users to override quirks. */
|
/* Allow users to override quirks. */
|
||||||
TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
|
TUNABLE_INT("debug.acpi.quirks", &acpi_quirks);
|
||||||
@@ -2741,8 +2744,10 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
|
|||||||
AcpiLeaveSleepState(state);
|
AcpiLeaveSleepState(state);
|
||||||
if (slp_state >= ACPI_SS_DEV_SUSPEND)
|
if (slp_state >= ACPI_SS_DEV_SUSPEND)
|
||||||
DEVICE_RESUME(root_bus);
|
DEVICE_RESUME(root_bus);
|
||||||
if (slp_state >= ACPI_SS_SLEPT)
|
if (slp_state >= ACPI_SS_SLEPT) {
|
||||||
|
acpi_resync_clock(sc);
|
||||||
acpi_enable_fixed_events(sc);
|
acpi_enable_fixed_events(sc);
|
||||||
|
}
|
||||||
sc->acpi_next_sstate = 0;
|
sc->acpi_next_sstate = 0;
|
||||||
|
|
||||||
mtx_unlock(&Giant);
|
mtx_unlock(&Giant);
|
||||||
@@ -2765,10 +2770,10 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state)
|
|||||||
return_ACPI_STATUS (status);
|
return_ACPI_STATUS (status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
acpi_resync_clock(struct acpi_softc *sc)
|
acpi_resync_clock(struct acpi_softc *sc)
|
||||||
{
|
{
|
||||||
|
#ifdef __amd64__
|
||||||
if (!acpi_reset_clock)
|
if (!acpi_reset_clock)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2778,6 +2783,7 @@ acpi_resync_clock(struct acpi_softc *sc)
|
|||||||
(void)timecounter->tc_get_timecount(timecounter);
|
(void)timecounter->tc_get_timecount(timecounter);
|
||||||
(void)timecounter->tc_get_timecount(timecounter);
|
(void)timecounter->tc_get_timecount(timecounter);
|
||||||
inittodr(time_second + sc->acpi_sleep_delay);
|
inittodr(time_second + sc->acpi_sleep_delay);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enable or disable the device's wake GPE. */
|
/* Enable or disable the device's wake GPE. */
|
||||||
|
|||||||
@@ -339,7 +339,6 @@ ACPI_STATUS acpi_SetIntrModel(int model);
|
|||||||
int acpi_ReqSleepState(struct acpi_softc *sc, int state);
|
int acpi_ReqSleepState(struct acpi_softc *sc, int state);
|
||||||
int acpi_AckSleepState(struct apm_clone_data *clone, int error);
|
int acpi_AckSleepState(struct apm_clone_data *clone, int error);
|
||||||
ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state);
|
ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state);
|
||||||
void acpi_resync_clock(struct acpi_softc *sc);
|
|
||||||
int acpi_wake_set_enable(device_t dev, int enable);
|
int acpi_wake_set_enable(device_t dev, int enable);
|
||||||
int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw);
|
int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw);
|
||||||
ACPI_STATUS acpi_Startup(void);
|
ACPI_STATUS acpi_Startup(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user