mbox series

[v2,0/5] Use Device Lifecycle managed functions in TI R5 Remoteproc driver

Message ID 20241219110545.1898883-1-b-padhi@ti.com (mailing list archive)
Headers show
Series Use Device Lifecycle managed functions in TI R5 Remoteproc driver | expand

Message

Beleswar Prasad Padhi Dec. 19, 2024, 11:05 a.m. UTC
This series uses various devm_ helpers to simplify device removal path in
ti_k3_r5_remoteproc driver. This is the first series in the TI K3
Remoteproc refactoring as long planned since [0].

Testing Done:
1. Tested boot of R5F remoteprocs in MCU and MAIN voltage domain in both
IPC-Only mode and Kernel remoteproc mode in all Jacinto K3 devices.
2. Tested Lockstep, Split and Single-CPU Mode configuration (wherever
applicable) of R5F remoteprocs in all Jacinto K3 devices.
3. Tested shutdown of R5F remoteprocs from Linux userspace and also by
executing `modprobe -r ti_k3_r5_remoteproc`.
4. Tested that each patch in this series generates no new warnings/errors.

v2: Changelog:
1. Re-ordered patches in the series to use devm functions starting from
the last called function in remove(), to ease review. [Andrew]
2. Fixed a missing return after dev_err_probe() call in [PATCH v2 3/5]
("remoteproc: k3-r5: Use devm_ioremap_wc() helper"). [Andrew]
3. Removed redundant rproc_del() call in [PATCH v2 4/5] ("remoteproc:
k3-r5: Use devm_rproc_add() helper").

Link to v1:
https://lore.kernel.org/all/20241204111130.2218497-1-b-padhi@ti.com/

[0]: https://lore.kernel.org/all/Zr4w8Vj0mVo5sBsJ@p14s/

Beleswar Padhi (5):
  remoteproc: k3-r5: Add devm action to release reserved memory
  remoteproc: k3-r5: Use devm_kcalloc() helper
  remoteproc: k3-r5: Use devm_ioremap_wc() helper
  remoteproc: k3-r5: Use devm_rproc_add() helper
  remoteproc: k3-r5: Add devm action to release tsp

 drivers/remoteproc/ti_k3_r5_remoteproc.c | 88 ++++++++++--------------
 1 file changed, 35 insertions(+), 53 deletions(-)

Comments

Andrew Davis Dec. 19, 2024, 2:52 p.m. UTC | #1
On 12/19/24 5:05 AM, Beleswar Padhi wrote:
> This series uses various devm_ helpers to simplify device removal path in
> ti_k3_r5_remoteproc driver. This is the first series in the TI K3
> Remoteproc refactoring as long planned since [0].
> 
> Testing Done:
> 1. Tested boot of R5F remoteprocs in MCU and MAIN voltage domain in both
> IPC-Only mode and Kernel remoteproc mode in all Jacinto K3 devices.
> 2. Tested Lockstep, Split and Single-CPU Mode configuration (wherever
> applicable) of R5F remoteprocs in all Jacinto K3 devices.
> 3. Tested shutdown of R5F remoteprocs from Linux userspace and also by
> executing `modprobe -r ti_k3_r5_remoteproc`.

Did you also test that you could then start the cores back up?

I think that might need some firmware fixes we are working on, so
might not work even before these patches, but just wanted to check
if we have tried it yet.

> 4. Tested that each patch in this series generates no new warnings/errors.

Was that with `make W=1 C=1`? Sparse checks will be done during -next
testing so good to check for those too.

Otherwise patches all look good to me, for the series:

Reviewed-by: Andrew Davis <afd@ti.com>

> 
> v2: Changelog:
> 1. Re-ordered patches in the series to use devm functions starting from
> the last called function in remove(), to ease review. [Andrew]
> 2. Fixed a missing return after dev_err_probe() call in [PATCH v2 3/5]
> ("remoteproc: k3-r5: Use devm_ioremap_wc() helper"). [Andrew]
> 3. Removed redundant rproc_del() call in [PATCH v2 4/5] ("remoteproc:
> k3-r5: Use devm_rproc_add() helper").
> 
> Link to v1:
> https://lore.kernel.org/all/20241204111130.2218497-1-b-padhi@ti.com/
> 
> [0]: https://lore.kernel.org/all/Zr4w8Vj0mVo5sBsJ@p14s/
> 
> Beleswar Padhi (5):
>    remoteproc: k3-r5: Add devm action to release reserved memory
>    remoteproc: k3-r5: Use devm_kcalloc() helper
>    remoteproc: k3-r5: Use devm_ioremap_wc() helper
>    remoteproc: k3-r5: Use devm_rproc_add() helper
>    remoteproc: k3-r5: Add devm action to release tsp
> 
>   drivers/remoteproc/ti_k3_r5_remoteproc.c | 88 ++++++++++--------------
>   1 file changed, 35 insertions(+), 53 deletions(-)
>
Beleswar Prasad Padhi Dec. 19, 2024, 3:23 p.m. UTC | #2
On 12/19/2024 8:22 PM, Andrew Davis wrote:
> On 12/19/24 5:05 AM, Beleswar Padhi wrote:
>> This series uses various devm_ helpers to simplify device removal 
>> path in
>> ti_k3_r5_remoteproc driver. This is the first series in the TI K3
>> Remoteproc refactoring as long planned since [0].
>>
>> Testing Done:
>> 1. Tested boot of R5F remoteprocs in MCU and MAIN voltage domain in both
>> IPC-Only mode and Kernel remoteproc mode in all Jacinto K3 devices.
>> 2. Tested Lockstep, Split and Single-CPU Mode configuration (wherever
>> applicable) of R5F remoteprocs in all Jacinto K3 devices.
>> 3. Tested shutdown of R5F remoteprocs from Linux userspace and also by
>> executing `modprobe -r ti_k3_r5_remoteproc`.
>
> Did you also test that you could then start the cores back up?
>
> I think that might need some firmware fixes we are working on, so
> might not work even before these patches, but just wanted to check
> if we have tried it yet.


Yes, the above graceful shutdown feature is part of firmware fixes. 
Also, some support needs to be added in the Linux driver, which sends a 
special "SHUTDOWN" mailbox message to the remotecore which signals the 
firmware to relinquish all resources and shutdown gracefully. So, 
support for turning the remoteprocs back on is not yet added, and not 
tested.

>
>> 4. Tested that each patch in this series generates no new 
>> warnings/errors.
>
> Was that with `make W=1 C=1`? Sparse checks will be done during -next
> testing so good to check for those too.


Yes, did that testing.

>
> Otherwise patches all look good to me, for the series:
>
> Reviewed-by: Andrew Davis <afd@ti.com>


Thanks!

>
>>
>> v2: Changelog:
>> 1. Re-ordered patches in the series to use devm functions starting from
>> the last called function in remove(), to ease review. [Andrew]
>> 2. Fixed a missing return after dev_err_probe() call in [PATCH v2 3/5]
>> ("remoteproc: k3-r5: Use devm_ioremap_wc() helper"). [Andrew]
>> 3. Removed redundant rproc_del() call in [PATCH v2 4/5] ("remoteproc:
>> k3-r5: Use devm_rproc_add() helper").
>>
>> Link to v1:
>> https://lore.kernel.org/all/20241204111130.2218497-1-b-padhi@ti.com/
>>
>> [0]: https://lore.kernel.org/all/Zr4w8Vj0mVo5sBsJ@p14s/
>>
>> Beleswar Padhi (5):
>>    remoteproc: k3-r5: Add devm action to release reserved memory
>>    remoteproc: k3-r5: Use devm_kcalloc() helper
>>    remoteproc: k3-r5: Use devm_ioremap_wc() helper
>>    remoteproc: k3-r5: Use devm_rproc_add() helper
>>    remoteproc: k3-r5: Add devm action to release tsp
>>
>>   drivers/remoteproc/ti_k3_r5_remoteproc.c | 88 ++++++++++--------------
>>   1 file changed, 35 insertions(+), 53 deletions(-)
>>