Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Adjust locking for previous.
details: https://anonhg.NetBSD.org/src/rev/1786eea9d820
branches: trunk
changeset: 757167:1786eea9d820
user: jruoho <jruoho%NetBSD.org@localhost>
date: Tue Aug 17 10:57:30 2010 +0000
description:
Adjust locking for previous.
diffstat:
sys/dev/acpi/acpi_cpu_pstate.c | 8 +++++---
sys/dev/acpi/acpi_cpu_tstate.c | 6 ++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diffs (65 lines):
diff -r a1867ce87433 -r 1786eea9d820 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c Tue Aug 17 10:35:22 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c Tue Aug 17 10:57:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.28 2010/08/17 10:35:22 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.29 2010/08/17 10:57:30 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.28 2010/08/17 10:35:22 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.29 2010/08/17 10:57:30 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -57,7 +57,7 @@
static void acpicpu_pstate_reset(struct acpicpu_softc *);
static void acpicpu_pstate_bios(void);
-static uint32_t acpicpu_pstate_saved;
+static uint32_t acpicpu_pstate_saved = 0;
void
acpicpu_pstate_attach(device_t self)
@@ -273,7 +273,9 @@
struct acpicpu_pstate *ps = NULL;
int32_t i;
+ mutex_enter(&sc->sc_mtx);
acpicpu_pstate_reset(sc);
+ mutex_exit(&sc->sc_mtx);
if (acpicpu_pstate_saved != 0)
return true;
diff -r a1867ce87433 -r 1786eea9d820 sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c Tue Aug 17 10:35:22 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c Tue Aug 17 10:57:30 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.13 2010/08/17 10:35:22 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.14 2010/08/17 10:57:30 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.13 2010/08/17 10:35:22 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.14 2010/08/17 10:57:30 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -209,7 +209,9 @@
{
struct acpicpu_softc *sc = device_private(self);
+ mutex_enter(&sc->sc_mtx);
acpicpu_tstate_reset(sc);
+ mutex_exit(&sc->sc_mtx);
return true;
}
Home |
Main Index |
Thread Index |
Old Index