Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Check the 'sc->sc_cold' flag also in P-state co...
details: https://anonhg.NetBSD.org/src/rev/763661fd4ab5
branches: trunk
changeset: 757044:763661fd4ab5
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Aug 11 16:22:18 2010 +0000
description:
Check the 'sc->sc_cold' flag also in P-state code, and set this flag once
we start the detachment routine.
diffstat:
sys/dev/acpi/acpi_cpu.c | 9 +++++----
sys/dev/acpi/acpi_cpu_pstate.c | 14 ++++++++++++--
2 files changed, 17 insertions(+), 6 deletions(-)
diffs (85 lines):
diff -r e9410061b322 -r 763661fd4ab5 sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c Wed Aug 11 14:50:38 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.c Wed Aug 11 16:22:18 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.13 2010/08/08 18:47:54 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.14 2010/08/11 16:22:18 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.c,v 1.13 2010/08/08 18:47:54 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.14 2010/08/11 16:22:18 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -176,6 +176,7 @@
static ONCE_DECL(once_detach);
int rv = 0;
+ sc->sc_cold = true;
acpi_deregister_notify(sc->sc_node);
if ((sc->sc_flags & ACPICPU_FLAG_C) != 0)
@@ -500,14 +501,14 @@
{
struct acpicpu_softc *sc = device_private(self);
- sc->sc_cold = false;
-
if ((sc->sc_flags & ACPICPU_FLAG_C) != 0)
(void)acpicpu_cstate_resume(self);
if ((sc->sc_flags & ACPICPU_FLAG_P) != 0)
(void)acpicpu_pstate_resume(self);
+ sc->sc_cold = false;
+
return true;
}
diff -r e9410061b322 -r 763661fd4ab5 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c Wed Aug 11 14:50:38 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c Wed Aug 11 16:22:18 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.10 2010/08/11 13:02:59 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.11 2010/08/11 16:22:18 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.10 2010/08/11 13:02:59 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.11 2010/08/11 16:22:18 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -537,6 +537,11 @@
uint8_t width;
int rv;
+ if (sc->sc_cold != false) {
+ rv = EBUSY;
+ goto fail;
+ }
+
if ((sc->sc_flags & ACPICPU_FLAG_P) == 0) {
rv = ENODEV;
goto fail;
@@ -621,6 +626,11 @@
uint8_t width;
int rv;
+ if (sc->sc_cold != false) {
+ rv = EBUSY;
+ goto fail;
+ }
+
if ((sc->sc_flags & ACPICPU_FLAG_P) == 0) {
rv = ENODEV;
goto fail;
Home |
Main Index |
Thread Index |
Old Index