diff options
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpi_cpu_pstate.c | 13 | ||||
| -rw-r--r-- | sys/dev/acpi/acpi_cpu_tstate.c | 11 |
2 files changed, 6 insertions, 18 deletions
diff --git a/sys/dev/acpi/acpi_cpu_pstate.c b/sys/dev/acpi/acpi_cpu_pstate.c index 8f303d6bf8c..6e375a016bf 100644 --- a/sys/dev/acpi/acpi_cpu_pstate.c +++ b/sys/dev/acpi/acpi_cpu_pstate.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_pstate.c,v 1.15 2010/08/13 16:21:50 jruoho Exp $ */ +/* $NetBSD: acpi_cpu_pstate.c,v 1.16 2010/08/13 18:44:24 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.15 2010/08/13 16:21:50 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.16 2010/08/13 18:44:24 jruoho Exp $"); #include <sys/param.h> #include <sys/evcnt.h> @@ -241,11 +241,9 @@ acpicpu_pstate_callback(void *aux) sc = device_private(self); mutex_enter(&sc->sc_mtx); - old = sc->sc_pstate_max; acpicpu_pstate_change(sc); new = sc->sc_pstate_max; - mutex_exit(&sc->sc_mtx); if (old != new) { @@ -595,8 +593,6 @@ acpicpu_pstate_get(struct acpicpu_softc *sc, uint32_t *freq) goto fail; } - mutex_enter(&sc->sc_mtx); - for (i = 0; i < sc->sc_pstate_count; i++) { if (sc->sc_pstate[i].ps_freq == 0) @@ -608,8 +604,6 @@ acpicpu_pstate_get(struct acpicpu_softc *sc, uint32_t *freq) } } - mutex_exit(&sc->sc_mtx); - if (__predict_false(ps == NULL)) { rv = EIO; goto fail; @@ -727,9 +721,8 @@ acpicpu_pstate_set(struct acpicpu_softc *sc, uint32_t freq) goto fail; } - ps->ps_evcnt.ev_count++; - mutex_enter(&sc->sc_mtx); + ps->ps_evcnt.ev_count++; sc->sc_pstate_current = freq; mutex_exit(&sc->sc_mtx); diff --git a/sys/dev/acpi/acpi_cpu_tstate.c b/sys/dev/acpi/acpi_cpu_tstate.c index b2cf95a2529..4b501f5e9f1 100644 --- a/sys/dev/acpi/acpi_cpu_tstate.c +++ b/sys/dev/acpi/acpi_cpu_tstate.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_cpu_tstate.c,v 1.1 2010/08/13 16:21:50 jruoho Exp $ */ +/* $NetBSD: acpi_cpu_tstate.c,v 1.2 2010/08/13 18:44:24 jruoho Exp $ */ /*- * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.1 2010/08/13 16:21:50 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.2 2010/08/13 18:44:24 jruoho Exp $"); #include <sys/param.h> #include <sys/kmem.h> @@ -655,8 +655,6 @@ acpicpu_tstate_get(struct acpicpu_softc *sc, uint32_t *percent) val = (val >> offset) & 0x0F; - mutex_enter(&sc->sc_mtx); - for (i = 0; i < sc->sc_tstate_count; i++) { if (sc->sc_tstate[i].ts_percent == 0) @@ -677,8 +675,6 @@ acpicpu_tstate_get(struct acpicpu_softc *sc, uint32_t *percent) } } - mutex_exit(&sc->sc_mtx); - if (__predict_false(ts == NULL)) { rv = EIO; goto fail; @@ -816,9 +812,8 @@ acpicpu_tstate_set(struct acpicpu_softc *sc, uint32_t percent) goto fail; } - ts->ts_evcnt.ev_count++; - mutex_enter(&sc->sc_mtx); + ts->ts_evcnt.ev_count++; sc->sc_tstate_current = percent; mutex_exit(&sc->sc_mtx); |
