linux/drivers/remoteproc
Peng Fan 97e4567d39 remoteproc: imx_rproc: Fix unreachable platform prepare_ops
Smatch reports unreachable code in imx_rproc_prepare(), where an early
return inside the reserved-memory parsing loop prevents platform
prepare_ops from being executed.

When of_reserved_mem_region_to_resource() fails, imx_rproc_prepare()
returns immediately, so the platform-specific prepare callback is never
called. As a result, prepare_ops such as imx_rproc_sm_lmm_prepare() on
i.MX95 have no chance to run.

This is problematic when Linux controls the M7 Logical Machine and is
responsible for preparing resources such as TCM. Without running the
platform prepare callback, loading the M7 ELF into TCM may fail if the
bootloader did not power up and initialize TCM.

Fix this by breaking out of the reserved-memory loop instead of
returning, allowing the platform prepare_ops to be executed as intended.

Fixes: edd2a99560 ("remoteproc: imx_rproc: Introduce prepare ops for imx_rproc_dcfg")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/linux-remoteproc/aYYXAa2Fj36XG4yQ@p14s/T/#t
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20260208-imx-rproc-fix-v1-1-ad74555eb9a4@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2026-03-05 10:18:23 -07:00
..
Kconfig remoteproc: imx_rproc: Add support for System Manager LMM API 2026-01-13 09:52:35 -07:00
Makefile remoteproc: k3: Refactor mailbox rx_callback functions into common driver 2025-05-20 11:19:10 -06:00
da8xx_remoteproc.c remoteproc: da8xx: Use devm_rproc_add() helper 2025-08-26 08:21:23 -06:00
imx_dsp_rproc.c remoteproc: imx_dsp_rproc: Only reset carveout memory at RPROC_OFFLINE state 2026-01-05 14:09:31 -07:00
imx_rproc.c remoteproc: imx_rproc: Fix unreachable platform prepare_ops 2026-03-05 10:18:23 -07:00
imx_rproc.h remoteproc: imx_rproc: Add support for System Manager LMM API 2026-01-13 09:52:35 -07:00
ingenic_rproc.c remoteporc: ingenic: Use devm_platform_ioremap_resource_byname() 2024-09-09 09:50:54 -06:00
keystone_remoteproc.c remoteproc: keystone: Use devm_rproc_add() helper 2025-08-26 09:29:37 -06:00
meson_mx_ao_arc.c remoteproc: Switch back to struct platform_driver::remove() 2024-10-29 11:27:37 -06:00
mtk_common.h remoteproc: mediatek: Support setting DRAM and IPI shared buffer sizes 2024-04-30 10:43:59 -06:00
mtk_scp.c remoteproc: mediatek: Unprepare SCP clock during system suspend 2026-03-05 10:14:36 -07:00
mtk_scp_ipi.c remoteproc: mediatek: Break lock dependency to `prepare_lock` 2026-01-26 08:45:49 -07:00
omap_remoteproc.c remoteproc: omap: Remove redundant pm_runtime_mark_last_busy() calls 2025-11-26 11:37:44 -06:00
omap_remoteproc.h remoteproc/omap: Switch to SPDX license identifiers 2020-03-25 22:29:51 -07:00
pru_rproc.c remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable() 2025-09-23 11:49:58 -06:00
pru_rproc.h remoteproc: pru: Add support for PRU specific interrupt configuration 2020-12-10 10:56:01 -06:00
qcom_common.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
qcom_common.h remoteproc: qcom: enable in-kernel PD mapper 2024-06-25 07:40:38 -07:00
qcom_pil_info.c remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided 2021-12-13 16:58:05 -06:00
qcom_pil_info.h remoteproc: qcom: Introduce helper to store pil info in IMEM 2020-07-01 22:10:18 -07:00
qcom_q6v5.c remoteproc: qcom: q6v5: Avoid handling handover twice 2025-09-22 08:33:06 -05:00
qcom_q6v5.h remoteproc: qcom: q6v5: Add interconnect path proxy vote 2022-03-11 14:22:03 -06:00
qcom_q6v5_adsp.c remoteproc: qcom_q6v5_adsp: Fix a NULL vs IS_ERR() check in adsp_alloc_memory_region() 2025-11-29 14:18:23 -06:00
qcom_q6v5_mss.c remoteproc: qcom: Use of_reserved_mem_region_* functions for "memory-region" 2025-11-26 10:27:29 -06:00
qcom_q6v5_pas.c remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux 2026-01-13 12:14:35 -06:00
qcom_q6v5_wcss.c remoteproc: qcom_q6v5_wcss: use optional reset for wcss_q6_bcr_reset 2025-11-29 15:20:23 -06:00
qcom_sysmon.c remoteproc: sysmon: Correct subsys_name_len type in QMI request 2026-03-04 13:12:06 -06:00
qcom_wcnss.c remoteproc: qcom_wcnss: Fix reserved region mapping failure 2026-02-23 13:57:37 -06:00
qcom_wcnss.h remoteproc: qcom: wcnss: remove unused qcom_iris_driver declaration 2022-12-28 09:50:07 -06:00
qcom_wcnss_iris.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rcar_rproc.c remoteproc: Use of_reserved_mem_region_* functions for "memory-region" 2025-11-25 08:34:31 -07:00
remoteproc_cdev.c remoteproc: core: Move state checking to remoteproc_core 2022-04-14 11:13:33 -06:00
remoteproc_core.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
remoteproc_coredump.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
remoteproc_debugfs.c remoteproc: Don't bother checking the return value of debugfs_create* 2022-04-11 10:04:40 -06:00
remoteproc_elf_helpers.h remoteproc: fix an typo in fw_elf_get_class code comments 2021-07-28 14:57:30 -05:00
remoteproc_elf_loader.c ELF: fix all "Elf" typos 2023-04-08 13:45:37 -07:00
remoteproc_internal.h remoteproc: Make rproc_class constant 2024-03-26 11:24:38 -06:00
remoteproc_sysfs.c remoteproc: Make rproc_class constant 2024-03-26 11:24:38 -06:00
remoteproc_virtio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
st_remoteproc.c remoteproc: st: Fix indexing of memory-regions 2025-11-27 08:35:19 -07:00
st_slim_rproc.c remoteproc: Don't use %pK through printk 2025-06-17 08:03:24 -05:00
stm32_rproc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ti_k3_common.c remoteproc: Use of_reserved_mem_region_* functions for "memory-region" 2025-11-25 08:34:31 -07:00
ti_k3_common.h remoteproc: k3: Refactor release_tsp() functions into common driver 2025-05-20 11:19:12 -06:00
ti_k3_dsp_remoteproc.c remoteproc: k3: Correctly release some resources allocated in k3_rproc_request_mbox() 2025-08-29 10:09:52 -06:00
ti_k3_m4_remoteproc.c remoteproc: k3: Refactor release_tsp() functions into common driver 2025-05-20 11:19:12 -06:00
ti_k3_r5_remoteproc.c remoteproc: k3: Correctly release some resources allocated in k3_rproc_request_mbox() 2025-08-29 10:09:52 -06:00
ti_sci_proc.h remoteproc: k3: Factor out TI-SCI processor control OF get function 2024-08-21 11:21:02 -06:00
wkup_m3_rproc.c remoteproc: wkup_m3: Use devm_rproc_add() helper 2025-08-26 09:47:00 -06:00
xlnx_r5_remoteproc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00