diff mbox series

[1/3] remoteproc: k3-r5: Use IO memset to clear TCMs

Message ID 20241021204557.929823-1-afd@ti.com (mailing list archive)
State New
Headers show
Series [1/3] remoteproc: k3-r5: Use IO memset to clear TCMs | expand

Commit Message

Andrew Davis Oct. 21, 2024, 8:45 p.m. UTC
While it should be safe to use normal memset() on these memories as they
are mapped as Normal Non-Cached, using the memset_io() provides stronger
guarantees on access alignment and fixes a sparse check warning. Switch
to memset_io() here.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 drivers/remoteproc/ti_k3_r5_remoteproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mathieu Poirier Oct. 29, 2024, 5:20 p.m. UTC | #1
I have applied all 3 patches in this set.

Thanks,
Mathieu

On Mon, Oct 21, 2024 at 03:45:55PM -0500, Andrew Davis wrote:
> While it should be safe to use normal memset() on these memories as they
> are mapped as Normal Non-Cached, using the memset_io() provides stronger
> guarantees on access alignment and fixes a sparse check warning. Switch
> to memset_io() here.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>  drivers/remoteproc/ti_k3_r5_remoteproc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> index 2f996a962f557..e1fe85e5eba6a 100644
> --- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
> +++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
> @@ -487,10 +487,10 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
>  	 * can be effective on all TCM addresses.
>  	 */
>  	dev_dbg(dev, "zeroing out ATCM memory\n");
> -	memset(core->mem[0].cpu_addr, 0x00, core->mem[0].size);
> +	memset_io(core->mem[0].cpu_addr, 0x00, core->mem[0].size);
>  
>  	dev_dbg(dev, "zeroing out BTCM memory\n");
> -	memset(core->mem[1].cpu_addr, 0x00, core->mem[1].size);
> +	memset_io(core->mem[1].cpu_addr, 0x00, core->mem[1].size);
>  
>  	return 0;
>  }
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
index 2f996a962f557..e1fe85e5eba6a 100644
--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
@@ -487,10 +487,10 @@  static int k3_r5_rproc_prepare(struct rproc *rproc)
 	 * can be effective on all TCM addresses.
 	 */
 	dev_dbg(dev, "zeroing out ATCM memory\n");
-	memset(core->mem[0].cpu_addr, 0x00, core->mem[0].size);
+	memset_io(core->mem[0].cpu_addr, 0x00, core->mem[0].size);
 
 	dev_dbg(dev, "zeroing out BTCM memory\n");
-	memset(core->mem[1].cpu_addr, 0x00, core->mem[1].size);
+	memset_io(core->mem[1].cpu_addr, 0x00, core->mem[1].size);
 
 	return 0;
 }