Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1040547ybh; Thu, 16 Jul 2020 01:11:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJWG6Cvr8RPIvkLioCUeWrPM7ZhMtDm0jJvBLGSVS5DUygodQkwV4BDiY1SA50ENeFdFYw X-Received: by 2002:a17:906:1a16:: with SMTP id i22mr2670457ejf.439.1594887088112; Thu, 16 Jul 2020 01:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594887088; cv=none; d=google.com; s=arc-20160816; b=HHCPEnZh8Iai92EQr3PIDvrXX443ecw+jePxpQVDp8yZYLsx0I2HUBjrhO9GLmMFEL JoZ/M/SOwTtMm1jsPYj1jSwVsSzoW6KHzKgXU4gjJMMERJYZyUGDA582XQZ0upMhbDGy gvXgblHrF/EpQvoAfuUB1TIMolhff8GiXGwgMLLQdmQujrSnvZScWRivPMyDYwWYaQH0 QEHcIINXZ/cPXOd7EoeSeXZ9yOwL0d5YUiEvr6aevdBGsnnSCfuY7e1Jd3qIKgaOgat9 YgaOWZK3ERkzhtw9IK/q+WXW5Ic89j/yyrNSEQy0wkrFYCGr/KuSoVdhAY8hCcikTuqf uFXQ== 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=OUndtw99GjuFdnvm3oihRnsk0PT6v/AS5DPedfQMp64=; b=GIvTaTLqP0daClR/qsCwn2rESQy0QTD+KZu3ImyALCjdl2vDh/WlKirQsBicjvXLR/ 0Qls4l3p/+KEcnbf3aiAKRy4vBOjpP2BIEUGXgfrkJyKWPz4rojOF1ukgzC/EMdflA1V VUFFfZQQgjG/DOQr38DH6xhz/zR/SMlxIM6krp8juwHzYKkVFyg9Z4l8OaV0rxzTnBx/ vuFx7t0TEIQvM0XZ4NYYQRB3crUuhKZFkso0aVniiS3SSGoxr80o8xo3dNlvvrbZxeOP KLO9BlngJxIR2l9irL7qpt2tN3TqLrxrIg7EpTXTo0IZ+jd3wGcrmc3/ATwBfZZgDNqz 2Wqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=rlzotqsD; 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 i22si2501609edy.547.2020.07.16.01.11.04; Thu, 16 Jul 2020 01:11:28 -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=rlzotqsD; 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 S1726837AbgGPIKo (ORCPT + 99 others); Thu, 16 Jul 2020 04:10:44 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:47963 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726232AbgGPIKn (ORCPT ); Thu, 16 Jul 2020 04:10:43 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1594887042; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=OUndtw99GjuFdnvm3oihRnsk0PT6v/AS5DPedfQMp64=; b=rlzotqsDzYmOXIPLrm0hXNBkdv+YI9BQvgCIDRWYDxRL4Hp7DszKO0W7CAdNZ1eGmJqyH9dG 3i7bG3wZzmqWAwgYiI0YOqFHwV4xWDs101WcoV/T/zCihz8DD7Uab6SDtcHFpPS9Nr3EYrVz QoZuqy6LJrrxnw16mwAxZeZAYTw= 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-n05.prod.us-east-1.postgun.com with SMTP id 5f100b811e603dbb44934c4b (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 16 Jul 2020 08:10:41 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2A221C433C6; Thu, 16 Jul 2020 08:10:41 +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,URIBL_BLOCKED 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 31ABDC433C9; Thu, 16 Jul 2020 08:10:40 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 16 Jul 2020 13:40:40 +0530 From: Sibi Sankar To: Mathieu Poirier Cc: Rishabh Bhatnagar , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, tsoni@codeaurora.org, psodagud@codeaurora.org, sidgup@codeaurora.org, linux-kernel-owner@vger.kernel.org Subject: Re: [PATCH v1 2/4] remoteproc: qcom_q6v5_mss: Replace mask based tracking with size In-Reply-To: <20200714171836.GA1407705@xps15> References: <1594326716-15474-1-git-send-email-rishabhb@codeaurora.org> <1594326716-15474-3-git-send-email-rishabhb@codeaurora.org> <20200714171836.GA1407705@xps15> Message-ID: 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-14 22:48, Mathieu Poirier wrote: > On Thu, Jul 09, 2020 at 01:31:54PM -0700, Rishabh Bhatnagar wrote: >> From: Sibi Sankar >> >> In order to land inline coredump support for mss, the dump_segment >> function would need to support granularities less than the segment >> size. This is achieved by replacing mask based tracking with size. >> >> Signed-off-by: Sibi Sankar >> Signed-off-by: Rishabh Bhatnagar >> --- >> drivers/remoteproc/qcom_q6v5_mss.c | 15 +++++++-------- >> 1 file changed, 7 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/remoteproc/qcom_q6v5_mss.c >> b/drivers/remoteproc/qcom_q6v5_mss.c >> index feb70283b..c6ce032 100644 >> --- a/drivers/remoteproc/qcom_q6v5_mss.c >> +++ b/drivers/remoteproc/qcom_q6v5_mss.c >> @@ -181,8 +181,8 @@ struct q6v5 { >> bool running; >> >> bool dump_mba_loaded; >> - unsigned long dump_segment_mask; >> - unsigned long dump_complete_mask; >> + size_t current_dump_size; >> + size_t total_dump_size; >> >> phys_addr_t mba_phys; >> void *mba_region; >> @@ -1203,7 +1203,6 @@ static void qcom_q6v5_dump_segment(struct rproc >> *rproc, >> { >> int ret = 0; >> struct q6v5 *qproc = rproc->priv; >> - unsigned long mask = BIT((unsigned long)segment->priv); >> int offset = segment->da - qproc->mpss_reloc; >> void *ptr = NULL; >> >> @@ -1229,10 +1228,10 @@ static void qcom_q6v5_dump_segment(struct >> rproc *rproc, >> memset(dest, 0xff, segment->size); >> } >> >> - qproc->dump_segment_mask |= mask; >> + qproc->current_dump_size += segment->size; >> >> /* Reclaim mba after copying segments */ >> - if (qproc->dump_segment_mask == qproc->dump_complete_mask) { >> + if (qproc->current_dump_size == qproc->total_dump_size) { >> if (qproc->dump_mba_loaded) { >> /* Try to reset ownership back to Q6 */ >> q6v5_xfer_mem_ownership(qproc, &qproc->mpss_perm, >> @@ -1274,7 +1273,7 @@ static int q6v5_start(struct rproc *rproc) >> "Failed to reclaim mba buffer system may become unstable\n"); >> >> /* Reset Dump Segment Mask */ >> - qproc->dump_segment_mask = 0; >> + qproc->current_dump_size = 0; >> qproc->running = true; >> >> return 0; >> @@ -1323,7 +1322,7 @@ static int >> qcom_q6v5_register_dump_segments(struct rproc *rproc, >> >> ehdr = (struct elf32_hdr *)fw->data; >> phdrs = (struct elf32_phdr *)(ehdr + 1); >> - qproc->dump_complete_mask = 0; >> + qproc->total_dump_size = 0; >> >> for (i = 0; i < ehdr->e_phnum; i++) { >> phdr = &phdrs[i]; >> @@ -1338,7 +1337,7 @@ static int >> qcom_q6v5_register_dump_segments(struct rproc *rproc, >> if (ret) >> break; > > There is also no longer a need to carry the 'i' in: > > ret = rproc_coredump_add_custom_segment(rproc, > phdr->p_paddr, > phdr->p_memsz, > > qcom_q6v5_dump_segment, > (void *)i); I assume Rishabh will re-spin the series today and this will be taken care as well. >> >> - qproc->dump_complete_mask |= BIT(i); >> + qproc->total_dump_size += phdr->p_memsz; >> } >> >> release_firmware(fw); >> -- >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora >> Forum, >> a Linux Foundation Collaborative Project >> -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.