[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aBHl3n0yWF53nmKY@mai.linaro.org>
Date: Wed, 30 Apr 2025 10:57:02 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Sebastian Reichel <sre@...nel.org>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Benson Leung <bleung@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>,
Matti Vaittinen <mazziesaccount@...il.com>,
Mark Brown <broonie@...nel.org>, kernel@...gutronix.de,
linux-kernel@...r.kernel.org, Liam Girdwood <lgirdwood@...il.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>,
linux-pm@...r.kernel.org,
Søren Andersen <san@...v.dk>,
Guenter Roeck <groeck@...omium.org>,
Ahmad Fatoum <a.fatoum@...gutronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
chrome-platform@...ts.linux.dev
Subject: Re: [PATCH v9 2/7] reboot: hw_protection_trigger: use standardized
numeric shutdown/reboot reasons instead of strings
On Tue, Apr 22, 2025 at 10:57:12AM +0200, Oleksij Rempel wrote:
> Prepares the kernel for the Power State Change Reason (PSCR) recorder,
> which will store shutdown and reboot reasons in persistent storage.
>
> Instead of using string-based reason descriptions, which are often too
> large to fit within limited storage spaces (e.g., RTC clocks with only 8
> bits of battery-backed storage), we introduce `enum psc_reason`. This
> enumerates predefined reasons for power state changes, making it
> efficient to store and retrieve shutdown causes.
>
> Key changes:
> - Introduced `enum psc_reason`, defining structured reasons for power state
> changes.
> - Replaced string-based shutdown reasons with `psc_reason` identifiers.
> - Implemented `get_psc_reason()` and `set_psc_reason()` for tracking the
> last shutdown cause.
> - Added `psc_reason_to_str()` to map enum values to human-readable strings.
> - Updated `hw_protection_trigger()` to use `psc_reason` instead of string
> parameters.
> - Updated all consumers of `hw_protection_trigger()` to pass an appropriate
> `psc_reason` value instead of a string.
> - All structured logs now go through a single `pr_emerg()` in
> `__hw_protection_trigger()`, providing consistent output:
> HARDWARE PROTECTION <action>: <reason-code> (<reason-string>)
>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
> Reviewed-by: Matti Vaittinen <mazziesaccount@...il.com>
> Acked-by: Mark Brown <broonie@...nel.org>
> Acked-by: Tzung-Bi Shih <tzungbi@...nel.org>
Acked-by: Daniel Lezcano <daniel.lezcano@...aro.org>
Thanks!
[ ... ]
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists