From: "Mario Limonciello (AMD)" <superm1@kernel.org>
To: mario.limonciello@amd.com, rafael@kernel.org,
maciej.wieczor-retman@intel.com, pawel.chmielewski@intel.com,
lenb@kernel.org
Cc: "Mario Limonciello (AMD)" <superm1@kernel.org>,
linux-acpi@vger.kernel.org, acpica-devel@lists.linux.dev
Subject: [PATCH] ACPICA: Add ACPI_MSG_DEBUG to set KERN_DEBUG for debug output
Date: Mon, 31 Aug 2026 00:34:19 -0500 [thread overview]
Message-ID: <20260831053420.1729024-1-superm1@kernel.org> (raw)
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.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
Given this is purely for Linux - it's not obvious to me if it should
go upstream to ACPICA or directly to Linux. Sending here for now.
---
drivers/acpi/acpica/acutils.h | 3 +++
drivers/acpi/acpica/utdebug.c | 4 ++--
include/acpi/platform/aclinux.h | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 9049bfee409c4..766a3080b5ea1 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 a31e07400c34d..1f2cab491637f 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -156,7 +156,7 @@ acpi_debug_print(u32 requested_debug_level,
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",
+ (ACPI_MSG_DEBUG "\n**** Context Switch from TID %u to TID %u ****\n\n",
(u32)acpi_gbl_previous_thread_id, (u32)thread_id);
}
@@ -168,7 +168,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 9b30bb9ed711c..5e2ed5e79d3b8 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.53.0
next reply other threads:[~2026-08-31 5:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 5:34 Mario Limonciello (AMD) [this message]
2026-09-09 15:50 ` [PATCH] ACPICA: Add ACPI_MSG_DEBUG to set KERN_DEBUG for debug output Rafael J. Wysocki (Intel)
2026-09-09 16:03 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831053420.1729024-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=acpica-devel@lists.linux.dev \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=maciej.wieczor-retman@intel.com \
--cc=mario.limonciello@amd.com \
--cc=pawel.chmielewski@intel.com \
--cc=rafael@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.