summaryrefslogtreecommitdiffstats
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2014-05-22 06:47:47 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-05-26 08:38:57 -0400
commit45fef5b88d1f2f47ecdefae6354372d440ca5c84 (patch)
treedb7f4741889a8adf72ce308ac7178b3a4f73319f /include/linux/acpi.h
parentd0103387bc21644d297cb61ee623c7114e395575 (diff)
ACPI: add dynamic_debug support
Commit 1a699476e258 ("ACPI / hotplug / PCI: Hotplug notifications from acpi_bus_notify()") added debug messages for a few common events. These debug messages are unconditionally enabled if CONFIG_DYNAMIC_DEBUG is defined, contrary to the documented meaning, making the ACPI system spew lots of unwanted noise on any kernel with dynamic debugging. The bug was introduced by commit fbfddae69657 ("ACPI: Add acpi_handle_<level>() interfaces"), which added the CONFIG_DYNAMIC_DEBUG dependency without respecting its meaning. Fix by adding real support for dynamic_debug. Fixes: fbfddae69657 ("ACPI: Add acpi_handle_<level>() interfaces") Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 7a8f2cd66c8b..0e2569031a6f 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -37,6 +37,7 @@
37 37
38#include <linux/list.h> 38#include <linux/list.h>
39#include <linux/mod_devicetable.h> 39#include <linux/mod_devicetable.h>
40#include <linux/dynamic_debug.h>
40 41
41#include <acpi/acpi.h> 42#include <acpi/acpi.h>
42#include <acpi/acpi_bus.h> 43#include <acpi/acpi_bus.h>
@@ -589,6 +590,14 @@ static inline __printf(3, 4) void
589acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {} 590acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
590#endif /* !CONFIG_ACPI */ 591#endif /* !CONFIG_ACPI */
591 592
593#if defined(CONFIG_ACPI) && defined(CONFIG_DYNAMIC_DEBUG)
594__printf(3, 4)
595void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const char *fmt, ...);
596#else
597#define __acpi_handle_debug(descriptor, handle, fmt, ...) \
598 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__);
599#endif
600
592/* 601/*
593 * acpi_handle_<level>: Print message with ACPI prefix and object path 602 * acpi_handle_<level>: Print message with ACPI prefix and object path
594 * 603 *
@@ -610,11 +619,19 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
610#define acpi_handle_info(handle, fmt, ...) \ 619#define acpi_handle_info(handle, fmt, ...) \
611 acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__) 620 acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
612 621
613/* REVISIT: Support CONFIG_DYNAMIC_DEBUG when necessary */ 622#if defined(DEBUG)
614#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
615#define acpi_handle_debug(handle, fmt, ...) \ 623#define acpi_handle_debug(handle, fmt, ...) \
616 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__) 624 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
617#else 625#else
626#if defined(CONFIG_DYNAMIC_DEBUG)
627#define acpi_handle_debug(handle, fmt, ...) \
628do { \
629 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
630 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
631 __acpi_handle_debug(&descriptor, handle, pr_fmt(fmt), \
632 ##__VA_ARGS__); \
633} while (0)
634#else
618#define acpi_handle_debug(handle, fmt, ...) \ 635#define acpi_handle_debug(handle, fmt, ...) \
619({ \ 636({ \
620 if (0) \ 637 if (0) \
@@ -622,5 +639,6 @@ acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
622 0; \ 639 0; \
623}) 640})
624#endif 641#endif
642#endif
625 643
626#endif /*_LINUX_ACPI_H*/ 644#endif /*_LINUX_ACPI_H*/