[PATCH v3 3/3] firmware: arm_scmi: Ensure no reboot notifier is registered on suspend

From: Cristian Marussi

Date: Mon Nov 30 2026 - 09:50:08 EST


Register a reboot notifier only when the platform originated notification
payload embeds a non-zero timeout field and the requested transition is a
shutdown or a reboot/reset since it does not make any sense to register a
reboot notifier when a suspend transition is requested: it would never be
called and it could intefere badly with the forceful workers.

Fixes: 2c4b97fee94a ("firmware: arm_scmi: Add SCMI System Power Control driver")
Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
drivers/firmware/arm/scmi/scmi_power_control.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm/scmi/scmi_power_control.c b/drivers/firmware/arm/scmi/scmi_power_control.c
index c4db5ed6c53f..72560f158a5f 100644
--- a/drivers/firmware/arm/scmi/scmi_power_control.c
+++ b/drivers/firmware/arm/scmi/scmi_power_control.c
@@ -241,7 +241,13 @@ static void scmi_request_graceful_transition(struct scmi_syspower_conf *sc,
{
unsigned int adj_timeout_ms = 0;

- if (timeout_ms) {
+ /*
+ * Note that by the SCMI specification this field should be considered
+ * valid ONLY for graceful shutdown requests.
+ *
+ * Make sure to ignore any buggy firmware requests.
+ */
+ if (sc->required_transition < SCMI_SYSTEM_POWERUP && timeout_ms) {
int ret;

sc->reboot_nb.notifier_call = &scmi_reboot_notifier;
@@ -342,7 +348,7 @@ static int scmi_userspace_notifier(struct notifier_block *nb,
sc->required_transition = er->system_state;

/* Leaving a trace in logs of who triggered the shutdown/reboot. */
- dev_info(sc->dev, "Serving shutdown/reboot request: %d\n",
+ dev_info(sc->dev, "Serving shutdown/reboot/suspend request: %d\n",
sc->required_transition);

scmi_request_graceful_transition(sc, er->timeout);
--
2.54.0