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=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 2C049C433E0 for ; Tue, 5 Jan 2021 17:37:22 +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 D08FC22CA2 for ; Tue, 5 Jan 2021 17:37:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D08FC22CA2 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=50n7v6229hyEnzcprEeIcwMUANOWLq2AalbxIonlj/0=; b=hp9hZJubHwNTzup/7Ed/j2+Kl vtu0AG3u4pSzxiStQAKlE4WoVGmDMVXqty2E40MvlBlkkdNxHTFzBm5uPV3jnLOKpm1AR5d3dQ3zl A6IUbE4wpQNNKfvI1UQMeUlMZlG0UxcRXo9mbqYsJF5l7aPZY2R23VD+g8NnC3y+9lc2OnfSHWzg9 uF4flSjhizALZP8DS/kcMODAF8vf3TnPv2fapVHr/BOR65yYasS7P4VGvQHWzDQBwoXH39T7Aucvx rorzFIQcYExzp8RnkyFx5FXigQS9AMwMOPP506oO1y+U7GX45h2kQ9muwVieUdLdZwxXJd2fADDh1 kSvDI+mwA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kwqFA-0004U6-3c; Tue, 05 Jan 2021 17:35:40 +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 1kwqF6-0004Tj-Pa for linux-arm-kernel@lists.infradead.org; Tue, 05 Jan 2021 17:35:38 +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 7D5A71063; Tue, 5 Jan 2021 09:35:31 -0800 (PST) Received: from bogus (unknown [10.57.35.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC94A3F66E; Tue, 5 Jan 2021 09:35:29 -0800 (PST) Date: Tue, 5 Jan 2021 17:35:26 +0000 From: Sudeep Holla To: Florian Fainelli Subject: Re: [PATCH v4 2/2] firmware: arm_scmi: Augment SMC/HVC to allow optional interrupt Message-ID: <20210105173526.yvjh2bxnofjzmc6n@bogus> References: <20201222145603.40192-1-jim2101024@gmail.com> <20201222145603.40192-3-jim2101024@gmail.com> 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-20210105_123536_905436_C6ADA6F8 X-CRM114-Status: GOOD ( 19.55 ) 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: open list , Jim Quinlan , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, Sudeep Holla , "open list:SYSTEM CONTROL & POWER/MANAGEMENT INTERFACE Mes..." 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 Tue, Dec 22, 2020 at 07:37:22PM -0800, Florian Fainelli wrote: > > > On 12/22/2020 6:56 AM, Jim Quinlan wrote: > > The SMC/HVC SCMI transport is modified to allow the completion of an SCMI > > message to be indicated by an interrupt rather than the return of the smc > > call. This accommodates the existing behavior of the BrcmSTB SCMI > > "platform" whose SW is already out in the field and cannot be changed. > > > > Signed-off-by: Jim Quinlan > > This looks good to me, just one question below: > > [snip] > > > @@ -111,6 +145,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo, > > shmem_tx_prepare(scmi_info->shmem, xfer); > > > > arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res); > > + if (scmi_info->irq) > > + wait_for_completion(&scmi_info->tx_complete); > > Do we need this to have a preceding call to reinit_completion()? It does > not look like this is going to make any practical difference but there > are drivers doing that for correctness. Why do you think that might not cause any issue ? After first message is completed and ISR is executed, the completion flag remains done for ever. So practically 2nd message onwards won't block in wait_for_completion which means return from smc/hvc is actually completion too which is clearly wrong or am I missing something ? Jim, please confirm either way. If you agree I can add the below snippet, no need to repost. Regards, Sudeep -- diff --git i/drivers/firmware/arm_scmi/smc.c w/drivers/firmware/arm_scmi/smc.c index fd41d436e34b..86eac0831d3c 100644 --- i/drivers/firmware/arm_scmi/smc.c +++ w/drivers/firmware/arm_scmi/smc.c @@ -144,6 +145,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo, shmem_tx_prepare(scmi_info->shmem, xfer); + if (scmi_info->irq) + reinit_completion(&scmi_info->tx_complete); arm_smccc_1_1_invoke(scmi_info->func_id, 0, 0, 0, 0, 0, 0, 0, &res); if (scmi_info->irq) wait_for_completion(&scmi_info->tx_complete); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel