public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firmware: arm_scmi: clock: Relax check in scmi_clock_protocol_init
@ 2026-03-24  6:24 Peng Fan (OSS)
  2026-03-24  7:49 ` Sudeep Holla
  0 siblings, 1 reply; 9+ messages in thread
From: Peng Fan (OSS) @ 2026-03-24  6:24 UTC (permalink / raw)
  To: Sudeep Holla, Cristian Marussi
  Cc: Jacky Bai, arm-scmi, linux-arm-kernel, linux-kernel, Peng Fan

From: Peng Fan <peng.fan@nxp.com>

On i.MX95, the SCMI Clock protocol defines several reserved clock IDs that
are not backed by real clock devices
(see arch/arm64/boot/dts/freescale/imx95-clock.h).

For these reserved IDs, the SCMI firmware correctly returns NOT_FOUND in
response to the CLOCK_ATTRIBUTES command. According to the SCMI Clock
specification, NOT_FOUND is expected when a clock_id does not correspond to
a valid clock device.

The recent hardening added in scmi_clock_protocol_init() treats any error
return as fatal, causing SCMI clock probe to fail and preventing i.MX9
platforms from booting.

Relax the check so that -ENOENT is treated as a non-fatal condition.

Fixes: 0d8b0c8068a8f ("firmware: arm_scmi: Harden clock protocol initialization")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/arm_scmi/clock.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c
index 082fb0db8681aed7fa30ffb915a8c61530fc5c2d..49ceebae53107fb79a8a07d644c5682a6f704d2f 100644
--- a/drivers/firmware/arm_scmi/clock.c
+++ b/drivers/firmware/arm_scmi/clock.c
@@ -1253,8 +1253,11 @@ static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph)
 	for (clkid = 0; clkid < cinfo->num_clocks; clkid++) {
 		cinfo->clkds[clkid].id = clkid;
 		ret = scmi_clock_attributes_get(ph, clkid, cinfo);
-		if (ret)
+		if (ret) {
+			if (ret == -ENOENT)
+				continue;
 			return ret;
+		}
 
 		ret = scmi_clock_describe_rates_get(ph, clkid, cinfo);
 		if (ret)

---
base-commit: 09c0f7f1bcdbc3c37a5a760cbec76bf18f278406
change-id: 20260324-scmi-clock-fix-v1-b935e04f9243

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-25 12:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24  6:24 [PATCH] firmware: arm_scmi: clock: Relax check in scmi_clock_protocol_init Peng Fan (OSS)
2026-03-24  7:49 ` Sudeep Holla
2026-03-24  8:18   ` Cristian Marussi
2026-03-24 13:15     ` Geert Uytterhoeven
2026-03-24 14:35       ` Cristian Marussi
2026-03-24 15:32         ` Geert Uytterhoeven
2026-03-25 12:06           ` Sudeep Holla
2026-03-25 12:18             ` Cristian Marussi
2026-03-25 12:14     ` Sudeep Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox