mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org
Cc: sudeep.holla@kernel.org, philip.radford@arm.com,
	lui2012qwq@gmail.com, Cristian Marussi <cristian.marussi@arm.com>
Subject: [PATCH v3 3/3] firmware: arm_scmi: Ensure no reboot notifier is registered on suspend
Date: Mon, 30 Nov 2026 14:49:24 +0000	[thread overview]
Message-ID: <20261130144924.343166-4-cristian.marussi@arm.com> (raw)
In-Reply-To: <20261130144924.343166-1-cristian.marussi@arm.com>

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@arm.com>
---
 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


      parent reply	other threads:[~2026-11-30 14:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 14:49 [PATCH v3 0/3] SCMI Power Control fixes Cristian Marussi
2026-11-30 14:49 ` [PATCH v3 1/3] firmware: arm_scmi: Avoid deadlocks between reboot notifier and forceful work Cristian Marussi
2026-11-30 14:49 ` [PATCH v3 2/3] firmware: arm_scmi: Rework SCMI Power Control driver removal Cristian Marussi
2026-11-30 14:49 ` Cristian Marussi [this message]

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=20261130144924.343166-4-cristian.marussi@arm.com \
    --to=cristian.marussi@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lui2012qwq@gmail.com \
    --cc=philip.radford@arm.com \
    --cc=sudeep.holla@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 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®