* [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs
@ 2024-10-21 20:45 Andrew Davis
2024-10-21 20:45 ` [PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space Andrew Davis
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrew Davis @ 2024-10-21 20:45 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Hari Nagalla, Beleswar Padhi
Cc: linux-remoteproc, linux-kernel, Andrew Davis
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space
2024-10-21 20:45 [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Andrew Davis
@ 2024-10-21 20:45 ` Andrew Davis
2024-10-21 20:45 ` [PATCH 3/3] remoteproc: k3-dsp: " Andrew Davis
2024-10-29 17:20 ` [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Davis @ 2024-10-21 20:45 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Hari Nagalla, Beleswar Padhi
Cc: linux-remoteproc, linux-kernel, Andrew Davis
These memory regions are mapped as Normal Non-Cached which on
does not have the normal IO address space limitations and so this
cast is safe. Add '__force' to explicitly specify that the cast is
intentional to remove a sparse check warning.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/remoteproc/ti_k3_r5_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
index e1fe85e5eba6a..6560b7954027f 100644
--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
@@ -717,7 +717,7 @@ static struct resource_table *k3_r5_get_loaded_rsc_table(struct rproc *rproc,
* the hard-coded value suffices to support the IPC-only mode.
*/
*rsc_table_sz = 256;
- return (struct resource_table *)kproc->rmem[0].cpu_addr;
+ return (__force struct resource_table *)kproc->rmem[0].cpu_addr;
}
/*
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] remoteproc: k3-dsp: Force cast from iomem address space
2024-10-21 20:45 [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Andrew Davis
2024-10-21 20:45 ` [PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space Andrew Davis
@ 2024-10-21 20:45 ` Andrew Davis
2024-10-29 17:20 ` [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Davis @ 2024-10-21 20:45 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Hari Nagalla, Beleswar Padhi
Cc: linux-remoteproc, linux-kernel, Andrew Davis
These memory regions are mapped as Normal Non-Cached which on
does not have the normal IO address space limitations and so this
cast is safe. Add '__force' to explicitly specify that the cast is
intentional to remove a sparse check warning.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/remoteproc/ti_k3_dsp_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
index d08a3a98ada1c..ffb46c64170ac 100644
--- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c
@@ -403,7 +403,7 @@ static struct resource_table *k3_dsp_get_loaded_rsc_table(struct rproc *rproc,
* the hard-coded value suffices to support the IPC-only mode.
*/
*rsc_table_sz = 256;
- return (struct resource_table *)kproc->rmem[0].cpu_addr;
+ return (__force struct resource_table *)kproc->rmem[0].cpu_addr;
}
/*
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs
2024-10-21 20:45 [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Andrew Davis
2024-10-21 20:45 ` [PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space Andrew Davis
2024-10-21 20:45 ` [PATCH 3/3] remoteproc: k3-dsp: " Andrew Davis
@ 2024-10-29 17:20 ` Mathieu Poirier
2 siblings, 0 replies; 4+ messages in thread
From: Mathieu Poirier @ 2024-10-29 17:20 UTC (permalink / raw)
To: Andrew Davis
Cc: Bjorn Andersson, Hari Nagalla, Beleswar Padhi, linux-remoteproc,
linux-kernel
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-29 17:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-21 20:45 [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Andrew Davis
2024-10-21 20:45 ` [PATCH 2/3] remoteproc: k3-r5: Force cast from iomem address space Andrew Davis
2024-10-21 20:45 ` [PATCH 3/3] remoteproc: k3-dsp: " Andrew Davis
2024-10-29 17:20 ` [PATCH 1/3] remoteproc: k3-r5: Use IO memset to clear TCMs Mathieu Poirier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).