mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ivan Hu <ivan.hu@canonical.com>
To: robert.moore@intel.com, rafael.j.wysocki@intel.com,
	lenb@kernel.org, linux-acpi@vger.kernel.org,
	acpica-devel@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] ACPI: thermal: extend the acpi maximum handles for _PSL method
Date: Wed,  9 Aug 2023 17:44:51 +0800	[thread overview]
Message-ID: <20230809094451.15473-1-ivan.hu@canonical.com> (raw)

Several platforms encountered the following kernel message:
ACPI: \_TZ_.BATZ: Invalid passive threshold

This issue arises due to the failure of the acpi_evaluate_reference function
in drivers/acpi/thermal.c while evaluating the ACPI _PSL method.

status = acpi_evaluate_reference(tz->device->handle, "_PSL",
			 NULL, &devices);
if (ACPI_FAILURE(status)) {
	acpi_handle_info(tz->device->handle,
			 "Invalid passive threshold\n");
	tz->trips.passive.valid = false;
} else {
	tz->trips.passive.valid = true;
}

However, the root cause lies in the _PSL method returning packages with a count
exceeding ACPI_MAX_HANDLES in acpi_evaluate_reference.

As per the ACPI specification, the _PSL (Passive List) method is defined under
a thermal zone and evaluates to a list of processor objects to be used for
passive cooling. And it will return a variable-length Package containing a list
of References to processor objects.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 include/acpi/acpi_bus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 23fbe4a16972..dc7b38826113 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -13,7 +13,7 @@
 #include <linux/property.h>
 
 /* TBD: Make dynamic */
-#define ACPI_MAX_HANDLES	10
+#define ACPI_MAX_HANDLES	32
 struct acpi_handle_list {
 	u32 count;
 	acpi_handle handles[ACPI_MAX_HANDLES];
-- 
2.34.1


             reply	other threads:[~2023-08-09  9:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09  9:44 Ivan Hu [this message]
2023-08-09 10:09 ` 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=20230809094451.15473-1-ivan.hu@canonical.com \
    --to=ivan.hu@canonical.com \
    --cc=acpica-devel@lists.linuxfoundation.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robert.moore@intel.com \
    /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®