From: Saverio Miroddi <saverio.pub2@gmail.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>, Jonathan Cameron <jic23@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Saverio Miroddi <saverio.pub2@gmail.com>
Subject: [PATCH] ACPI: bus: Avoid misleading _OSC missing-feature errors
Date: Tue, 21 Jul 2026 21:29:14 +0200 [thread overview]
Message-ID: <20260721192914.1166891-1-saverio.pub2@gmail.com> (raw)
The ACPI specification defines OSC_CAPABILITIES_MASK_ERROR to mean that
firmware cleared capability bits requested by the operating system. Some
firmware sets this status during the control request while returning every
requested capability unchanged. On the affected system, the requested and
returned masks were both 0x006a7eff.
Commit e5322888e6bf ("ACPI: bus: Rework the handling of \_SB._OSC
platform features") made all control-response errors produce error-level
messages. Consequently, the inconsistent response above now claims that
features may be missing even though none were removed.
Track whether the response actually clears a requested bit and omit the
error-level messages only if OSC_CAPABILITIES_MASK_ERROR is the sole
error and no capability was cleared. Keep the dynamic-debug diagnostic and
leave the negotiated capability mask and all other error cases unchanged.
Fixes: e5322888e6bf ("ACPI: bus: Rework the handling of \_SB._OSC platform features")
Signed-off-by: Saverio Miroddi <saverio.pub2@gmail.com>
---
drivers/acpi/bus.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index a30a904f6535..c13128cbc2f6 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -335,7 +335,8 @@ static int acpi_osc_handshake(acpi_handle handle, const char *uuid_str,
.length = bufsize * sizeof(u32),
};
struct acpi_buffer output;
- u32 *retbuf, test;
+ u32 *retbuf, test, errors;
+ bool capabilities_masked = false;
guid_t guid;
int ret, i;
@@ -395,16 +396,24 @@ static int acpi_osc_handshake(acpi_handle handle, const char *uuid_str,
* Clear the feature bits in capbuf[] that have not been acknowledged.
* After that, capbuf[] contains the resultant feature mask.
*/
- for (i = OSC_QUERY_DWORD + 1; i < bufsize; i++)
+ for (i = OSC_QUERY_DWORD + 1; i < bufsize; i++) {
+ if (capbuf[i] & ~retbuf[i])
+ capabilities_masked = true;
+
capbuf[i] &= retbuf[i];
+ }
- if (retbuf[OSC_QUERY_DWORD] & OSC_ERROR_MASK) {
+ errors = retbuf[OSC_QUERY_DWORD] & OSC_ERROR_MASK;
+ if (errors) {
/*
- * Complain about the unexpected errors and print diagnostic
- * information related to them.
+ * Some firmware sets OSC_CAPABILITIES_MASK_ERROR without clearing
+ * any requested capability. Only complain if another error is
+ * present or a capability was actually masked.
*/
- acpi_handle_err(handle, "_OSC: errors while processing control request\n");
- acpi_handle_err(handle, "_OSC: some features may be missing\n");
+ if (errors != OSC_CAPABILITIES_MASK_ERROR || capabilities_masked) {
+ acpi_handle_err(handle, "_OSC: errors while processing control request\n");
+ acpi_handle_err(handle, "_OSC: some features may be missing\n");
+ }
acpi_osc_error_check(handle, &guid, rev, &cap, retbuf);
}
--
2.54.0
next reply other threads:[~2026-07-21 19:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-21 19:29 Saverio Miroddi [this message]
2026-07-21 23:14 ` Jonathan Cameron
2026-07-22 0:06 ` Saverio Miroddi
2026-07-22 13:03 ` [PATCH v1] ACPI: bus: Avoid confusing complaints regarding missing _OSC features Rafael J. Wysocki
2026-07-22 15:34 ` Saverio Miroddi
2026-07-23 11:16 ` [PATCH v2] " Rafael J. Wysocki
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=20260721192914.1166891-1-saverio.pub2@gmail.com \
--to=saverio.pub2@gmail.com \
--cc=jic23@kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®