Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2012 08:12:51 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238193 - head/sys/dev/acpica
Message-ID:  <201207070812.q678CppW029426@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sat Jul  7 08:12:51 2012
New Revision: 238193
URL: http://svn.freebsd.org/changeset/base/238193

Log:
  acpi_cpu_cx_list: there is no need to re-evaluate cpu_non_c3 here
  
  cpu_non_c3 is already evaluated in acpi_cpu_cx_cst and in
  acpi_cpu_set_cx_lowest.
  Besides acpi_cpu_cx_list is not protected by any locking.
  
  As a result also move setting of cpu_can_deep_sleep to more appropriate
  places.
  
  MFC after:	2 weeks

Modified:
  head/sys/dev/acpica/acpi_cpu.c

Modified: head/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- head/sys/dev/acpica/acpi_cpu.c	Sat Jul  7 07:59:14 2012	(r238192)
+++ head/sys/dev/acpica/acpi_cpu.c	Sat Jul  7 08:12:51 2012	(r238193)
@@ -670,6 +670,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cp
 	    cx_ptr->trans_lat = AcpiGbl_FADT.C3Latency;
 	    cx_ptr++;
 	    sc->cpu_cx_count++;
+	    cpu_can_deep_sleep = 1;
 	}
     }
 }
@@ -761,7 +762,8 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *s
 				 "acpi_cpu%d: C3[%d] not available.\n",
 				 device_get_unit(sc->cpu_dev), i));
 		continue;
-	    }
+	    } else
+		cpu_can_deep_sleep = 1;
 	    break;
 	}
 
@@ -885,16 +887,10 @@ acpi_cpu_cx_list(struct acpi_cpu_softc *
     /*
      * Set up the list of Cx states
      */
-    sc->cpu_non_c3 = 0;
     sbuf_new(&sb, sc->cpu_cx_supported, sizeof(sc->cpu_cx_supported),
 	SBUF_FIXEDLEN);
-    for (i = 0; i < sc->cpu_cx_count; i++) {
+    for (i = 0; i < sc->cpu_cx_count; i++)
 	sbuf_printf(&sb, "C%d/%d ", i + 1, sc->cpu_cx_states[i].trans_lat);
-	if (sc->cpu_cx_states[i].type < ACPI_STATE_C3)
-	    sc->cpu_non_c3 = i;
-	else
-	    cpu_can_deep_sleep = 1;
-    }
     sbuf_trim(&sb);
     sbuf_finish(&sb);
 }	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207070812.q678CppW029426>