summaryrefslogtreecommitdiffstats
path: root/include/acpi/platform/aclinux.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-22 22:40:42 +0200
committerKeith Packard <keithp@keithp.com>2011-07-22 22:40:42 +0200
commitdf7976797fa9af161690dbf4dee81ed92cdc150f (patch)
treebe6f04706d91cc80da4dbd3a5f5f2a174f1bdae3 /include/acpi/platform/aclinux.h
parentdrm/i915: Skip GPU wait for scanout pin while wedged (diff)
parentdrm/i915: load the LUT before pipe enable on ILK+ (diff)
downloadlinux-df7976797fa9af161690dbf4dee81ed92cdc150f.tar.xz
linux-df7976797fa9af161690dbf4dee81ed92cdc150f.zip
Merge branch 'drm-intel-fixes' into drm-intel-next
Diffstat (limited to 'include/acpi/platform/aclinux.h')
-rw-r--r--include/acpi/platform/aclinux.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 5d2a5e9544d9..2ce1be9f6291 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
} while (0)
#endif
+/*
+ * When lockdep is enabled, the spin_lock_init() macro stringifies it's
+ * argument and uses that as a name for the lock in debugging.
+ * By executing spin_lock_init() in a macro the key changes from "lock" for
+ * all locks to the name of the argument of acpi_os_create_lock(), which
+ * prevents lockdep from reporting false positives for ACPICA locks.
+ */
+#define acpi_os_create_lock(__handle) \
+({ \
+ spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
+ \
+ if (lock) { \
+ *(__handle) = lock; \
+ spin_lock_init(*(__handle)); \
+ } \
+ lock ? AE_OK : AE_NO_MEMORY; \
+})
+
#endif /* __KERNEL__ */
#endif /* __ACLINUX_H__ */