From: Armin Wolf <W_Armin@gmx.de>
To: rafael@kernel.org, lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ACPI: acpi_pad: Still evaluate _OST when _PUR evaluation fails
Date: Sun, 9 Jun 2024 23:09:08 +0200 [thread overview]
Message-ID: <20240609210908.4470-1-W_Armin@gmx.de> (raw)
The ACPI specification says that if no action was performed when
processing the _PUR object, _OST should still be evaluated, albeit
with a different status code.
Evaluate _OST even when evaluating _PUR fails, to signal the firmware
that no action was performed.
Compile-tested only.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
drivers/acpi/acpi_pad.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index bd1ad07f0290..350d3a892889 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -25,6 +25,10 @@
#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
#define ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME "Processor Aggregator"
#define ACPI_PROCESSOR_AGGREGATOR_NOTIFY 0x80
+
+#define ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS 0
+#define ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION 1
+
static DEFINE_MUTEX(isolated_cpus_lock);
static DEFINE_MUTEX(round_robin_lock);
@@ -382,16 +386,23 @@ static void acpi_pad_handle_notify(acpi_handle handle)
.length = 4,
.pointer = (void *)&idle_cpus,
};
+ u32 status;
mutex_lock(&isolated_cpus_lock);
num_cpus = acpi_pad_pur(handle);
if (num_cpus < 0) {
- mutex_unlock(&isolated_cpus_lock);
- return;
+ /* The ACPI specification says that if no action was performed when
+ * processing the _PUR object, _OST should still be evaluated, albeit
+ * with a different status code.
+ */
+ status = ACPI_PROCESSOR_AGGREGATOR_STATUS_NO_ACTION;
+ } else {
+ status = ACPI_PROCESSOR_AGGREGATOR_STATUS_SUCCESS;
+ acpi_pad_idle_cpus(num_cpus);
}
- acpi_pad_idle_cpus(num_cpus);
+
idle_cpus = acpi_pad_idle_cpus_num();
- acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, 0, ¶m);
+ acpi_evaluate_ost(handle, ACPI_PROCESSOR_AGGREGATOR_NOTIFY, status, ¶m);
mutex_unlock(&isolated_cpus_lock);
}
--
2.39.2
next reply other threads:[~2024-06-09 21:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-09 21:09 Armin Wolf [this message]
2024-06-13 18:49 ` 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=20240609210908.4470-1-W_Armin@gmx.de \
--to=w_armin@gmx.de \
--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®