Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177455377
D61295.1794447709.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D61295.1794447709.diff
View Options
diff --git a/sys/dev/acpi_apple/acpi_apple.h b/sys/dev/acpi_apple/acpi_apple.h
--- a/sys/dev/acpi_apple/acpi_apple.h
+++ b/sys/dev/acpi_apple/acpi_apple.h
@@ -15,6 +15,7 @@
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
+#include <sys/sx.h>
#include <contrib/dev/acpica/include/acpi.h>
diff --git a/sys/dev/acpi_apple/acpi_apple_platform.c b/sys/dev/acpi_apple/acpi_apple_platform.c
--- a/sys/dev/acpi_apple/acpi_apple_platform.c
+++ b/sys/dev/acpi_apple/acpi_apple_platform.c
@@ -22,9 +22,9 @@
* the second instance's attach/detach doesn't reinstall or rip out the
* first instance's hooks.
*/
-static struct mtx acpi_apple_platform_mtx;
-MTX_SYSINIT(acpi_apple_platform_mtx_init, &acpi_apple_platform_mtx,
- "acpi_apple_platform", MTX_DEF);
+static struct sx acpi_apple_platform_sx;
+SX_SYSINIT(acpi_apple_platform_sx_init, &acpi_apple_platform_sx,
+ "acpi_apple_platform");
static int acpi_apple_platform_refs;
static eventhandler_tag acpi_apple_shutdown_tag;
static eventhandler_tag acpi_apple_lid_tag;
@@ -88,7 +88,7 @@
int
acpi_apple_platform_attach(struct acpi_apple_softc *sc __unused)
{
- mtx_lock(&acpi_apple_platform_mtx);
+ sx_xlock(&acpi_apple_platform_sx);
if (acpi_apple_platform_refs++ == 0) {
acpi_apple_shutdown_tag = EVENTHANDLER_REGISTER(
shutdown_final, acpi_apple_arm_wol, NULL,
@@ -96,7 +96,7 @@
acpi_apple_lid_tag = EVENTHANDLER_REGISTER(acpi_lid_event,
acpi_apple_lid_event, NULL, EVENTHANDLER_PRI_ANY);
}
- mtx_unlock(&acpi_apple_platform_mtx);
+ sx_unlock(&acpi_apple_platform_sx);
return (0);
}
@@ -104,7 +104,7 @@
void
acpi_apple_platform_detach(struct acpi_apple_softc *sc __unused)
{
- mtx_lock(&acpi_apple_platform_mtx);
+ sx_xlock(&acpi_apple_platform_sx);
KASSERT(acpi_apple_platform_refs > 0,
("acpi_apple: platform refcount underflow"));
if (acpi_apple_platform_refs > 0 && --acpi_apple_platform_refs == 0) {
@@ -119,5 +119,5 @@
acpi_apple_shutdown_tag = NULL;
}
}
- mtx_unlock(&acpi_apple_platform_mtx);
+ sx_unlock(&acpi_apple_platform_sx);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 12, 1:41 AM (10 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41657682
Default Alt Text
D61295.1794447709.diff (2 KB)
Attached To
Mode
D61295: acpi_apple: Fix sleep with non-sleepable lock held
Attached
Detach File
Event Timeline