Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2010 17:04:42 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r209471 - stable/8/sys/dev/acpica
Message-ID:  <201006231704.o5NH4gdt026598@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Jun 23 17:04:42 2010
New Revision: 209471
URL: http://svn.freebsd.org/changeset/base/209471

Log:
  MFC 209213:
  When updating individual CPU's lowest Cx state to use, never set it to a
  state lower than the lowest one supported by the current CPU.  This closes
  some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx
  states for individual CPUs were changing (e.g. unplugging the AC adapter
  of a laptop) that could result in panics.

Modified:
  stable/8/sys/dev/acpica/acpi_cpu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/ixgbe/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_cpu.c
==============================================================================
--- stable/8/sys/dev/acpica/acpi_cpu.c	Wed Jun 23 15:19:07 2010	(r209470)
+++ stable/8/sys/dev/acpica/acpi_cpu.c	Wed Jun 23 17:04:42 2010	(r209471)
@@ -1009,6 +1009,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no
 	if (isc->cpu_cx_count > cpu_cx_count)
 	    cpu_cx_count = isc->cpu_cx_count;
     }
+    if (sc->cpu_cx_lowest < cpu_cx_lowest)
+	acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1));
     ACPI_SERIAL_END(cpu);
 }
 
@@ -1204,7 +1206,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_
     ACPI_SERIAL_BEGIN(cpu);
     for (i = 0; i < cpu_ndevices; i++) {
 	sc = device_get_softc(cpu_devices[i]);
-	acpi_cpu_set_cx_lowest(sc, val);
+	acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1));
     }
     ACPI_SERIAL_END(cpu);
 



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