From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,tzungbi@kernel.org,teknoraver@meta.com,serge@hallyn.com,rui.zhang@intel.com,robh@kernel.org,rafael@kernel.org,mazziesaccount@gmail.com,lukasz.luba@arm.com,lgirdwood@gmail.com,kernel@pengutronix.de,groeck@chromium.org,festevam@denx.de,daniel.lezcano@linaro.org,corbet@lwn.net,broonie@kernel.org,bleung@chromium.org,a.fatoum@pengutronix.de,akpm@linux-foundation.org
Subject: [merged mm-nonmm-stable] thermal-core-allow-user-configuration-of-hardware-protection-action.patch removed from -mm tree
Date: Sun, 16 Mar 2025 22:32:09 -0700 [thread overview]
Message-ID: <20250317053209.A89C1C4CEEC@smtp.kernel.org> (raw)
The quilt patch titled
Subject: thermal: core: allow user configuration of hardware protection action
has been removed from the -mm tree. Its filename was
thermal-core-allow-user-configuration-of-hardware-protection-action.patch
This patch was dropped because it was merged into the mm-nonmm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: thermal: core: allow user configuration of hardware protection action
Date: Mon, 17 Feb 2025 21:39:51 +0100
In the general case, we don't know which of system shutdown or reboot is
the better action to take to protect hardware in an emergency situation.
We thus allow the policy to come from the device-tree in the form of an
optional critical-action OF property, but so far there was no way for the
end user to configure this.
With recent addition of the hw_protection parameter, the user can now
choose a default action for the case, where the driver isn't fully sure
what's the better course of action.
Let's make use of this by passing HWPROT_ACT_DEFAULT in absence of the
critical-action OF property.
As HWPROT_ACT_DEFAULT is shutdown by default, this introduces no
functional change for users, unless they start using the new parameter.
Link: https://lkml.kernel.org/r/20250217-hw_protection-reboot-v3-11-e1c09b090c0c@pengutronix.de
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Benson Leung <bleung@chromium.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Lukasz Luba <lukasz.luba@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Matteo Croce <teknoraver@meta.com>
Cc: Matti Vaittinen <mazziesaccount@gmail.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rob Herring (Arm) <robh@kernel.org>
Cc: Rui Zhang <rui.zhang@intel.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/thermal/thermal_core.c | 17 ++++++++++-------
drivers/thermal/thermal_core.h | 1 +
drivers/thermal/thermal_of.c | 7 +++++--
3 files changed, 16 insertions(+), 9 deletions(-)
--- a/drivers/thermal/thermal_core.c~thermal-core-allow-user-configuration-of-hardware-protection-action
+++ a/drivers/thermal/thermal_core.c
@@ -369,7 +369,8 @@ void thermal_governor_update_tz(struct t
tz->governor->update_tz(tz, reason);
}
-static void thermal_zone_device_halt(struct thermal_zone_device *tz, bool shutdown)
+static void thermal_zone_device_halt(struct thermal_zone_device *tz,
+ enum hw_protection_action action)
{
/*
* poweroff_delay_ms must be a carefully profiled positive value.
@@ -380,21 +381,23 @@ static void thermal_zone_device_halt(str
dev_emerg(&tz->device, "%s: critical temperature reached\n", tz->type);
- if (shutdown)
- hw_protection_shutdown(msg, poweroff_delay_ms);
- else
- hw_protection_reboot(msg, poweroff_delay_ms);
+ __hw_protection_trigger(msg, poweroff_delay_ms, action);
}
void thermal_zone_device_critical(struct thermal_zone_device *tz)
{
- thermal_zone_device_halt(tz, true);
+ thermal_zone_device_halt(tz, HWPROT_ACT_DEFAULT);
}
EXPORT_SYMBOL(thermal_zone_device_critical);
+void thermal_zone_device_critical_shutdown(struct thermal_zone_device *tz)
+{
+ thermal_zone_device_halt(tz, HWPROT_ACT_SHUTDOWN);
+}
+
void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz)
{
- thermal_zone_device_halt(tz, false);
+ thermal_zone_device_halt(tz, HWPROT_ACT_REBOOT);
}
static void handle_critical_trips(struct thermal_zone_device *tz,
--- a/drivers/thermal/thermal_core.h~thermal-core-allow-user-configuration-of-hardware-protection-action
+++ a/drivers/thermal/thermal_core.h
@@ -262,6 +262,7 @@ int thermal_build_list_of_policies(char
void __thermal_zone_device_update(struct thermal_zone_device *tz,
enum thermal_notify_event event);
void thermal_zone_device_critical_reboot(struct thermal_zone_device *tz);
+void thermal_zone_device_critical_shutdown(struct thermal_zone_device *tz);
void thermal_governor_update_tz(struct thermal_zone_device *tz,
enum thermal_notify_event reason);
--- a/drivers/thermal/thermal_of.c~thermal-core-allow-user-configuration-of-hardware-protection-action
+++ a/drivers/thermal/thermal_of.c
@@ -405,9 +405,12 @@ static struct thermal_zone_device *therm
of_ops.should_bind = thermal_of_should_bind;
ret = of_property_read_string(np, "critical-action", &action);
- if (!ret)
- if (!of_ops.critical && !strcasecmp(action, "reboot"))
+ if (!ret && !of_ops.critical) {
+ if (!strcasecmp(action, "reboot"))
of_ops.critical = thermal_zone_device_critical_reboot;
+ else if (!strcasecmp(action, "shutdown"))
+ of_ops.critical = thermal_zone_device_critical_shutdown;
+ }
tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
data, &of_ops, &tzp,
_
Patches currently in -mm which might be from a.fatoum@pengutronix.de are
reply other threads:[~2025-03-17 5:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250317053209.A89C1C4CEEC@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=a.fatoum@pengutronix.de \
--cc=bleung@chromium.org \
--cc=broonie@kernel.org \
--cc=corbet@lwn.net \
--cc=daniel.lezcano@linaro.org \
--cc=festevam@denx.de \
--cc=groeck@chromium.org \
--cc=kernel@pengutronix.de \
--cc=lgirdwood@gmail.com \
--cc=lukasz.luba@arm.com \
--cc=mazziesaccount@gmail.com \
--cc=mm-commits@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.com \
--cc=serge@hallyn.com \
--cc=teknoraver@meta.com \
--cc=tzungbi@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.