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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 2AFF7C4743F for ; Mon, 7 Jun 2021 18:08:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 F00C96100B for ; Mon, 7 Jun 2021 18:08:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F00C96100B 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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=ocMNsJowsfFowpg1C72JFjr27HWIWB6/bDriI6nU/EU=; b=y1CLxGJwwE4GYT MYk6r6Uzz3M+w9UT/O2t96Pe5wKbqk94fY+63bMhQNtRjs+oWOAlekCBS8JCE15b78kCKXwcb1pAZ 6tnaYe3jVPx9W8DHT9eVR9V3WZ4zWOWiRVScfwkTgSZDPVg3aL9NY0fLa5Z15QfniledjvBAIG84y vvsaD4oCqCvP77qCON+WrWeZh/eQLpr6ZHB5a8PjkbZq9uFbo9m6C4pQQTbLL5x3yYSHnAIEa6EjS f0YpZNq9b6FoBRMhTWRP/jh2sty1ETKFvLdx97YHCCe0qOA+DQZBcgp/9Ri0lDoWk4t+NTHICHbLr nq+6Y8BoQ/pOrCL6MvcA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqJcF-004xnj-Hy; Mon, 07 Jun 2021 18:04:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqJc9-004xli-9V for linux-arm-kernel@lists.infradead.org; Mon, 07 Jun 2021 18:04:45 +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 5357B12FC; Mon, 7 Jun 2021 11:04:38 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A51313F73D; Mon, 7 Jun 2021 11:04:36 -0700 (PDT) Date: Mon, 7 Jun 2021 19:04:34 +0100 From: Cristian Marussi To: Sudeep Holla Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [RFC PATCH 02/10] firmware: arm_scmi: Add missing xfer reinit_completion Message-ID: <20210607180434.GC40811@e120937-lin> References: <20210606221232.33768-1-cristian.marussi@arm.com> <20210606221232.33768-3-cristian.marussi@arm.com> <20210607174142.jdirvbasvgl7q4oj@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210607174142.jdirvbasvgl7q4oj@bogus> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210607_110441_405958_83A5DAF4 X-CRM114-Status: GOOD ( 20.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Hi, On Mon, Jun 07, 2021 at 06:42:57PM +0100, Sudeep Holla wrote: > On Sun, Jun 06, 2021 at 11:12:24PM +0100, Cristian Marussi wrote: > > Reusing timed out xfers in a loop can lead to issue if completion was not > > properly reinitialized. > > > > Signed-off-by: Cristian Marussi > > --- > > drivers/firmware/arm_scmi/driver.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > > index bee33f9c2032..759ae4a23e74 100644 > > --- a/drivers/firmware/arm_scmi/driver.c > > +++ b/drivers/firmware/arm_scmi/driver.c > > @@ -448,6 +448,7 @@ static int do_xfer(const struct scmi_protocol_handle *ph, > > xfer->hdr.poll_completion); > > > > xfer->hdr.status = SCMI_SUCCESS; > > + reinit_completion(&xfer->done); > > > > What could happen after xfer_get_init->scmi_xfer_get->reinit_completion > that it needs to be re-initialised again. I don't see any reason for this ? > If there are, please state them explicitly. If this is needed, I would drop > the one in scmi_xfer_get(). > The reason, like I explained in the other reply in hdr.status, is the possibility of do_xfer loops and being more defensive. I agree that if what I blabbed in the other email is acceptable, I could drop the reinit_completion in xfer_get() and just use it before send_message(). Thanks, Cristian > -- > Regards, > Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel