diff options
author | Sibi Sankar <sibis@codeaurora.org> | 2018-10-17 19:25:23 +0530 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2018-10-19 11:14:16 -0700 |
commit | 3952105df4723abbd36b57e88c8dad42cf6c8b59 (patch) | |
tree | ce9b4e551a7faffe953c929aab75deb68c34f0e8 /drivers/remoteproc | |
parent | c6aed238b7a9b15a5c90a0c31f1d36577b5d2cbe (diff) | |
download | linux-stable-3952105df4723abbd36b57e88c8dad42cf6c8b59.tar.gz linux-stable-3952105df4723abbd36b57e88c8dad42cf6c8b59.tar.bz2 linux-stable-3952105df4723abbd36b57e88c8dad42cf6c8b59.zip |
remoteproc: Introduce custom dump function for each remoteproc segment
Introduce custom dump function and private data per remoteproc dump
segment. The dump function is responsible for filling the device memory
segment associated with coredump
Signed-off-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index f77a42f6a8aa..6bed40d01dbf 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1508,14 +1508,18 @@ static void rproc_coredump(struct rproc *rproc) phdr->p_flags = PF_R | PF_W | PF_X; phdr->p_align = 0; - ptr = rproc_da_to_va(rproc, segment->da, segment->size); - if (!ptr) { - dev_err(&rproc->dev, - "invalid coredump segment (%pad, %zu)\n", - &segment->da, segment->size); - memset(data + offset, 0xff, segment->size); + if (segment->dump) { + segment->dump(rproc, segment, data + offset); } else { - memcpy(data + offset, ptr, segment->size); + ptr = rproc_da_to_va(rproc, segment->da, segment->size); + if (!ptr) { + dev_err(&rproc->dev, + "invalid coredump segment (%pad, %zu)\n", + &segment->da, segment->size); + memset(data + offset, 0xff, segment->size); + } else { + memcpy(data + offset, ptr, segment->size); + } } offset += phdr->p_filesz; |