mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: rafael@kernel.org, rui.zhang@intel.com
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] ACPI: thermal: Execute _SCP before reading trip points
Date: Thu, 10 Apr 2025 18:54:55 +0200	[thread overview]
Message-ID: <20250410165456.4173-3-W_Armin@gmx.de> (raw)
In-Reply-To: <20250410165456.4173-1-W_Armin@gmx.de>

As specified in section 11.4.13 of the ACPI specification the
operating system is required to evaluate the _ACx and _PSV objects
after executing the _SCP control method.

Move the execution of the _SCP control method before the invocation
of acpi_thermal_get_trip_points() to avoid missing updates to the
_ACx and _PSV objects.

Fixes: b09872a652d3 ("ACPI: thermal: Fold acpi_thermal_get_info() into its caller")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/acpi/thermal.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 0c874186f8ae..5c2defe55898 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -803,6 +803,12 @@ static int acpi_thermal_add(struct acpi_device *device)

 	acpi_thermal_aml_dependency_fix(tz);

+	/*
+	 * Set the cooling mode [_SCP] to active cooling. This needs to happen before
+	 * we retrieve the trip point values.
+	 */
+	acpi_execute_simple_method(tz->device->handle, "_SCP", ACPI_THERMAL_MODE_ACTIVE);
+
 	/* Get trip points [_ACi, _PSV, etc.] (required). */
 	acpi_thermal_get_trip_points(tz);

@@ -814,10 +820,6 @@ static int acpi_thermal_add(struct acpi_device *device)
 	if (result)
 		goto free_memory;

-	/* Set the cooling mode [_SCP] to active cooling. */
-	acpi_execute_simple_method(tz->device->handle, "_SCP",
-				   ACPI_THERMAL_MODE_ACTIVE);
-
 	/* Determine the default polling frequency [_TZP]. */
 	if (tzp)
 		tz->polling_frequency = tzp;
--
2.39.5


  parent reply	other threads:[~2025-04-10 16:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 16:54 [PATCH 0/3] ACPI: thermal: Properly support the _SCP control method Armin Wolf
2025-04-10 16:54 ` [PATCH 1/3] ACPI: OSI: Stop advertising support for "3.0 _SCP Extensions" Armin Wolf
2025-04-10 16:54 ` Armin Wolf [this message]
2025-04-10 16:54 ` [PATCH 3/3] ACPI: thermal: Allow userspace applications to change the cooling mode Armin Wolf
2025-04-25 23:20 ` [PATCH 0/3] ACPI: thermal: Properly support the _SCP control method Armin Wolf
2025-04-26 13:12   ` Rafael J. Wysocki
2025-04-26 22:52     ` Armin Wolf
2025-04-28 12:31       ` Armin Wolf
2025-04-28 12:34         ` Rafael J. Wysocki
2025-05-02 22:29           ` Armin Wolf
2025-05-16 13:59             ` Rafael J. Wysocki
2025-05-16 16:56               ` Rafael J. Wysocki
2025-05-16 22:51                 ` Armin Wolf
2025-05-16 23:01               ` Armin Wolf

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=20250410165456.4173-3-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 \
    --cc=rui.zhang@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®