forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Test misc patches #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: a876a3a ("remoteproc: imx_rproc: detect and attach to pre-booted remote cores") Cc: Ulf Hansson <[email protected]> Cc: Hiago De Franco <[email protected]> Suggested-by: Ulf Hansson <[email protected]> Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
…leanup 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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
…anup 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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]>
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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]>
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. Signed-off-by: Peng Fan <[email protected]> Reviewed-by: Frank Li <[email protected]>
'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 <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]>
Add an entry for the i.MX remoteproc driver Acked-by: Shengjiu Wang <[email protected]> Acked-by: Daniel Baluta <[email protected]> Signed-off-by: Peng Fan <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.