[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180807061539.GG2395@vkoul-mobl>
Date: Tue, 7 Aug 2018 11:45:39 +0530
From: Vinod <vkoul@...nel.org>
To: Sibi Sankar <sibis@...eaurora.org>
Cc: bjorn.andersson@...aro.org, linux-remoteproc@...r.kernel.org,
linux-kernel@...r.kernel.org, ohad@...ery.com, kyan@...eaurora.org,
sricharan@...eaurora.org, akdwived@...eaurora.org,
linux-arm-msm@...r.kernel.org, tsoni@...eaurora.org
Subject: Re: [PATCH v3 1/6] remoteproc: Introduce custom dump function for
each remoteproc segment
Hi Sibi,
On 27-07-18, 20:49, Sibi Sankar wrote:
> Introduce custom dump function per remoteproc segment. It is responsible
> for filling the device memory segment associated with coredump
>
> Signed-off-by: Sibi Sankar <sibis@...eaurora.org>
> ---
> drivers/remoteproc/remoteproc_core.c | 15 ++++++++++-----
> include/linux/remoteproc.h | 3 +++
> 2 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 283b258f5e0f..ec56cd822b26 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1183,13 +1183,18 @@ static void rproc_coredump(struct rproc *rproc)
> phdr->p_align = 0;
>
> ptr = rproc_da_to_va(rproc, segment->da, segment->size);
> - if (!ptr) {
> - dev_err(&rproc->dev,
> +
> + if (segment->dump) {
> + segment->dump(rproc, ptr, segment->size, data + offset);
Am not sure I follow, you are calling this w/o checking if ptr is valid,
so you maybe passing null to segment->dump() ?
> + } else {
> + 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);
> + memset(data + offset, 0xff, segment->size);
> + } else {
> + memcpy(data + offset, ptr, segment->size);
> + }
--
~Vinod
Powered by blists - more mailing lists