Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1890338ybh; Fri, 17 Jul 2020 04:08:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUkB5GpDJYZbUMCA5cC0CvFxPASLh5+v1m8t71zp6N1FdlmrZmqNx//LjejvvYful3IWB9 X-Received: by 2002:a17:906:434c:: with SMTP id z12mr7780064ejm.33.1594984132023; Fri, 17 Jul 2020 04:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594984132; cv=none; d=google.com; s=arc-20160816; b=l+q+8yHL8eP0GO4yJaLbh4qtuT40LeJoUtvkhnCLnsWrSffz4lFat9+H/jPTBMIaB4 jXrpfvK5w4dBa0tnq18BGAbSjEmE3k2JOLzbInwVn7EVbGbWu26lBm+3smA4MBkytrZZ E4hm1DTezsKz5q0DhGg24ST/cELIbbcC4MGO/iEO0/mIGuk8d2O6Xlxjp0DzJbSJAgqR BQTX5ZFLdq0z6gzs4U7RJL55s7ojM3Eu+7zJqdenCmoY5mI04PzhMYcBd7F/MRX+gYcG k2SPEpB5+OZRqgKlbuIgaSwYsBe3VY8Uz8iv+8keRnkt4qE4tzvMqy4SrOdoy8dCz76s 4sOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=B4HkrjKgk+SXP/IUsCaDUbCyXBVTrzaFa7kJvzg4rDs=; b=oWun2HtiJfSbpJdNEWoounuo5UlKqAlnHgYpcEmPKXfZ6NY0Ypk+0B40KxbmBHG6ng Tn+tPPzcNTbQoc7oiEHS4087QyGxa+sHa/ubF/G01jDNJwrFo9MUGvy8wRrvA5pgWGk3 xDZ+XtzXSZyi/cmyv5RNEYUoGBv/kydzgMpQd/6ex8stkwbBqnuE7r1zy4IJCDktt8g8 UG2R9efS0FkOedQ1OwxRz7vuBf2G0t73TO9hLz8R8csFWU3ZWB4vXUsgrq8Y6v4ELYks 48Jtnh8TL/Ld0Id/yP3XfgjFQK/fyMsvlZQNvsmj7R2BY93hx1qabCEa3KlRr2Cqh0oY P8+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=XsiS7cRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w3si5012078edx.581.2020.07.17.04.08.29; Fri, 17 Jul 2020 04:08:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=XsiS7cRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726079AbgGQLFf (ORCPT + 99 others); Fri, 17 Jul 2020 07:05:35 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:46021 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbgGQLFf (ORCPT ); Fri, 17 Jul 2020 07:05:35 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1594983934; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=B4HkrjKgk+SXP/IUsCaDUbCyXBVTrzaFa7kJvzg4rDs=; b=XsiS7cRupbhYOKr9g7S4fVVje0ZGq/7q4wJ5NQCavI4Zz4zkBKlME/y7x7EKsxWBZfyxfJQv bZ0viZmqpfwjH79NxW0nBSFYHY+P139nez5tIhdJTUQ2JTercA7fTAHRcHCTJhNoObHsT9bJ 6Z66u4ntwGnwenw9xYQLvRQCVd4= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 5f1185edee6926bb4feed5eb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 17 Jul 2020 11:05:17 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1336DC433C6; Fri, 17 Jul 2020 11:05:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id 57E48C433C9; Fri, 17 Jul 2020 11:05:16 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 17 Jul 2020 16:35:16 +0530 From: Sibi Sankar To: Rishabh Bhatnagar Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, sibis@codearora.org, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, linux-remoteproc-owner@vger.kernel.org Subject: Re: [PATCH v8 3/5] remoteproc: Pass size and offset as arguments to segment dump function In-Reply-To: <1594938035-7327-4-git-send-email-rishabhb@codeaurora.org> References: <1594938035-7327-1-git-send-email-rishabhb@codeaurora.org> <1594938035-7327-4-git-send-email-rishabhb@codeaurora.org> Message-ID: <93a9dea3f4ee6dcb815530efec8afe92@codeaurora.org> X-Sender: sibis@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-07-17 03:50, Rishabh Bhatnagar wrote: > Change the segment dump API signature to include size and offset > arguments. Refactor the qcom_q6v5_mss driver to use these > arguments while copying the segment. Doing this lays the ground > work for "inline" coredump functionality being added in the next > patch. > > Signed-off-by: Rishabh Bhatnagar Tested-by: Sibi Sankar Reviewed-by: Sibi Sankar > --- > drivers/remoteproc/qcom_q6v5_mss.c | 10 +++++----- > drivers/remoteproc/remoteproc_coredump.c | 5 +++-- > include/linux/remoteproc.h | 5 +++-- > 3 files changed, 11 insertions(+), 9 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_mss.c > b/drivers/remoteproc/qcom_q6v5_mss.c > index 037cd45..6baa3ae 100644 > --- a/drivers/remoteproc/qcom_q6v5_mss.c > +++ b/drivers/remoteproc/qcom_q6v5_mss.c > @@ -1199,7 +1199,7 @@ static int q6v5_mpss_load(struct q6v5 *qproc) > > static void qcom_q6v5_dump_segment(struct rproc *rproc, > struct rproc_dump_segment *segment, > - void *dest) > + void *dest, size_t cp_offset, size_t size) > { > int ret = 0; > struct q6v5 *qproc = rproc->priv; > @@ -1219,16 +1219,16 @@ static void qcom_q6v5_dump_segment(struct rproc > *rproc, > } > > if (!ret) > - ptr = ioremap_wc(qproc->mpss_phys + offset, segment->size); > + ptr = ioremap_wc(qproc->mpss_phys + offset + cp_offset, size); > > if (ptr) { > - memcpy(dest, ptr, segment->size); > + memcpy(dest, ptr, size); > iounmap(ptr); > } else { > - memset(dest, 0xff, segment->size); > + memset(dest, 0xff, size); > } > > - qproc->current_dump_size += segment->size; > + qproc->current_dump_size += size; > > /* Reclaim mba after copying segments */ > if (qproc->current_dump_size == qproc->total_dump_size) { > diff --git a/drivers/remoteproc/remoteproc_coredump.c > b/drivers/remoteproc/remoteproc_coredump.c > index ded0244..390f563 100644 > --- a/drivers/remoteproc/remoteproc_coredump.c > +++ b/drivers/remoteproc/remoteproc_coredump.c > @@ -72,7 +72,8 @@ int rproc_coredump_add_custom_segment(struct rproc > *rproc, > dma_addr_t da, size_t size, > void (*dumpfn)(struct rproc *rproc, > struct rproc_dump_segment *segment, > - void *dest), > + void *dest, size_t offset, > + size_t size), > void *priv) > { > struct rproc_dump_segment *segment; > @@ -183,7 +184,7 @@ void rproc_coredump(struct rproc *rproc) > elf_phdr_set_p_align(class, phdr, 0); > > if (segment->dump) { > - segment->dump(rproc, segment, data + offset); > + segment->dump(rproc, segment, data + offset, 0, segment->size); > } else { > ptr = rproc_da_to_va(rproc, segment->da, segment->size); > if (!ptr) { > diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h > index e7b7bab..eb08139 100644 > --- a/include/linux/remoteproc.h > +++ b/include/linux/remoteproc.h > @@ -451,7 +451,7 @@ struct rproc_dump_segment { > > void *priv; > void (*dump)(struct rproc *rproc, struct rproc_dump_segment *segment, > - void *dest); > + void *dest, size_t offset, size_t size); > loff_t offset; > }; > > @@ -630,7 +630,8 @@ int rproc_coredump_add_custom_segment(struct rproc > *rproc, > dma_addr_t da, size_t size, > void (*dumpfn)(struct rproc *rproc, > struct rproc_dump_segment *segment, > - void *dest), > + void *dest, size_t offset, > + size_t size), > void *priv); > int rproc_coredump_set_elf_info(struct rproc *rproc, u8 class, u16 > machine); -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.