From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EAE2C433DF for ; Fri, 9 Oct 2020 15:22:25 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F967206CB for ; Fri, 9 Oct 2020 15:22:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QYY66/tc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F967206CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GOWX9UXMt88XzCHFrANXLrsEXSh+2sQO2OMLeDQx3N0=; b=QYY66/tc1riPR1o6JxxDImtR9 i2MRuMzVTfls06ZfFFWt8VVDi2RywXLWuE8xCgrCpCmc5td/Wc3KANwhgVkVC9Bq6N6A1MdXPqTCJ VhYfITNWeZs7mQTZQhU782gmYcYAJCGA/DBgRdwCNaA9hlwP9v9lmw8ydl6UItAVOBBMDrsTGkUHE UhZsAciSSWhuQTKqtfOVihwRwKnf5YvnDo7YLYpPPLRJhOTN1ph3wi0SydGj069NCkRXPVBvTjppV dhNy/1lbBTKzrw62KWc/kLXHEWZaaBsMgFkiiZBl6ZbLVH7hmc0O4gPw3QYnNq55Bu+oKg5ZJmoXc xkY4L5LAw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQuCZ-0003rg-DG; Fri, 09 Oct 2020 15:20:59 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQuCX-0003r0-69 for linux-arm-kernel@lists.infradead.org; Fri, 09 Oct 2020 15:20:58 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A3C941063; Fri, 9 Oct 2020 08:20:54 -0700 (PDT) Received: from bogus (unknown [10.57.53.233]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7C6803F70D; Fri, 9 Oct 2020 08:20:53 -0700 (PDT) Date: Fri, 9 Oct 2020 16:20:51 +0100 From: Sudeep Holla To: Etienne Carriere Subject: Re: [PATCH 2/5] firmware: arm_scmi: fix transfer missing re-initialization Message-ID: <20201009152051.qjxdg3goqqmdtr74@bogus> References: <20201008143722.21888-1-etienne.carriere@linaro.org> <20201008143722.21888-2-etienne.carriere@linaro.org> <20201008211804.soegjqsvmsgfmcne@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201009_112057_542791_D4134E15 X-CRM114-Status: GOOD ( 26.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Souvik Chakravarty , Vincent Guittot , Cristian Marussi , linux-kernel@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 09, 2020 at 02:38:16PM +0200, Etienne Carriere wrote: > On Thu, 8 Oct 2020 at 23:18, Sudeep Holla wrote: > > > > On Thu, Oct 08, 2020 at 04:37:19PM +0200, Etienne Carriere wrote: > > > Implement helper function scmi_do_xfer_again() to process consecutive > > > transfers that are initialized only once with scmi_xfer_get_init() > > > and hence get the pool completion and responses message length not > > > reloaded regarding last completed transfer. > > > > > > Signed-off-by: Etienne Carriere > > > --- > > > drivers/firmware/arm_scmi/base.c | 2 +- > > > drivers/firmware/arm_scmi/clock.c | 2 +- > > > drivers/firmware/arm_scmi/common.h | 2 ++ > > > drivers/firmware/arm_scmi/driver.c | 10 ++++++++++ > > > drivers/firmware/arm_scmi/perf.c | 2 +- > > > drivers/firmware/arm_scmi/sensors.c | 2 +- > > > 6 files changed, 16 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c > > > index 9853bd3c4d45..508f214baa1b 100644 > > > --- a/drivers/firmware/arm_scmi/base.c > > > +++ b/drivers/firmware/arm_scmi/base.c > > > @@ -183,7 +183,7 @@ static int scmi_base_implementation_list_get(const struct scmi_handle *handle, > > > /* Set the number of protocols to be skipped/already read */ > > > *num_skip = cpu_to_le32(tot_num_ret); > > > > > > - ret = scmi_do_xfer(handle, t); > > > + ret = scmi_do_xfer_again(handle, t); > > > if (ret) > > > break; > > > > > > diff --git a/drivers/firmware/arm_scmi/clock.c b/drivers/firmware/arm_scmi/clock.c > > > index c1cfe3ee3d55..9bb54c1a8d55 100644 > > > --- a/drivers/firmware/arm_scmi/clock.c > > > +++ b/drivers/firmware/arm_scmi/clock.c > > > @@ -161,7 +161,7 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id, > > > /* Set the number of rates to be skipped/already read */ > > > clk_desc->rate_index = cpu_to_le32(tot_rate_cnt); > > > > > > - ret = scmi_do_xfer(handle, t); > > > + ret = scmi_do_xfer_again(handle, t); > > > if (ret) > > > goto err; > > > > > > diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h > > > index 37fb583f1bf5..6d4eea7b0f3e 100644 > > > --- a/drivers/firmware/arm_scmi/common.h > > > +++ b/drivers/firmware/arm_scmi/common.h > > > @@ -143,6 +143,8 @@ struct scmi_xfer { > > > > > > void scmi_xfer_put(const struct scmi_handle *h, struct scmi_xfer *xfer); > > > int scmi_do_xfer(const struct scmi_handle *h, struct scmi_xfer *xfer); > > > +int scmi_do_xfer_again(const struct scmi_handle *handle, > > > + struct scmi_xfer *xfer); > > > int scmi_do_xfer_with_response(const struct scmi_handle *h, > > > struct scmi_xfer *xfer); > > > int scmi_xfer_get_init(const struct scmi_handle *h, u8 msg_id, u8 prot_id, > > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > > > index c5dea87edf8f..887cb8249db0 100644 > > > --- a/drivers/firmware/arm_scmi/driver.c > > > +++ b/drivers/firmware/arm_scmi/driver.c > > > @@ -402,6 +402,16 @@ int scmi_do_xfer(const struct scmi_handle *handle, struct scmi_xfer *xfer) > > > return ret; > > > } > > > > > > +int scmi_do_xfer_again(const struct scmi_handle *handle, struct scmi_xfer *xfer) > > > +{ > > > + struct scmi_info *info = handle_to_scmi_info(handle); > > > + > > > + xfer->rx.len = info->desc->max_msg_size; > > > > I am tempted to just have helper for above and use it where needed. > > Or may be I just don't like the name of the function, how about > > scmi_do_xfer_rxlen_reinit or anything else. Suggestions ? > > I think a smoother way would be that scmi_do_xfer() initializes > both > xfer->rx.len = info->desc->max_msg_size Possibly > and > xfer->hdr.poll_completion = false > instead of doing that from scmi_xfer_get_init(). > > > > > > + xfer->hdr.poll_completion = false; > > > > Do we really need the above ? > > I think so. Once a transfer is completed, poll_completion is true. Where and how ? By default it is always false and it can be set to true only by perf set/get calls. So I still see no need for this. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel