[PATCH] firmware: arm_scmi: clock: Relax check in scmi_clock_protocol_init

From: Peng Fan (OSS)

Date: Tue Mar 24 2026 - 02:24:49 EST


From: Peng Fan <peng.fan@xxxxxxx>

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@xxxxxxx>
---
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@xxxxxxx>