]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
remoteproc: k3-r5: Use IO memset to clear TCMs
authorAndrew Davis <afd@ti.com>
Mon, 21 Oct 2024 20:45:55 +0000 (15:45 -0500)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Tue, 29 Oct 2024 17:19:26 +0000 (11:19 -0600)
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>
Link: https://lore.kernel.org/r/20241021204557.929823-1-afd@ti.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/remoteproc/ti_k3_r5_remoteproc.c

index 2f996a962f55755347e599551f8b7785b986d0dd..e1fe85e5eba6a49db387bc5cea1ac5cdc9110ba6 100644 (file)
@@ -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;
 }