[PATCH v2 0/6] remoteproc: imx_rproc: Use device managed API to clean up the driver

Peng Fan posted 6 patches 1 week, 1 day ago
There is a newer version of this series
drivers/remoteproc/imx_rproc.c | 128 ++++++++++++++++++-----------------------
1 file changed, 57 insertions(+), 71 deletions(-)
[PATCH v2 0/6] remoteproc: imx_rproc: Use device managed API to clean up the driver
Posted by Peng Fan 1 week, 1 day ago
This is the 2nd series to cleanup the driver.

Patch 1:
Fix the runtime usage. This is not critical bug fix, so it could be
defered to 6.18.

Patch 2-6:
Use devres managed API to cleanup the error handling path and remove path.

Tested on
i.MX8MP-EVK, i.MX8MM-EVK, i.MX93-11x11-EVK, i.MX8QXP-MEK, and i.MX8ULP-EVK.

There is still a 3rd patchset to do further cleanup. After this patchset
get reviewed, the 3rd patchset will be posted out to list.

Thanks to Daniel and Frank for the internal reviewing.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Changes in v2:
- Address a build warning in patch 4/6
- Add R-b from Frank and Daniel
- Link to v1: https://lore.kernel.org/r/20250917-imx_rproc_c2-v1-0-00ce23dc9c6e@nxp.com

---
Peng Fan (6):
      remoteproc: imx_rproc: Fix runtime PM cleanup order and error handling
      remoteproc: imx_rproc: Use devm_add_action_or_reset() for workqueue cleanup
      remoteproc: imx_rproc: Use devm_add_action_or_reset() for mailbox cleanup
      remoteproc: imx_rproc: Use devm_clk_get_enabled() and simplify cleanup
      remoteproc: imx_rproc: Use devm_add_action_or_reset() for scu cleanup
      remoteproc: imx_rproc: Use devm_rproc_add() helper

 drivers/remoteproc/imx_rproc.c | 128 ++++++++++++++++++-----------------------
 1 file changed, 57 insertions(+), 71 deletions(-)
---
base-commit: c3067c2c38316c3ef013636c93daa285ee6aaa2e
change-id: 20250916-imx_rproc_c2-2b9ad7882f4d

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>
Re: [PATCH v2 0/6] remoteproc: imx_rproc: Use device managed API to clean up the driver
Posted by Peng Fan 1 week ago
Hi Mathieu, Bjorn

On Tue, Sep 23, 2025 at 01:16:32PM +0800, Peng Fan wrote:
>This is the 2nd series to cleanup the driver.
>
>---
>Changes in v2:
>- Address a build warning in patch 4/6
>- Add R-b from Frank and Daniel
>- Link to v1: https://lore.kernel.org/r/20250917-imx_rproc_c2-v1-0-00ce23dc9c6e@nxp.com
>
>---
>Peng Fan (6):
>      remoteproc: imx_rproc: Fix runtime PM cleanup order and error handling
>      remoteproc: imx_rproc: Use devm_add_action_or_reset() for workqueue cleanup
>      remoteproc: imx_rproc: Use devm_add_action_or_reset() for mailbox cleanup
>      remoteproc: imx_rproc: Use devm_clk_get_enabled() and simplify cleanup
>      remoteproc: imx_rproc: Use devm_add_action_or_reset() for scu cleanup
>      remoteproc: imx_rproc: Use devm_rproc_add() helper


Sorry for early ping - I just wanted to check if there's any chance for this
patchset to be included in 6.18, along with the other cleanup patchset [1].

Both patchsets have received Reviewed-by tags, have been tested, and
successfully passed builds (arm64 gcc) with each patch applied incrementally.

[1] https://lore.kernel.org/linux-remoteproc/20250920-imx_rproc_c2-v2-0-3351c4c96df5@nxp.com/T/#ma16bb8a38300f6eb333ee04f00d57805aee3c114

Thanks
Peng

>
> drivers/remoteproc/imx_rproc.c | 128 ++++++++++++++++++-----------------------
> 1 file changed, 57 insertions(+), 71 deletions(-)
>---
>base-commit: c3067c2c38316c3ef013636c93daa285ee6aaa2e
>change-id: 20250916-imx_rproc_c2-2b9ad7882f4d
>
>Best regards,
>-- 
>Peng Fan <peng.fan@nxp.com>
>
Re: [PATCH v2 0/6] remoteproc: imx_rproc: Use device managed API to clean up the driver
Posted by Mathieu Poirier 1 week ago
On Wed, 24 Sept 2025 at 09:35, Peng Fan <peng.fan@oss.nxp.com> wrote:
>
> Hi Mathieu, Bjorn
>
> On Tue, Sep 23, 2025 at 01:16:32PM +0800, Peng Fan wrote:
> >This is the 2nd series to cleanup the driver.
> >
> >---
> >Changes in v2:
> >- Address a build warning in patch 4/6
> >- Add R-b from Frank and Daniel
> >- Link to v1: https://lore.kernel.org/r/20250917-imx_rproc_c2-v1-0-00ce23dc9c6e@nxp.com
> >
> >---
> >Peng Fan (6):
> >      remoteproc: imx_rproc: Fix runtime PM cleanup order and error handling
> >      remoteproc: imx_rproc: Use devm_add_action_or_reset() for workqueue cleanup
> >      remoteproc: imx_rproc: Use devm_add_action_or_reset() for mailbox cleanup
> >      remoteproc: imx_rproc: Use devm_clk_get_enabled() and simplify cleanup
> >      remoteproc: imx_rproc: Use devm_add_action_or_reset() for scu cleanup
> >      remoteproc: imx_rproc: Use devm_rproc_add() helper
>
>
> Sorry for early ping - I just wanted to check if there's any chance for this
> patchset to be included in 6.18, along with the other cleanup patchset [1].

It seems very unlikely.  I am currently looking into how the PM
runtime framework behaves to address my own questions about this patch
[1].  Furthermore, I am worried about the usage of the device
management framework when it comes to freeing memory.  I will get back
to you with comments on that front when I know we are doing the right
thing with the PM runtime framework.

I dropped the 3rd cleanup patchset.  More than once I asked you to
submit only one patchset at a time and you still refuse to take notice
of my request.

Mathieu

[1]. "remoteproc: imx_rproc: Fix runtime PM cleanup order and error handling"

>
> Both patchsets have received Reviewed-by tags, have been tested, and
> successfully passed builds (arm64 gcc) with each patch applied incrementally.
>
> [1] https://lore.kernel.org/linux-remoteproc/20250920-imx_rproc_c2-v2-0-3351c4c96df5@nxp.com/T/#ma16bb8a38300f6eb333ee04f00d57805aee3c114
>
> Thanks
> Peng
>
> >
> > drivers/remoteproc/imx_rproc.c | 128 ++++++++++++++++++-----------------------
> > 1 file changed, 57 insertions(+), 71 deletions(-)
> >---
> >base-commit: c3067c2c38316c3ef013636c93daa285ee6aaa2e
> >change-id: 20250916-imx_rproc_c2-2b9ad7882f4d
> >
> >Best regards,
> >--
> >Peng Fan <peng.fan@nxp.com>
> >