From owner-svn-src-stable@FreeBSD.ORG Thu Feb 23 22:15:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7631065677; Thu, 23 Feb 2012 22:15:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 289118FC19; Thu, 23 Feb 2012 22:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1NMFvCR026984; Thu, 23 Feb 2012 22:15:57 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1NMFuWe026980; Thu, 23 Feb 2012 22:15:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202232215.q1NMFuWe026980@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 23 Feb 2012 22:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232084 - in stable/9/sys: amd64/acpica dev/acpica X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2012 22:15:57 -0000 Author: jkim Date: Thu Feb 23 22:15:56 2012 New Revision: 232084 URL: http://svn.freebsd.org/changeset/base/232084 Log: MFC: r231227 Reset clock after atrtc(4) is properly resumed. Modified: stable/9/sys/amd64/acpica/acpi_wakeup.c stable/9/sys/dev/acpica/acpi.c stable/9/sys/dev/acpica/acpivar.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- stable/9/sys/amd64/acpica/acpi_wakeup.c Thu Feb 23 22:10:49 2012 (r232083) +++ stable/9/sys/amd64/acpica/acpi_wakeup.c Thu Feb 23 22:15:56 2012 (r232084) @@ -297,7 +297,6 @@ acpi_sleep_machdep(struct acpi_softc *sc if (!CPU_EMPTY(&wakeup_cpus)) acpi_wakeup_cpus(sc, &wakeup_cpus); #endif - acpi_resync_clock(sc); ret = 0; } Modified: stable/9/sys/dev/acpica/acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi.c Thu Feb 23 22:10:49 2012 (r232083) +++ stable/9/sys/dev/acpica/acpi.c Thu Feb 23 22:15:56 2012 (r232084) @@ -152,6 +152,7 @@ static ACPI_STATUS acpi_EnterSleepState( static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); 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_run_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_prep_walk(int sstate); @@ -277,11 +278,13 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); +#ifdef __amd64__ /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW, &acpi_reset_clock, 1, "Reset system clock while resuming."); +#endif /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -2735,8 +2738,10 @@ backout: AcpiLeaveSleepState(state); if (slp_state >= ACPI_SS_DEV_SUSPEND) 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); + } sc->acpi_next_sstate = 0; mtx_unlock(&Giant); @@ -2759,10 +2764,10 @@ backout: return_ACPI_STATUS (status); } -void +static void acpi_resync_clock(struct acpi_softc *sc) { - +#ifdef __amd64__ if (!acpi_reset_clock) return; @@ -2772,6 +2777,7 @@ acpi_resync_clock(struct acpi_softc *sc) (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); inittodr(time_second + sc->acpi_sleep_delay); +#endif } /* Enable or disable the device's wake GPE. */ Modified: stable/9/sys/dev/acpica/acpivar.h ============================================================================== --- stable/9/sys/dev/acpica/acpivar.h Thu Feb 23 22:10:49 2012 (r232083) +++ stable/9/sys/dev/acpica/acpivar.h Thu Feb 23 22:15:56 2012 (r232084) @@ -339,7 +339,6 @@ ACPI_STATUS acpi_SetIntrModel(int model) int acpi_ReqSleepState(struct acpi_softc *sc, int state); int acpi_AckSleepState(struct apm_clone_data *clone, int error); 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_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); ACPI_STATUS acpi_Startup(void);