remoteproc: elf_loader: fix loading segment when is_iomem true
PATCH v2 1/1 remoteproc: elf_loader: fix loading segment when is_iomem true
From: Peng Fan <[email protected]>
It seems luckliy work on i.MX platform, but it is wrong. Need use memcpy_toio, not memcpy_fromio.
Fixes 40df0a91b2a52 ("remoteproc: add is_iomem to da_to_va")
Reported-by kernel test robot <[email protected]>
Reported-by Dong Aisheng <[email protected]>
Signed-off-by Peng Fan <[email protected]>
---
V2:
the __iomem cast should be for the 1st parameter.
drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/remoteproc_elf_loader.c +1 -1
@@ -220,7 +220,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw)/* put the segment where the remote processor expects it */ if (filesz) {if (is_iomem) -memcpy_fromio (ptr, (void __iomem *)(elf_data + offset), filesz); +memcpy_toio ((void __iomem *)ptr, elf_data + offset, filesz);else memcpy (ptr, elf_data + offset, filesz); }
Signature · 1 line
2.30.0
Hi Bjorn,
Quoted 2 lines
Subject: [PATCH V2] remoteproc:
elf_loader: fix loading segment whenis_iomemtrue
Would you pick up this as a fix?
Thanks,
Peng.
Quoted 38 lines
From: Peng Fan <[email protected]>
It seems luckliy work on i.MX platform, but it is wrong. Need use
memcpy_toio, notmemcpy_fromio.Fixes 40df0a91b2a52 ("remoteproc: add is_iomem to da_to_va")Reported-by kernel test robot <[email protected]>Reported-by Dong Aisheng <[email protected]>Signed-off-by Peng Fan <[email protected]>---
V2:
the__iomemcast should be for the 1st parameter.drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/remoteproc/remoteproc_elf_loader.c +1
-1@@ -220,7 +220,7 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) /* put the segment where the remote processor expects it */ if (filesz) {if (is_iomem) -memcpy_fromio (ptr, (void __iomem *)(elf_data + offset), filesz); +memcpy_toio ((void __iomem *)ptr, elf_data + offset, filesz);drivers/remoteproc/remoteproc_elf_loader.c +0
-1else memcpy (ptr, elf_data + offset, filesz); } --2.30.0