diff options
author | Peng Fan <[email protected]> | 2021-09-10 17:06:16 +0800 |
---|---|---|
committer | Bjorn Andersson <[email protected]> | 2021-09-27 18:37:01 -0500 |
commit | 24acbd9dc934f5d9418a736c532d3970a272063e (patch) | |
tree | c2b1e4143afecb38659fb47118fce678f9629722 | |
parent | c1fe10d238c0256a77dbc4bf6493b9782b2a218d (diff) |
remoteproc: elf_loader: Fix loading segment when is_iomem true
It seems luckliy work on i.MX platform, but it is wrong.
Need use memcpy_toio, not memcpy_fromio.
Fixes: 40df0a91b2a5 ("remoteproc: add is_iomem to da_to_va")
Tested-by: Dong Aisheng <[email protected]> (i.MX8MQ)
Reported-by: kernel test robot <[email protected]>
Reported-by: Dong Aisheng <[email protected]>
Signed-off-by: Peng Fan <[email protected]>
Cc: stable <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mathieu Poirier <[email protected]>
Signed-off-by: Bjorn Andersson <[email protected]>
-rw-r--r-- | drivers/remoteproc/remoteproc_elf_loader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index 469c52e62faf..44e7f9308f4b 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -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); } |