summaryrefslogtreecommitdiff
path: root/drivers/remoteproc
AgeCommit message (Collapse)Author
2025-10-24remoteproc: imx_rproc: Remove the assignement to methodPeng Fan
'method' is no longer used in imx_rproc.c, so remove the assignment. But imx_dsp_rproc.c is still using 'method', so still keep the field in struct imx_rrpoc_dcfg. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20251024-imx_rproc_c4-v4-4-af83ed3fdbba@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-24remoteproc: imx_rproc: Enable PM runtime support unconditionallyPeng Fan
PM runtime support is safe and applicable across all i.MX platforms, not just those using the SCU API. Remove the conditional check and enable PM runtime unconditionally to simplify the code and ensure consistent power management behavior. Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20251024-imx_rproc_c4-v4-3-af83ed3fdbba@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-24remoteproc: imx_rproc: Make detach operation platform-specificPeng Fan
Refactor the detach logic to support platform-specific implementations via the dcfg->ops->detach callback. Allow finer control over detach behavior depending on the remote processor management method, and make it easier to add detach support for new SoCs. The previous hardcoded SCU API detach logic is now moved into a dedicated imx_rproc_scu_api_detach() function, and registered via the plat ops structure. The generic imx_rproc_detach() now delegates to the platform-specific handler if available. Also, the dcfg->method check with IMX_RPROC_SCU_API is removed. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20251024-imx_rproc_c4-v4-2-af83ed3fdbba@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-24remoteproc: imx_rproc: Simplify clock enable logic using dcfg flagsPeng Fan
Simplify the clock enable logic by removing the dedicated imx_rproc_clk_enable() function and integrate the clock handling directly into the probe function to simplify the code. Add a new IMX_RPROC_NEED_CLKS flag in dcfg to indicate whether clock management is required for a given SoC. Update probe logic to conditionally enable clocks based on the new flag. Set the flag for applicable SoCs (e.g., i.MX7D, i.MX8MQ, i.MX93, etc.). No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20251024-imx_rproc_c4-v4-1-af83ed3fdbba@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-20remoteproc: mtk_scp: Construct FW path if firmware-name not presentAngeloGioacchino Del Regno
After a reply on the mailing lists [1] it emerged that the DT property "firmware-name" should not be relied on because of possible issues with firmware versions. For MediaTek SCP, there has never been any firmware version vs driver version desync issue but, regardless, the firmwares are always using the same name and they're always located in a path with a specific pattern. Instead of unconditionally always relying on the firmware-name devicetree property to get a path to the SCP FW file, drivers should construct a name based on what firmware it knows and what hardware it is running on. In order to do that, add a `scp_get_default_fw_path()` function that constructs the path and filename based on two of the infos that the driver can get: 1. The compatible string with the highest priority (so, the first one at index 0); and 2. The type of SCP HW - single-core or multi-core. This means that the default firmware path is generated as: - Single core SCP: mediatek/(soc_model)/scp.img for example: mediatek/mt8183/scp.img; - Multi core SCP: mediatek/(soc_model)/scp_c(core_number).img for example: mediatek/mt8188/scp_c0.img for Core 0, and mediatek/mt8188/scp_c1.img for Core 1. Note that the generated firmware path is being used only if the "firmware-name" devicetree property is not present in the SCP node or in the SCP Core node(s). [1 - Reply regarding firmware-name property] Link: https://lore.kernel.org/all/7e8718b0-df78-44a6-a102-89529d6abcce@app.fastmail.com/ Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20251015084103.10737-1-angelogioacchino.delregno@collabora.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Use devm_rproc_add() helperPeng Fan
Replace manual rproc_add() and cleanup logic with devm_rproc_add(), which ties the remoteproc lifecycle to the device's lifecycle. This simplifies error handling and ensures proper cleanup. With no need to invoke rproc_del(), the remove() ops could be removed. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-6-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Use devm_add_action_or_reset() for scu cleanupPeng Fan
Replace the explicit call to imx_rproc_put_scu() in the remove path with devm_add_action_or_reset(). Ensure proper cleanup of scu resources and simplify the code by leveraging the device-managed resource framework. Additionally: - Remove the IMX_RPROC_SCU_API check from imx_rproc_put_scu(), as devm_add_action_or_reset() now exclusively handles SCU cleanup. - Improve error reporting by using dev_err_probe() for consistency and clarity. - Drop the err_put_scu label, as it is now redundant due to the updated error handling approach. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-5-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Use devm_clk_get_enabled() and simplify cleanupPeng Fan
Replace separate calls to devm_clk_get() and clk_prepare_enable() with devm_clk_get_enabled(), which combines clock acquisition and enabling into a single managed step. Simplify the probe logic and remove the need for manual clock disable in error and remove paths. Also, update error handling to eliminate redundant cleanup steps and use return-based error propagation where appropriate. Improve code clarity and reduce the chance of resource leaks or incorrect ordering in cleanup paths. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-4-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Use devm_add_action_or_reset() for mailbox cleanupPeng Fan
Convert imx_rproc_free_mbox() to a devm-managed cleanup action using devm_add_action_or_reset(). Ensure the mailbox resources are freed automatically with the device lifecycle, simplify error handling and removing the need for manual cleanup in probe and remove paths. Also improve error reporting by using dev_err_probe() for consistency and clarity. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-3-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Use devm_add_action_or_reset() for workqueue cleanupPeng Fan
Replace manual destroy_workqueue() calls in error and remove paths with a devm_add_action_or_reset() helper. Ensure the workqueue is properly cleaned up with the device lifecycle, and simplify error handling in probe by removing now-unnecessary labels and cleanup steps. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-2-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-14remoteproc: imx_rproc: Fix runtime PM cleanup and improve remove pathPeng Fan
Proper cleanup should be done when rproc_add() fails by invoking both pm_runtime_disable() and pm_runtime_put_noidle() to avoid leaving the device in an inconsistent power state. Fix it by adding pm_runtime_put_noidle() and pm_runtime_disable() in the error path. Also Update the remove() callback to use pm_runtime_put_noidle() instead of pm_runtime_put(), to clearly indicate that only need to restore the usage count. Fixes: a876a3aacc43 ("remoteproc: imx_rproc: detect and attach to pre-booted remote cores") Cc: Ulf Hansson <ulf.hansson@linaro.org> Cc: Hiago De Franco <hiago.franco@toradex.com> Suggested-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Link: https://lore.kernel.org/r/20250926-imx_rproc_v3-v3-1-4c0ec279cc5f@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-10-04Merge tag 'rproc-v6.18' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: - Enable coredump support for the i.MX HiFi core remoteproc, and clean up the i.MX remoteproc driver. - Introduce remoteprocs on the Qualcomm Milos platform. Gracefully shut own the ADSP remoteproc when bootloader has loaded the "Lite" firmware on X Elite. Improve the resource handover procedure to avoid possibly duplicate handling. - Transition the TI DA8xx, TI Keystone, and TI Wakeup M3 remoteproc drivers to handle resources using devres. * tag 'rproc-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (29 commits) remoteproc: pru: Fix potential NULL pointer dereference in pru_rproc_set_ctable() remoteproc: qcom: pas: Drop redundant assignment to ret remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1E remoteproc: qcom: q6v5: Avoid handling handover twice remoteproc: qcom: q6v5: Avoid disabling handover IRQ twice remoteproc: qcom: pas: Add Milos remoteproc support dt-bindings: remoteproc: qcom,milos-pas: Document remoteprocs remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974 remoteproc: imx_rproc: Clean up after ops introduction remoteproc: imx_rproc: Simplify IMX_RPROC_SMC switch case remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API switch case remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch case remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_match remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfg remoteproc: k3: Correctly release some resources allocated in k3_rproc_request_mbox() remoteproc: wkup_m3: Use devm_rproc_add() helper remoteproc: wkup_m3: Use devm_rproc_alloc() helper remoteproc: wkup_m3: Use devm action to call PM runtime put sync remoteproc: wkup_m3: Use devm_pm_runtime_enable() helper remoteproc: keystone: Use devm_rproc_add() helper ...
2025-09-23remoteproc: pru: Fix potential NULL pointer dereference in ↵Zhen Ni
pru_rproc_set_ctable() pru_rproc_set_ctable() accessed rproc->priv before the IS_ERR_OR_NULL check, which could lead to a null pointer dereference. Move the pru assignment, ensuring we never dereference a NULL rproc pointer. Fixes: 102853400321 ("remoteproc: pru: Add pru_rproc_set_ctable() function") Cc: stable@vger.kernel.org Signed-off-by: Zhen Ni <zhen.ni@easystack.cn> Link: https://lore.kernel.org/r/20250923112109.1165126-1-zhen.ni@easystack.cn Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-22remoteproc: qcom: pas: Drop redundant assignment to retStephan Gerhold
We don't have a way to detect if the lite firmware is actually running yet, so we should ignore the return status of qcom_scm_pas_shutdown() for now. The assignment to "ret" is not used anywhere, so just drop it. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250820-rproc-qcom-q6v5-fixes-v2-4-910b1a3aff71@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-22remoteproc: qcom: pas: Shutdown lite ADSP DTB on X1EStephan Gerhold
The ADSP firmware on X1E has separate firmware binaries for the main firmware and the DTB. The same applies for the "lite" firmware loaded by the boot firmware. When preparing to load the new ADSP firmware we shutdown the lite_pas_id for the main firmware, but we don't shutdown the corresponding lite pas_id for the DTB. The fact that we're leaving it "running" forever becomes obvious if you try to reuse (or just access) the memory region used by the "lite" firmware: The &adsp_boot_mem is accessible, but accessing the &adsp_boot_dtb_mem results in a crash. We don't support reusing the memory regions currently, but nevertheless we should not keep part of the lite firmware running. Fix this by adding the lite_dtb_pas_id and shutting it down as well. We don't have a way to detect if the lite firmware is actually running yet, so ignore the return status of qcom_scm_pas_shutdown() for now. This was already the case before, the assignment to "ret" is not used anywhere. Fixes: 62210f7509e1 ("remoteproc: qcom_q6v5_pas: Unload lite firmware on ADSP") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Link: https://lore.kernel.org/r/20250820-rproc-qcom-q6v5-fixes-v2-3-910b1a3aff71@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-22remoteproc: qcom: q6v5: Avoid handling handover twiceStephan Gerhold
A remoteproc could theoretically signal handover twice. This is unexpected and would break the reference counting for the handover resources (power domains, clocks, regulators, etc), so add a check to prevent that from happening. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Link: https://lore.kernel.org/r/20250820-rproc-qcom-q6v5-fixes-v2-2-910b1a3aff71@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-22remoteproc: qcom: q6v5: Avoid disabling handover IRQ twiceStephan Gerhold
enable_irq() and disable_irq() are reference counted, so we must make sure that each enable_irq() is always paired with a single disable_irq(). If we call disable_irq() twice followed by just a single enable_irq(), the IRQ will remain disabled forever. For the error handling path in qcom_q6v5_wait_for_start(), disable_irq() will end up being called twice, because disable_irq() also happens in qcom_q6v5_unprepare() when rolling back the call to qcom_q6v5_prepare(). Fix this by dropping disable_irq() in qcom_q6v5_wait_for_start(). Since qcom_q6v5_prepare() is the function that calls enable_irq(), it makes more sense to have the rollback handled always by qcom_q6v5_unprepare(). Fixes: 3b415c8fb263 ("remoteproc: q6v5: Extract common resource handling") Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Link: https://lore.kernel.org/r/20250820-rproc-qcom-q6v5-fixes-v2-1-910b1a3aff71@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-20remoteproc: qcom: pas: Add Milos remoteproc supportLuca Weiss
Add the different remoteprocs found on the Milos SoC: ADSP, CDSP, MPSS and WPSS. Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Link: https://lore.kernel.org/r/20250915-sm7635-remoteprocs-v5-2-96526cac59c6@fairphone.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-20remoteproc: qcom_q6v5_mss: support loading MBN file on msm8974Dmitry Baryshkov
On MSM8974 / APQ8074, MSM8226 and MSM8926 the MSS requires loading raw MBA image instead of the ELF file. Skip the ELF headers if mba.mbn was specified as the firmware image. Fixes: a5a4e02d083d ("remoteproc: qcom: Add support for parsing fw dt bindings") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Tested-by: Luca Weiss <luca@lucaweiss.eu> # msm8974pro-fairphone-fp2 Link: https://lore.kernel.org/r/20250706-msm8974-fix-mss-v4-1-630907dbd898@oss.qualcomm.com [bjorn: Unwrapped the long memcpy line, to taste] Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-09-15remoteproc: imx_rproc: Clean up after ops introductionPeng Fan
With the switch-case in imx_rproc_{start,stop}{} removed, simplify the code logic by removing 'goto'. The last switch-case in imx_rproc_detect_mode() are no longer needed and can be removed. This cleanup improves code readability and aligns with the new ops-based design. No functional changes. Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-6-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-15remoteproc: imx_rproc: Simplify IMX_RPROC_SMC switch casePeng Fan
Introduce imx_rproc_arm_smc_{start, stop, detect_mode}() helper functions for all i.MX variants using IMX_RPROC_SMC to manage remote processors. This allows the removal of the IMX_RPROC_SMC switch-case blocks from imx_rproc_start(), imx_rproc_stop(), and imx_rproc_detect_mode(), resulting in cleaner and more maintainable code. Since this is the last switch in imx_rproc_{start,stop}{}, remove the switch-case. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-5-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-15remoteproc: imx_rproc: Simplify IMX_RPROC_SCU_API switch casePeng Fan
Introduce imx_rproc_scu_api_{start, stop, detect_mode}() helper functions for all i.MX variants using IMX_RPROC_SCU_API to manage remote processors. This allows the removal of the IMX_RPROC_SCU_API switch-case blocks from imx_rproc_start(), imx_rproc_stop(), and imx_rproc_detect_mode(), resulting in cleaner and more maintainable code. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-4-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-15remoteproc: imx_rproc: Simplify IMX_RPROC_MMIO switch casePeng Fan
Introduce imx_rproc_mmio_{start, stop, detect_mode}() helper functions for all i.MX variants using IMX_RPROC_MMIO to manage remote processors. This allows the removal of the IMX_RPROC_MMIO switch-case blocks from imx_rproc_start(), imx_rproc_stop(), and imx_rproc_detect_mode(), resulting in cleaner and more maintainable code. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-3-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-15remoteproc: imx_rproc: Move imx_rproc_dcfg closer to imx_rproc_of_matchPeng Fan
Move the imx_rproc_dcfg structure definitions closer to imx_rproc_of_match to prepare for adding start/stop/detect_mode ops for each i.MX variant. This relocation avoids the need to declare function prototypes such as 'static int imx_rproc_xtr_mbox_init(struct rproc *rproc, bool tx_block)' at the beginning of the file, improving code organization and readability. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-2-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-09-15remoteproc: imx_rproc: Introduce start/stop/detect_mode ops for imx_rproc_dcfgPeng Fan
Simplify the logic in imx_rproc_start(), imx_rproc_stop() and imx_rproc_detect_mode(), introduce start, stop and detect_mode ops for the imx_rproc_dcfg structure. Allow each platform to provide its own implementation of start/stop/detect_mode operations, and prepare to eliminate the need for multiple switch-case statements. Improve code readability and maintainability by encapsulating platform-specific behavior. No functional changes. Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> Link: https://lore.kernel.org/r/20250910-imx-rproc-cleanup-v2-1-10386685b8a9@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-29remoteproc: k3: Correctly release some resources allocated in ↵Christophe JAILLET
k3_rproc_request_mbox() If an error occurs after a successful k3_rproc_request_mbox() call, mbox_free_channel() should be called to avoid a leak. Such a call is missing in the error handling path of k3_dsp_rproc_probe(). It is also missing both in the error handling path of k3_m4_rproc_probe() and in the (in-existent) corresponding remove function. Switch to managed resources to avoid these leaks and simplify the code. Remove the now unneeded mbox_free_channel(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Beleswar Padhi <b-padhi@ti.com> Tested-by: Beleswar Padhi <b-padhi@ti.com> Link: https://lore.kernel.org/r/df853ede72e9972c464415990b196289680e6acb.1756065142.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: wkup_m3: Use devm_rproc_add() helperAndrew Davis
Use the device lifecycle managed add function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814153940.670564-4-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: wkup_m3: Use devm_rproc_alloc() helperAndrew Davis
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814153940.670564-3-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: wkup_m3: Use devm action to call PM runtime put syncAndrew Davis
This helps prevent mistakes like putting out of order in cleanup functions and forgetting to put sync on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814153940.670564-2-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: wkup_m3: Use devm_pm_runtime_enable() helperAndrew Davis
Use device life-cycle managed runtime enable function to simplify probe and exit paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814153940.670564-1-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: keystone: Use devm_rproc_add() helperAndrew Davis
Use the device lifecycle managed add function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814140835.651652-5-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: keystone: Use devm_gpiod_get() helperAndrew Davis
Use device life-cycle managed GPIO get function to simplify probe and exit paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814140835.651652-4-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: keystone: Use devm action to call PM runtime put syncAndrew Davis
This helps prevent mistakes like putting out of order in cleanup functions and forgetting to put sync on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814140835.651652-3-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: keystone: Use devm_pm_runtime_enable() helperAndrew Davis
Use device life-cycle managed runtime enable function to simplify probe and exit paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814140835.651652-2-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: keystone: Use devm action to release reserved memoryAndrew Davis
This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814140835.651652-1-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: da8xx: Use devm_rproc_add() helperAndrew Davis
Use the device lifecycle managed add function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on error paths. As this now makes the IRQ free ordered correctly, we can drop that from the remove() callback, which is now empty and can also be removed. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814135532.638040-3-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-26remoteproc: da8xx: Use devm action to release reserved memoryAndrew Davis
This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814135532.638040-2-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-25remoteproc: da8xx: Use devm_rproc_alloc() helperAndrew Davis
Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250814135532.638040-1-afd@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-20remoteproc: k3: Remove remote processor mailbox pingHiago De Franco
As of today, pinging the remote processor during k3_rproc_request_mbox() does not have any functional effect. This behavior was originally based on the OMAP remoteproc driver, where the idea was to send messages such as suspend requests (among others) to the remote processor, but this was never upstreamed. Currently, the ping message has no effect in upstream usage and causes an unread message to remain in the mailbox, which ultimately prevents the system from entering suspend mode: Freezing remaining freezable tasks completed (elapsed 0.001 seconds) printk: Suspending console(s) (use no_console_suspend to debug) omap-mailbox 29000000.mailbox: fifo 1 has unexpected unread messages omap-mailbox 29000000.mailbox: PM: dpm_run_callback(): platform_pm_suspend returns -16 omap-mailbox 29000000.mailbox: PM: failed to suspend: error -16 The ping is only replied if the remote core firmware is capable of doing it, otherwise the unread message stays into the mailbox. Remove the ping and fix the suspend issue. Suggested-by: Andrew Davis <afd@ti.com> Signed-off-by: Hiago De Franco <hiago.franco@toradex.com> Acked-by: Andrew Davis <afd@ti.com> Link: https://lore.kernel.org/r/20250806-v1-fix-am62-hmp-suspend-v1-1-1c4a81bb5dde@toradex.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-20remoteproc: imx_dsp_rproc: Add support of recovery and coredump processShengjiu Wang
When enabled FW recovery, but is broken because software reset is missed in this recovery flow. So move software reset from imx_dsp_runtime_resume() to .load() and clear memory before loading firmware to make recovery work. Add call rproc_coredump_set_elf_info() to initialize the elf info for coredump, otherwise coredump will report error "ELF class is not set". Fixes: ec0e5549f358 ("remoteproc: imx_dsp_rproc: Add remoteproc driver for DSP on i.MX") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Link: https://lore.kernel.org/r/20250722075225.544319-1-shengjiu.wang@nxp.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-08-11soc: qcom: mdt_loader: Remove pas id parameterMukesh Ojha
pas id is not used in qcom_mdt_load_no_init() and it should not be used as it is non-PAS specific function and has no relation to PAS specific mechanism. Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Acked-by: Jeff Johnson <jjohnson@kernel.org> # drivers/net/wireless/ath/ath12k/ahb.c Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250807074311.2381713-2-mukesh.ojha@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-08-01Merge tag 'rproc-v6.17' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: - Make the Xilinx remoteproc driver support running on only a single core, disable still unsupported remoteproc features, and stop the remoteproc on shutdown to facilitate kexec. - Conclude the renaming of the Qualcomm ADSP driver to "PAS" that was started many years ago. * tag 'rproc-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: remoteproc: xlnx: Fix kernel-doc warnings remoteproc: xlnx: Disable unsupported features remoteproc: xlnx: Add shutdown callback remoteproc: xlnx: Allow single core use in split mode dt-bindings: remoteproc: qcom,sa8775p-pas: Correct the interrupt number remoteproc: Don't use %pK through printk dt-bindings: remoteproc: qcom,sm8150-pas: Document QCS615 remoteproc remoteproc: qcom: pas: Conclude the rename from adsp
2025-07-22remoteproc: xlnx: Fix kernel-doc warningsTanmay Shah
Fix kernel-doc warnings generated by following command: `scripts/kernel-doc -Werror -Wshort-desc -Wall \ drivers/remoteproc/xlnx_r5_remoteproc.c > /dev/null` warning: missing initial short description on line: * struct mbox_info ... Total 8 warnings fixed Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20250716213048.2316424-3-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-07-22remoteproc: xlnx: Disable unsupported featuresTanmay Shah
AMD-Xilinx platform driver does not support iommu or recovery mechanism yet. Disable both features in platform driver. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20250716213048.2316424-2-tanmay.shah@amd.com Fixes: 6b291e8020a8 ("drivers: remoteproc: Add Xilinx r5 remoteproc driver") Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-07-18remoteproc: imx_rproc: detect and attach to pre-booted remote coresHiago De Franco
When the Cortex-M remote core is started and already running before Linux boots (typically by the Cortex-A bootloader using a command like bootaux), the current driver is unable to attach to it. This is because the driver only checks for remote cores running in different SCU partitions. However in this case, the M-core is in the same partition as Linux and is already powered up and running by the bootloader. This patch adds a check using dev_pm_genpd_is_on() to verify whether the M-core's power domains are already on. If all power domain devices are on, the driver assumes the M-core is running and proceed to attach to it. To accomplish this, we need to avoid passing any attach_data or flags to dev_pm_domain_attach_list(), allowing the platform device become a consumer of the power domain provider without changing its current state. During probe, also enable and sync the device runtime PM to make sure the power domains are correctly managed when the core is controlled by the kernel. Suggested-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Hiago De Franco <hiago.franco@toradex.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20250716194638.113115-1-hiagofranco@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2025-07-16remoteproc: imx_rproc: skip clock enable when M-core is managed by the SCUHiago De Franco
For the i.MX8X and i.MX8 family SoCs, when the Cortex-M core is powered up and started by the Cortex-A core using the bootloader (e.g., via the U-Boot bootaux command), both M-core and Linux run within the same SCFW (System Controller Firmware) partition. With that, Linux has permission to control the M-core. But once the M-core is started by the bootloader, the SCFW automatically enables its clock and sets the clock rate. If Linux later attempts to enable the same clock via clk_prepare_enable(), the SCFW returns a 'LOCKED' error, as the clock is already configured by the SCFW. This causes the probe function in imx_rproc.c to fail, leading to the M-core power domain being shut down while the core is still running. This results in a fault from the SCU (System Controller Unit) and triggers a system reset. To address this issue, ignore handling the clk for i.MX8X and i.MX8 M-core, as SCFW already takes care of enabling and configuring the clock. Suggested-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Hiago De Franco <hiago.franco@toradex.com> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20250629172512.14857-3-hiagofranco@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2025-07-03remoteproc: xlnx: Add shutdown callbackTanmay Shah
In case of kexec call, each driver's shutdown callback is called. Handle this call for rproc driver and shutdown/detach each core that was powered on before. This is needed for proper Life Cycle Management of remote processor. Otherwise on next linux boot, remote processor can't be started due to bad refcount of power-domain managed by platform management controller. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20250620195728.3216935-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-06-23remoteproc: xlnx: Allow single core use in split modeTanmay Shah
When operating in split mode, it is a valid usecase to have only one core enabled in the cluster. Remove exact core count expecatation from the driver. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20250618181933.1253033-1-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
2025-06-17remoteproc: Don't use %pK through printkThomas Weißschuh
In the past %pK was preferable to %p as it would not leak raw pointer values into the kernel log. Since commit ad67b74d2469 ("printk: hash addresses printed with %p") the regular %p has been improved to avoid this issue. Furthermore, restricted pointers ("%pK") were never meant to be used through printk(). They can still unintentionally leak raw pointers or acquire sleeping locks in atomic contexts. Switch to the regular pointer formatting which is safer and easier to reason about. There are still a few users of %pK left, but these use it through seq_file, for which its usage is safe. Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de> Link: https://lore.kernel.org/r/20250611-restricted-pointers-remoteproc-v1-1-f059097ba663@linutronix.de Signed-off-by: Bjorn Andersson <andersson@kernel.org>
2025-06-10remoteproc: qcom: pas: Conclude the rename from adspBjorn Andersson
The change that renamed the driver from "adsp" to "pas" didn't change any of the implementation. The result is an aesthetic eyesore, and confusing to many. Conclude the rename of the driver, by updating function, structures and variable names to match what the driver actually is. The "Hexagon v5" is also dropped from the name and Kconfig, as this isn't correct either. No functional change. Fixes: 9e004f97161d ("remoteproc: qcom: Rename Hexagon v5 PAS driver") Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> Reviewed-by: Wasim Nazir <quic_wasimn@quicinc.com> Link: https://lore.kernel.org/r/20250605-pas-rename-v2-1-f1c89e49e691@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>