[PATCH v1 25/30] ACPICA: Add ACPI_MSG_DEBUG to set KERN_DEBUG for debug output
From: Pawel Chmielewski
Date: Tue Oct 20 2026 - 10:29:56 EST
From: "Mario Limonciello (AMD)" <superm1@xxxxxxxxxx>
acpi_debug_print() emits ACPI debug output using multi-part
acpi_os_printf() and acpi_os_vprintf() calls without any loglevel
prefix.
When acpi_os_vprintf() processes a chunk without a loglevel prefix
(printk_get_level() returns 0), it prepends KERN_CONT. Because the initial
header chunk lacks a loglevel prefix, it either attaches to a preceding
unfinalized log message (inheriting its level) or, when split across
printk buffer records, falls back to the default message loglevel rather
than KERN_DEBUG. This can cause dmesg to misinterpret and colorize debug
messages as errors.
Define ACPI_MSG_DEBUG as KERN_DEBUG in aclinux.h (with an empty fallback
in acutils.h for ACPICA OS-independence) and prefix debug message headers
and context switch output in acpi_debug_print() with ACPI_MSG_DEBUG so
that printk records are properly tagged with KERN_DEBUG.
Link: https://github.com/acpica/acpica/commit/802446cd7816
Signed-off-by: Mario Limonciello (AMD) <superm1@xxxxxxxxxx>
Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
Signed-off-by: Pawel Chmielewski <pawel.chmielewski@xxxxxxxxx>
---
drivers/acpi/acpica/acutils.h | 3 +++
drivers/acpi/acpica/utdebug.c | 9 +++++----
include/acpi/platform/aclinux.h | 1 +
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 9049bfee409c..6b06f126c653 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -100,6 +100,9 @@ extern const char *acpi_gbl_clock_input_scale[];
#ifndef ACPI_MSG_BIOS_WARNING
#define ACPI_MSG_BIOS_WARNING "Firmware Warning (ACPI): "
#endif
+#ifndef ACPI_MSG_DEBUG
+#define ACPI_MSG_DEBUG ""
+#endif
/*
* Common message suffix
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index a31e07400c34..d031c5ab63bc 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -155,9 +155,10 @@ acpi_debug_print(u32 requested_debug_level,
thread_id = acpi_os_get_thread_id();
if (thread_id != acpi_gbl_previous_thread_id) {
if (ACPI_LV_THREADS & acpi_dbg_level) {
- acpi_os_printf
- ("\n**** Context Switch from TID %u to TID %u ****\n\n",
- (u32)acpi_gbl_previous_thread_id, (u32)thread_id);
+ acpi_os_printf(ACPI_MSG_DEBUG
+ "\n**** Context Switch from TID %u to TID %u ****\n\n",
+ (u32)acpi_gbl_previous_thread_id,
+ (u32)thread_id);
}
acpi_gbl_previous_thread_id = thread_id;
@@ -168,7 +169,7 @@ acpi_debug_print(u32 requested_debug_level,
* Display the module name, current line number, thread ID (if requested),
* current procedure nesting level, and the current procedure name
*/
- acpi_os_printf("%9s-%04d ", module_name, line_number);
+ acpi_os_printf(ACPI_MSG_DEBUG "%9s-%04d ", module_name, line_number);
#ifdef ACPI_APPLICATION
/*
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 9b30bb9ed711..5e2ed5e79d3b 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -169,6 +169,7 @@
#define ACPI_MSG_BIOS_ERROR KERN_ERR "ACPI BIOS Error (bug): "
#define ACPI_MSG_BIOS_WARNING KERN_WARNING "ACPI BIOS Warning (bug): "
+#define ACPI_MSG_DEBUG KERN_DEBUG
/*
* Linux wants to use designated initializers for function pointer structs.
--
2.50.1