Cleanups and minor fixes to the ADI remoteproc driver - #3428
Open
ukleinek wants to merge 9 commits into
Open
Conversation
The workqueue might still be in use until rproc_del() returns, so better don't release before calling rproc_del(). Ditto for the mbox channels. Fixes: ca6c93f ("remoteproc: adi: Add driver for ADSP SHARC cores") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
As soon as rproc_add() is called, the dma operations in the callbacks might be used. So call dmaengine_get() before rproc_add(). Reorder the function calls in the remove callback accordingly. Fixes: ca6c93f ("remoteproc: adi: Add driver for ADSP SHARC cores") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
sipraga
approved these changes
Jul 13, 2026
nunojsa
approved these changes
Jul 13, 2026
| dev_err(dev, "Error: Core%d not idle\n", core_id); | ||
| ret = -EBUSY; | ||
| goto free_rproc; | ||
| return -EBUSY; |
Collaborator
There was a problem hiding this comment.
I guess this could be an opportunity to get rid of that redundant else
Contributor
Author
There was a problem hiding this comment.
You want the following?:
if (ret < 0)
return dev_err_probe(...);
if (!ret)
return dev_err_probe(...);
?
| } | ||
| if (ret < 0) | ||
| return dev_err_probe(dev, ret, "Unable to read core status\n"); | ||
| else if (ret == 0) |
Collaborator
There was a problem hiding this comment.
Yeah, style wise I really prefer just if (!ret) return. But that's me
Contributor
Author
There was a problem hiding this comment.
You mean s/ret == 0/!ret/, right, and not to have the return on the same line as the if statement?
qasim-ijaz
reviewed
Jul 13, 2026
In the error case devm_ioremap_wc() returns NULL not an error pointer. Adapt the check accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Contributor
Author
I already checked, not all resource allocation functions used have a devm equivalent. So converting completely would need some work in other subsystems. |
This fixes a missing of_node_put in the last hunk. Fixes: ca6c93f ("remoteproc: adi: Add driver for ADSP SHARC cores") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Since commit 5ab23c7 ("modpost: Create modalias for builtin modules") MODULE_DEVICE_TABLE() is enough to reference a match table and the data isn't discarded by the linker even when the driver is built-in and CONFIG_OF is disabled. So there is no valid reason to not store the address of that table in the driver struct. Drop the of_match_ptr() accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
New additions after the terminator are not expected, so usually there is no comma added either. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
With the devm managed version of rproc_alloc() the error codes can be simplified a bit. Also given that after rproc_alloc() some devm managed resources are allocated this improves the order of resource freeing on device remove. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Compared to dev_err() dev_err_probe() is more compact and improves the error message by mentioning the error code. Also it has EPROBE_DEFER handing built-in. For out-of-memory errors no message should be emitted ---the kernel is loud enough in this case already---so the respective messages are dropped. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Multiline comments start with /* on its own line. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
8 tasks
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
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.
PR Description
Some low-hanging fruit patch opportunities I found while ramping up on the driver while not yet having the needed hardware.
PR Type
PR Checklist