From owner-svn-src-stable@FreeBSD.ORG Wed Aug 29 08:44:22 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5ADB2106566C; Wed, 29 Aug 2012 08:44:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5208FC16; Wed, 29 Aug 2012 08:44:22 +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 q7T8iMiO014078; Wed, 29 Aug 2012 08:44:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7T8iLHk014076; Wed, 29 Aug 2012 08:44:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201208290844.q7T8iLHk014076@svn.freebsd.org> From: Andriy Gapon Date: Wed, 29 Aug 2012 08:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239810 - stable/8/sys/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: Wed, 29 Aug 2012 08:44:22 -0000 Author: avg Date: Wed Aug 29 08:44:21 2012 New Revision: 239810 URL: http://svn.freebsd.org/changeset/base/239810 Log: MFC r215188: Create C1 state when _CST is valid but _CST does not have one. On behalf of: jkim Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:39:58 2012 (r239809) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Aug 29 08:44:21 2012 (r239810) @@ -705,9 +705,19 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s count = MAX_CX_STATES; } - /* Set up all valid states. */ + sc->cpu_non_c3 = 0; sc->cpu_cx_count = 0; cx_ptr = sc->cpu_cx_states; + + /* + * C1 has been required since just after ACPI 1.0. + * Reserve the first slot for it. + */ + cx_ptr->type = ACPI_STATE_C0; + cx_ptr++; + sc->cpu_cx_count++; + + /* Set up all valid states. */ for (i = 0; i < count; i++) { pkg = &top->Package.Elements[i + 1]; if (!ACPI_PKG_VALID(pkg, 4) || @@ -722,9 +732,14 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s /* Validate the state to see if we should use it. */ switch (cx_ptr->type) { case ACPI_STATE_C1: - sc->cpu_non_c3 = i; - cx_ptr++; - sc->cpu_cx_count++; + if (sc->cpu_cx_states[0].type == ACPI_STATE_C0) { + /* This is the first C1 state. Use the reserved slot. */ + sc->cpu_cx_states[0] = *cx_ptr; + } else { + sc->cpu_non_c3 = i; + cx_ptr++; + sc->cpu_cx_count++; + } continue; case ACPI_STATE_C2: sc->cpu_non_c3 = i; @@ -763,6 +778,13 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s } AcpiOsFree(buf.Pointer); + /* If C1 state was not found, we need one now. */ + cx_ptr = sc->cpu_cx_states; + if (cx_ptr->type == ACPI_STATE_C0) { + cx_ptr->type = ACPI_STATE_C1; + cx_ptr->trans_lat = 0; + } + return (0); }