Skip to content

Commit

Permalink
remoteproc: elf_loader: fix loading segment when is_iomem true
Browse files Browse the repository at this point in the history
It seems luckliy work on i.MX platform, but it is wrong.
Need use memcpy_toio, not memcpy_fromio.

Fixes: 40df0a9 ("remoteproc: add is_iomem to da_to_va")
Tested-by: Dong Aisheng <aisheng.dong@nxp.com> (i.MX8MQ)
Reported-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
  • Loading branch information
MrVan authored and intel-lab-lkp committed Jun 28, 2021
1 parent 2ded365 commit 2c90d7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/remoteproc/remoteproc_elf_loader.c
Expand Up @@ -216,7 +216,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(ptr, (void __iomem *)(elf_data + offset), filesz);
else
memcpy(ptr, elf_data + offset, filesz);
}
Expand Down

0 comments on commit 2c90d7d

Please sign in to comment.