From a4d5f63d4384533101e0308fb2e9ac16bacc446c Mon Sep 17 00:00:00 2001 From: Nikunj Kela Date: Wed, 30 Jul 2025 14:30:00 -0700 Subject: [PATCH 01/11] dt-bindings: firmware: arm,scmi: Allow multiple instances Enable multiple SCMI instances by appending an instance-number suffix to the 'scmi' node name. The SCMI spec assumes a single SCMI platform, but in practice its responsibilities may be split across several SCMI platform/server instances. However, only one instance can serve as the system-wide (true) SCMI platform. Reviewed-by: Krzysztof Kozlowski Reviewed-by: Cristian Marussi Signed-off-by: Nikunj Kela Signed-off-by: Deepti Jaggi Message-Id: <20250730-8255-scmi-v6-1-a7d8ba19aded@quicinc.com> Signed-off-by: Sudeep Holla --- Documentation/devicetree/bindings/firmware/arm,scmi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index abbd62f1fed0..be817fd9cc34 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -27,7 +27,7 @@ anyOf: properties: $nodename: - const: scmi + pattern: '^scmi(-[0-9]+)?$' compatible: oneOf: From abd658d3e7332bc88ae910664c7d5f4e116d6bde Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Tue, 29 Jul 2025 21:15:03 +0200 Subject: [PATCH 02/11] firmware: arm_scmi: Constify struct scmi_voltage_proto_ops Constify struct scmi_voltage_proto_ops since the driver never modifies it. Placing it in read-only memory (.rodata) improves hardening, particularly because it contains function pointers. x86_64 (allmodconfig) size impact: Before: text data bss dec hex filename 13142 1808 0 14950 3a66 drivers/firmware/arm_scmi/voltage.o After: text data bss dec hex filename 13238 1712 0 14950 3a66 drivers/firmware/arm_scmi/voltage.o Signed-off-by: Christophe JAILLET Message-Id: <2091660c072dd2d5599897243a5d69e89d46ed4d.1753816459.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/voltage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/voltage.c b/drivers/firmware/arm_scmi/voltage.c index fda6a1573609..17127880e10a 100644 --- a/drivers/firmware/arm_scmi/voltage.c +++ b/drivers/firmware/arm_scmi/voltage.c @@ -393,7 +393,7 @@ static int scmi_voltage_domains_num_get(const struct scmi_protocol_handle *ph) return vinfo->num_domains; } -static struct scmi_voltage_proto_ops voltage_proto_ops = { +static const struct scmi_voltage_proto_ops voltage_proto_ops = { .num_domains_get = scmi_voltage_domains_num_get, .info_get = scmi_voltage_info_get, .config_set = scmi_voltage_config_set, From 224dcf2968cad72adabd4f8258291d6675bc301e Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Tue, 29 Jul 2025 21:15:04 +0200 Subject: [PATCH 03/11] firmware: arm_scmi: Constify struct scmi_transport_ops Mark struct scmi_transport_ops as const since this driver never modifies it. Constifying moves it to read-only memory, improving hardening - especially important for structures with function pointers. x86_64 (allmodconfig) size diff: Before: text data bss dec hex filename 6907 680 48 7635 1dd3 drivers/firmware/arm_scmi/transports/optee.o After: text data bss dec hex filename 6987 576 48 7611 1dbb drivers/firmware/arm_scmi/transports/optee.o Signed-off-by: Christophe JAILLET Message-Id: <881be6ad61037ed95d5e750a2565fd9840120a08.1753816459.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/transports/optee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/transports/optee.c b/drivers/firmware/arm_scmi/transports/optee.c index 3949a877e17d..dc0f46340153 100644 --- a/drivers/firmware/arm_scmi/transports/optee.c +++ b/drivers/firmware/arm_scmi/transports/optee.c @@ -498,7 +498,7 @@ static void scmi_optee_mark_txdone(struct scmi_chan_info *cinfo, int ret, mutex_unlock(&channel->mu); } -static struct scmi_transport_ops scmi_optee_ops = { +static const struct scmi_transport_ops scmi_optee_ops = { .chan_available = scmi_optee_chan_available, .chan_setup = scmi_optee_chan_setup, .chan_free = scmi_optee_chan_free, From e8faa8a466f61f4ae07069ed6b0872f602f1cba9 Mon Sep 17 00:00:00 2001 From: Junnan Wu Date: Tue, 12 Aug 2025 15:53:43 +0800 Subject: [PATCH 04/11] firmware: arm_scmi: Mark VirtIO ready before registering scmi_virtio_driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit 20bda12a0ea0 (“firmware: arm_scmi: Make VirtIO transport a standalone driver”), the VirtIO transport probes independently. During scmi_virtio_probe, scmi_probe() is called, which intune invokes scmi_protocol_acquire() that sends a message over the virtqueue and waits for a reply. Previously, DRIVER_OK was only set after scmi_vio_probe, in the core virtio via virtio_dev_probe(). According to the Virtio spec (3.1 Device Initialization): | The driver MUST NOT send any buffer available notifications to the | device before setting DRIVER_OK. Some type-1 hypervisors block available-buffer notifications until the driver is marked OK. In such cases, scmi_vio_probe stalls in scmi_wait_for_reply(), and the probe never completes. Resolve this by setting DRIVER_OK immediately after the device-specific setup, so scmi_probe() can safely send notifications. Note after splitting the transports into modules, the probe sequence changed a bit. We can no longer rely on virtio_device_ready() being called by the core in virtio_dev_probe(), because scmi_vio_probe() doesn’t complete until the core SCMI stack runs scmi_probe(), which immediately issues the initial BASE protocol exchanges. Fixes: 20bda12a0ea0 ("firmware: arm_scmi: Make VirtIO transport a standalone driver") Signed-off-by: Junnan Wu Message-Id: <20250812075343.3201365-1-junnan01.wu@samsung.com> Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/transports/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/arm_scmi/transports/virtio.c b/drivers/firmware/arm_scmi/transports/virtio.c index cb934db9b2b4..326c4a93e44b 100644 --- a/drivers/firmware/arm_scmi/transports/virtio.c +++ b/drivers/firmware/arm_scmi/transports/virtio.c @@ -871,6 +871,9 @@ static int scmi_vio_probe(struct virtio_device *vdev) /* Ensure initialized scmi_vdev is visible */ smp_store_mb(scmi_vdev, vdev); + /* Set device ready */ + virtio_device_ready(vdev); + ret = platform_driver_register(&scmi_virtio_driver); if (ret) { vdev->priv = NULL; From 72ca981dba5e98c2b1c2956016cc4be934d9fbea Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Sun, 31 Aug 2025 14:52:37 +0800 Subject: [PATCH 05/11] firmware: arm_scmi: Fix function name typo in scmi_perf_proto_ops struct The performance protocol ops table incorrectly referenced power_scale_mw_get instead of the correct power_scale_get. Fix the typo to use the proper function. Signed-off-by: Peng Fan Message-Id: <20250831-scmi-cpufreq-v1-1-493031cf6e9b@nxp.com> Signed-off-by: Sudeep Holla --- include/linux/scmi_protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 688466a0e816..aafaac1496b0 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -153,7 +153,7 @@ struct scmi_perf_domain_info { * for a given device * @fast_switch_rate_limit: gets the minimum time (us) required between * successive fast_switching requests - * @power_scale_mw_get: indicates if the power values provided are in milliWatts + * @power_scale_get: indicates if the power values provided are in milliWatts * or in some other (abstract) scale */ struct scmi_perf_proto_ops { From 572ce546390d1b7c99b16c38cae1b680c716216c Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Fri, 29 Aug 2025 15:21:52 +0200 Subject: [PATCH 06/11] firmware: arm_scmi: quirk: Prevent writes to string constants The quirk version range is typically a string constant and must not be modified (e.g. as it may be stored in read-only memory). Attempting to do so can trigger faults such as: | Unable to handle kernel write to read-only memory at virtual | address ffffc036d998a947 Update the range parsing so that it operates on a copy of the version range string, and mark all the quirk strings as const to reduce the risk of introducing similar future issues. Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220437 Fixes: 487c407d57d6 ("firmware: arm_scmi: Add common framework to handle firmware quirks") Cc: stable@vger.kernel.org # 6.16 Cc: Cristian Marussi Reported-by: Jan Palus Signed-off-by: Johan Hovold Message-Id: <20250829132152.28218-1-johan@kernel.org> [sudeep.holla: minor commit message rewording; switch to cleanup helpers] Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/quirks.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/arm_scmi/quirks.c b/drivers/firmware/arm_scmi/quirks.c index 03960aca3610..03848283c2a0 100644 --- a/drivers/firmware/arm_scmi/quirks.c +++ b/drivers/firmware/arm_scmi/quirks.c @@ -71,6 +71,7 @@ */ #include +#include #include #include #include @@ -89,9 +90,9 @@ struct scmi_quirk { bool enabled; const char *name; - char *vendor; - char *sub_vendor_id; - char *impl_ver_range; + const char *vendor; + const char *sub_vendor_id; + const char *impl_ver_range; u32 start_range; u32 end_range; struct static_key_false *key; @@ -217,7 +218,7 @@ static unsigned int scmi_quirk_signature(const char *vend, const char *sub_vend) static int scmi_quirk_range_parse(struct scmi_quirk *quirk) { - const char *last, *first = quirk->impl_ver_range; + const char *last, *first __free(kfree) = NULL; size_t len; char *sep; int ret; @@ -228,8 +229,12 @@ static int scmi_quirk_range_parse(struct scmi_quirk *quirk) if (!len) return 0; + first = kmemdup(quirk->impl_ver_range, len + 1, GFP_KERNEL); + if (!first) + return -ENOMEM; + last = first + len - 1; - sep = strchr(quirk->impl_ver_range, '-'); + sep = strchr(first, '-'); if (sep) *sep = '\0'; From 646c0c9e06a6613da5496645344af7e6e0f4ee9d Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 4 Sep 2025 18:40:42 +0800 Subject: [PATCH 07/11] firmware: arm_scmi: imx: Add documentation for MISC_BOARD_INFO System Manager Firmware supports getting board information, add documentation for this MISC_BOARD_INFO command. Also extends the SYSLOG response to include NOT_SUPPORTED. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan Message-Id: <20250904-sm-misc-api-v1-v4-1-0bf10eaabdf1@nxp.com> Signed-off-by: Sudeep Holla --- .../firmware/arm_scmi/vendors/imx/imx95.rst | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx95.rst b/drivers/firmware/arm_scmi/vendors/imx/imx95.rst index 4e246a78a042..741f4eace350 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx95.rst +++ b/drivers/firmware/arm_scmi/vendors/imx/imx95.rst @@ -1660,6 +1660,7 @@ protocol_id: 0x84 |Name |Description | +--------------------+---------------------------------------------------------+ |int32 status |SUCCESS: system log return | +| |NOT_SUPPORTED: system log not available | +--------------------+---------------------------------------------------------+ |uint32 numLogflags |Descriptor for the log data returned by this call. | | |Bits[31:20] Number of remaining log words. | @@ -1670,6 +1671,30 @@ protocol_id: 0x84 |uint32 syslog[N] |Log data array, N is defined in bits[11:0] of numLogflags| +--------------------+---------------------------------------------------------+ +MISC_BOARD_INFO +~~~~~~~~~~~~~~~ + +message_id: 0xE +protocol_id: 0x84 + ++--------------------+---------------------------------------------------------+ +|Return values | ++--------------------+---------------------------------------------------------+ +|Name |Description | ++--------------------+---------------------------------------------------------+ +|int32 status |SUCCESS: config name return | +| |NOT_SUPPORTED: name not available | ++--------------------+---------------------------------------------------------+ +|uint32 attributes |Board-specific attributes reserved for future expansion | +| |without breaking backwards compatibility. The firmware | +| |sets the value to 0 | ++--------------------+---------------------------------------------------------+ +|uint8 boardname[16] |Board name. NULL terminated ASCII string, up to 16 bytes | +| |in length. This is System Manager(SM) firmware-exported | +| |board-name and may not align with the board name in the | +| |device tree. | ++--------------------+---------------------------------------------------------+ + NEGOTIATE_PROTOCOL_VERSION ~~~~~~~~~~~~~~~~~~~~~~~~~~ From cc798b105070a190e2b793d30d0c59aa00299861 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 4 Sep 2025 18:40:43 +0800 Subject: [PATCH 08/11] firmware: arm_scmi: imx: Discover MISC build info from the system manager MISC protocol can report System Manager (SM) build information (commit, build date/time, etc.). Discover those information at the init time. If the firmware doesn't support it, ignore -EOPNOTSUPP. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan Message-Id: <20250904-sm-misc-api-v1-v4-2-0bf10eaabdf1@nxp.com> Signed-off-by: Sudeep Holla --- .../arm_scmi/vendors/imx/imx-sm-misc.c | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c index a8915d3b4df5..be34e4a8d738 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c @@ -25,6 +25,7 @@ enum scmi_imx_misc_protocol_cmd { SCMI_IMX_MISC_CTRL_SET = 0x3, SCMI_IMX_MISC_CTRL_GET = 0x4, + SCMI_IMX_MISC_DISCOVER_BUILD_INFO = 0x6, SCMI_IMX_MISC_CTRL_NOTIFY = 0x8, }; @@ -65,6 +66,15 @@ struct scmi_imx_misc_ctrl_get_out { __le32 val[]; }; +struct scmi_imx_misc_buildinfo_out { + __le32 buildnum; + __le32 buildcommit; +#define MISC_MAX_BUILDDATE 16 + u8 builddate[MISC_MAX_BUILDDATE]; +#define MISC_MAX_BUILDTIME 16 + u8 buildtime[MISC_MAX_BUILDTIME]; +}; + static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph, struct scmi_imx_misc_info *mi) { @@ -272,6 +282,33 @@ static int scmi_imx_misc_ctrl_set(const struct scmi_protocol_handle *ph, return ret; } +static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle *ph) +{ + char date[MISC_MAX_BUILDDATE], time[MISC_MAX_BUILDTIME]; + struct scmi_imx_misc_buildinfo_out *out; + struct scmi_xfer *t; + int ret; + + ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_DISCOVER_BUILD_INFO, 0, + sizeof(*out), &t); + if (ret) + return ret; + + ret = ph->xops->do_xfer(ph, t); + if (!ret) { + out = t->rx.buf; + strscpy(date, out->builddate, MISC_MAX_BUILDDATE); + strscpy(time, out->buildtime, MISC_MAX_BUILDTIME); + dev_info(ph->dev, "SM Version\t= Build %u, Commit %08x %s %s\n", + le32_to_cpu(out->buildnum), le32_to_cpu(out->buildcommit), + date, time); + } + + ph->xops->xfer_put(ph, t); + + return ret; +} + static const struct scmi_imx_misc_proto_ops scmi_imx_misc_proto_ops = { .misc_ctrl_set = scmi_imx_misc_ctrl_set, .misc_ctrl_get = scmi_imx_misc_ctrl_get, @@ -299,6 +336,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph) if (ret) return ret; + ret = scmi_imx_misc_build_info_discover(ph); + if (ret && ret != -EOPNOTSUPP) + return ret; + return ph->set_priv(ph, minfo, version); } From d3e25c244d5335ef868983b5dad9d4c06396d67e Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 4 Sep 2025 18:40:44 +0800 Subject: [PATCH 09/11] firmware: arm_scmi: imx: Support retrieving MISC protocol configuration info The MISC protocol can provide System Manager (SM) configuration information, including platform identifiers and board-specific attributes. Add support to retrieve this information during protocol initialization. If the firmware does not implement the CFG_INFO command, handle -EOPNOTSUPP gracefully and continue without failing init. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan Message-Id: <20250904-sm-misc-api-v1-v4-3-0bf10eaabdf1@nxp.com> Signed-off-by: Sudeep Holla --- .../arm_scmi/vendors/imx/imx-sm-misc.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c index be34e4a8d738..a6d516182425 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c @@ -27,6 +27,7 @@ enum scmi_imx_misc_protocol_cmd { SCMI_IMX_MISC_CTRL_GET = 0x4, SCMI_IMX_MISC_DISCOVER_BUILD_INFO = 0x6, SCMI_IMX_MISC_CTRL_NOTIFY = 0x8, + SCMI_IMX_MISC_CFG_INFO_GET = 0xC, }; struct scmi_imx_misc_info { @@ -75,6 +76,12 @@ struct scmi_imx_misc_buildinfo_out { u8 buildtime[MISC_MAX_BUILDTIME]; }; +struct scmi_imx_misc_cfg_info_out { + __le32 msel; +#define MISC_MAX_CFGNAME 16 + u8 cfgname[MISC_MAX_CFGNAME]; +}; + static int scmi_imx_misc_attributes_get(const struct scmi_protocol_handle *ph, struct scmi_imx_misc_info *mi) { @@ -309,6 +316,30 @@ static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle * return ret; } +static int scmi_imx_misc_cfg_info_get(const struct scmi_protocol_handle *ph) +{ + struct scmi_imx_misc_cfg_info_out *out; + char name[MISC_MAX_CFGNAME]; + struct scmi_xfer *t; + int ret; + + ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_CFG_INFO_GET, 0, sizeof(*out), &t); + if (ret) + return ret; + + ret = ph->xops->do_xfer(ph, t); + if (!ret) { + out = t->rx.buf; + strscpy(name, out->cfgname, MISC_MAX_CFGNAME); + dev_info(ph->dev, "SM Config\t= %s, mSel = %u\n", + name, le32_to_cpu(out->msel)); + } + + ph->xops->xfer_put(ph, t); + + return ret; +} + static const struct scmi_imx_misc_proto_ops scmi_imx_misc_proto_ops = { .misc_ctrl_set = scmi_imx_misc_ctrl_set, .misc_ctrl_get = scmi_imx_misc_ctrl_get, @@ -340,6 +371,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph) if (ret && ret != -EOPNOTSUPP) return ret; + ret = scmi_imx_misc_cfg_info_get(ph); + if (ret && ret != -EOPNOTSUPP) + return ret; + return ph->set_priv(ph, minfo, version); } From 88d3671baf4145b806a737f7923df99a53a74737 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Thu, 4 Sep 2025 18:40:45 +0800 Subject: [PATCH 10/11] firmware: arm_scmi: imx: Discover MISC board info from the system manager The i.MX SCMI MISC protocol can report board information from the System Manager (SM), including a board name and board-specific attributes. Query this during protocol initialization. If the firmware does not implement BOARD_INFO, handle -EOPNOTSUPP gracefully and continue. Reviewed-by: Cristian Marussi Signed-off-by: Peng Fan Message-Id: <20250904-sm-misc-api-v1-v4-4-0bf10eaabdf1@nxp.com> Signed-off-by: Sudeep Holla --- .../arm_scmi/vendors/imx/imx-sm-misc.c | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c index a6d516182425..700a3f24f4ef 100644 --- a/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c +++ b/drivers/firmware/arm_scmi/vendors/imx/imx-sm-misc.c @@ -28,6 +28,7 @@ enum scmi_imx_misc_protocol_cmd { SCMI_IMX_MISC_DISCOVER_BUILD_INFO = 0x6, SCMI_IMX_MISC_CTRL_NOTIFY = 0x8, SCMI_IMX_MISC_CFG_INFO_GET = 0xC, + SCMI_IMX_MISC_BOARD_INFO = 0xE, }; struct scmi_imx_misc_info { @@ -76,6 +77,12 @@ struct scmi_imx_misc_buildinfo_out { u8 buildtime[MISC_MAX_BUILDTIME]; }; +struct scmi_imx_misc_board_info_out { + __le32 attributes; +#define MISC_MAX_BRDNAME 16 + u8 brdname[MISC_MAX_BRDNAME]; +}; + struct scmi_imx_misc_cfg_info_out { __le32 msel; #define MISC_MAX_CFGNAME 16 @@ -316,6 +323,30 @@ static int scmi_imx_misc_build_info_discover(const struct scmi_protocol_handle * return ret; } +static int scmi_imx_misc_board_info(const struct scmi_protocol_handle *ph) +{ + struct scmi_imx_misc_board_info_out *out; + char name[MISC_MAX_BRDNAME]; + struct scmi_xfer *t; + int ret; + + ret = ph->xops->xfer_get_init(ph, SCMI_IMX_MISC_BOARD_INFO, 0, sizeof(*out), &t); + if (ret) + return ret; + + ret = ph->xops->do_xfer(ph, t); + if (!ret) { + out = t->rx.buf; + strscpy(name, out->brdname, MISC_MAX_BRDNAME); + dev_info(ph->dev, "Board\t\t= %s, attr=0x%08x\n", + name, le32_to_cpu(out->attributes)); + } + + ph->xops->xfer_put(ph, t); + + return ret; +} + static int scmi_imx_misc_cfg_info_get(const struct scmi_protocol_handle *ph) { struct scmi_imx_misc_cfg_info_out *out; @@ -371,6 +402,10 @@ static int scmi_imx_misc_protocol_init(const struct scmi_protocol_handle *ph) if (ret && ret != -EOPNOTSUPP) return ret; + ret = scmi_imx_misc_board_info(ph); + if (ret && ret != -EOPNOTSUPP) + return ret; + ret = scmi_imx_misc_cfg_info_get(ph); if (ret && ret != -EOPNOTSUPP) return ret; From 2f86054cc1a6792f0812d5f23f271a83848edabb Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 12 Sep 2025 11:24:24 +0200 Subject: [PATCH 11/11] firmware: arm_scmi: Simplify printks with pOF format Print full device node name with %pOF format, so the code will be a bit simpler. Signed-off-by: Krzysztof Kozlowski Message-Id: <20250912092423.162497-2-krzysztof.kozlowski@linaro.org> Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/bus.c | 13 ++++++------- drivers/firmware/arm_scmi/transports/mailbox.c | 7 +++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 24e59ddf85e7..c7698cfaa4e8 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -401,8 +401,8 @@ static void scmi_device_release(struct device *dev) static void __scmi_device_destroy(struct scmi_device *scmi_dev) { - pr_debug("(%s) Destroying SCMI device '%s' for protocol 0x%x (%s)\n", - of_node_full_name(scmi_dev->dev.parent->of_node), + pr_debug("(%pOF) Destroying SCMI device '%s' for protocol 0x%x (%s)\n", + scmi_dev->dev.parent->of_node, dev_name(&scmi_dev->dev), scmi_dev->protocol_id, scmi_dev->name); @@ -474,9 +474,8 @@ __scmi_device_create(struct device_node *np, struct device *parent, if (retval) goto put_dev; - pr_debug("(%s) Created SCMI device '%s' for protocol 0x%x (%s)\n", - of_node_full_name(parent->of_node), - dev_name(&scmi_dev->dev), protocol, name); + pr_debug("(%pOF) Created SCMI device '%s' for protocol 0x%x (%s)\n", + parent->of_node, dev_name(&scmi_dev->dev), protocol, name); return scmi_dev; put_dev: @@ -493,8 +492,8 @@ _scmi_device_create(struct device_node *np, struct device *parent, sdev = __scmi_device_create(np, parent, protocol, name); if (!sdev) - pr_err("(%s) Failed to create device for protocol 0x%x (%s)\n", - of_node_full_name(parent->of_node), protocol, name); + pr_err("(%pOF) Failed to create device for protocol 0x%x (%s)\n", + parent->of_node, protocol, name); return sdev; } diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c index bd041c99b92b..ae0f67e6cc45 100644 --- a/drivers/firmware/arm_scmi/transports/mailbox.c +++ b/drivers/firmware/arm_scmi/transports/mailbox.c @@ -127,8 +127,8 @@ static int mailbox_chan_validate(struct device *cdev, int *a2p_rx_chan, (num_mb == 1 && num_sh != 1) || (num_mb == 3 && num_sh != 2) || (num_mb == 4 && num_sh != 2)) { dev_warn(cdev, - "Invalid channel descriptor for '%s' - mbs:%d shm:%d\n", - of_node_full_name(np), num_mb, num_sh); + "Invalid channel descriptor for '%pOF' - mbs:%d shm:%d\n", + np, num_mb, num_sh); return -EINVAL; } @@ -140,8 +140,7 @@ static int mailbox_chan_validate(struct device *cdev, int *a2p_rx_chan, of_parse_phandle(np, "shmem", 1); if (!np_tx || !np_rx || np_tx == np_rx) { - dev_warn(cdev, "Invalid shmem descriptor for '%s'\n", - of_node_full_name(np)); + dev_warn(cdev, "Invalid shmem descriptor for '%pOF'\n", np); ret = -EINVAL; } }