Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Do not queue functions via sysmon_taskq(9) in t...
details: https://anonhg.NetBSD.org/src/rev/fab598125395
branches: trunk
changeset: 757079:fab598125395
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sat Aug 14 05:41:22 2010 +0000
description:
Do not queue functions via sysmon_taskq(9) in the pmf(9) resume hooks.
There is a small and unlikely race when the drivers are loaded as modules;
suspend, resume, queue a function, and immediately unload the module.
diffstat:
sys/dev/acpi/acpi_acad.c | 6 +++---
sys/dev/acpi/acpi_bat.c | 8 ++++----
sys/dev/acpi/acpi_cpu_cstate.c | 7 +++----
sys/dev/acpi/acpi_cpu_pstate.c | 8 +++-----
sys/dev/acpi/acpi_cpu_tstate.c | 8 ++++----
5 files changed, 17 insertions(+), 20 deletions(-)
diffs (148 lines):
diff -r d6517691f645 -r fab598125395 sys/dev/acpi/acpi_acad.c
--- a/sys/dev/acpi/acpi_acad.c Sat Aug 14 05:13:20 2010 +0000
+++ b/sys/dev/acpi/acpi_acad.c Sat Aug 14 05:41:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_acad.c,v 1.44 2010/04/27 05:57:43 jruoho Exp $ */
+/* $NetBSD: acpi_acad.c,v 1.45 2010/08/14 05:41:22 jruoho Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.44 2010/04/27 05:57:43 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_acad.c,v 1.45 2010/08/14 05:41:22 jruoho Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -159,7 +159,7 @@
acpiacad_resume(device_t dv, const pmf_qual_t *qual)
{
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, acpiacad_get_status, dv);
+ acpiacad_get_status(dv);
return true;
}
diff -r d6517691f645 -r fab598125395 sys/dev/acpi/acpi_bat.c
--- a/sys/dev/acpi/acpi_bat.c Sat Aug 14 05:13:20 2010 +0000
+++ b/sys/dev/acpi/acpi_bat.c Sat Aug 14 05:41:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_bat.c,v 1.103 2010/06/30 15:38:27 jruoho Exp $ */
+/* $NetBSD: acpi_bat.c,v 1.104 2010/08/14 05:41:22 jruoho Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.103 2010/06/30 15:38:27 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_bat.c,v 1.104 2010/08/14 05:41:22 jruoho Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -784,8 +784,8 @@
acpibat_resume(device_t dv, const pmf_qual_t *qual)
{
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, acpibat_update_info, dv);
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, acpibat_update_status, dv);
+ acpibat_update_info(dv);
+ acpibat_update_status(dv);
return true;
}
diff -r d6517691f645 -r fab598125395 sys/dev/acpi/acpi_cpu_cstate.c
--- a/sys/dev/acpi/acpi_cpu_cstate.c Sat Aug 14 05:13:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_cstate.c Sat Aug 14 05:41:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_cstate.c,v 1.25 2010/08/14 05:13:21 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_cstate.c,v 1.26 2010/08/14 05:41:22 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_cstate.c,v 1.25 2010/08/14 05:13:21 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_cstate.c,v 1.26 2010/08/14 05:41:22 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -240,11 +240,10 @@
bool
acpicpu_cstate_resume(device_t self)
{
- static const ACPI_OSD_EXEC_CALLBACK func = acpicpu_cstate_callback;
struct acpicpu_softc *sc = device_private(self);
if ((sc->sc_flags & ACPICPU_FLAG_C_FADT) == 0)
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, func, sc->sc_dev);
+ acpicpu_cstate_callback(self);
return true;
}
diff -r d6517691f645 -r fab598125395 sys/dev/acpi/acpi_cpu_pstate.c
--- a/sys/dev/acpi/acpi_cpu_pstate.c Sat Aug 14 05:13:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_pstate.c Sat Aug 14 05:41:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_pstate.c,v 1.17 2010/08/13 19:48:25 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_pstate.c,v 1.18 2010/08/14 05:41:22 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.17 2010/08/13 19:48:25 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.18 2010/08/14 05:41:22 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -223,10 +223,8 @@
bool
acpicpu_pstate_resume(device_t self)
{
- static const ACPI_OSD_EXEC_CALLBACK func = acpicpu_pstate_callback;
- struct acpicpu_softc *sc = device_private(self);
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, func, sc->sc_dev);
+ acpicpu_pstate_callback(self);
return true;
}
diff -r d6517691f645 -r fab598125395 sys/dev/acpi/acpi_cpu_tstate.c
--- a/sys/dev/acpi/acpi_cpu_tstate.c Sat Aug 14 05:13:20 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu_tstate.c Sat Aug 14 05:41:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_tstate.c,v 1.5 2010/08/14 05:13:21 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_tstate.c,v 1.6 2010/08/14 05:41:22 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.5 2010/08/14 05:13:21 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_tstate.c,v 1.6 2010/08/14 05:41:22 jruoho Exp $");
#include <sys/param.h>
#include <sys/evcnt.h>
@@ -213,10 +213,10 @@
bool
acpicpu_tstate_resume(device_t self)
{
- static const ACPI_OSD_EXEC_CALLBACK func = acpicpu_tstate_callback;
struct acpicpu_softc *sc = device_private(self);
- (void)AcpiOsExecute(OSL_NOTIFY_HANDLER, func, sc->sc_dev);
+ if ((sc->sc_flags & ACPICPU_FLAG_T_FADT) == 0)
+ acpicpu_tstate_callback(self);
return true;
}
Home |
Main Index |
Thread Index |
Old Index