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=-2.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 580D0C38A29 for ; Wed, 15 Apr 2020 13:16:28 +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 295D02076D for ; Wed, 15 Apr 2020 13:16:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="j/UUlM1W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 295D02076D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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.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=dxe0lmkgveTxd0hD8f896fZgjT9QShcc2etx71elkPU=; b=j/UUlM1W5UIZgq Hv+zbJIrjTfAyHYzbNh5gcKQa6lA57XlFCZx1W7KGZyJN0dc+C3/qL1kaiNLdOwZuxycoyR+l8x1G L7JQe9Arn7JdJ7d58ZHEgvHWB+WvTzl67k/hZSn6qXugxROPSN/Yoj8nb84TTo0zQGXFUiXgse7QY RtLcBvPWuCLsRK4PHHJ6lr41OF0AgsK36MrGpiaBoDzdektlOQNzBFBFSR84EwyWS6D5GVphmKA0O qiaZqK00NVt4iVJ6O6bGkhWrFVJQTj/rAodnt4pqdKQBMTD7/cfxKT+Cog7L8ihVpmJZxgnmgc+Bs CKTn7e+wqiU3fnJpVAFg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOhtw-0006nk-8q; Wed, 15 Apr 2020 13:16:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOhts-0006lt-Cv for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2020 13:16:21 +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 016531063; Wed, 15 Apr 2020 06:16:18 -0700 (PDT) Received: from bogus (unknown [10.37.12.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D75C3F6C4; Wed, 15 Apr 2020 06:16:15 -0700 (PDT) Date: Wed, 15 Apr 2020 14:16:12 +0100 From: Sudeep Holla To: Etienne Carriere Subject: Re: [PATCH V5 2/2] firmware: arm_scmi: add smc/hvc transport Message-ID: <20200415131612.GC31928@bogus> References: <1583673879-20714-3-git-send-email-peng.fan@nxp.com> <5e96e916.1c69fb81.14365.050b@mx.google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5e96e916.1c69fb81.14365.050b@mx.google.com> 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-20200415_061620_490880_78B41CC2 X-CRM114-Status: GOOD ( 20.16 ) 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: devicetree@vger.kernel.org, peng.fan@nxp.com, f.fainelli@gmail.com, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, Sudeep Holla , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 15, 2020 at 12:58:58PM +0200, Etienne Carriere wrote: > Hello Peng, > > I have 2 comments on this change. The main is about using > arm_smccc_1_1_invoke(). Below some details and I added comments > inside you patch. The second of on SMC return value, see my > comment in your patch below. > > About arm_smccc_1_1_invoke(), this functon currently relies on PSCI > driver to define a conduit method but SCMI agent driver does not > mandate CONFIG_PSCI to be enable. > Yes this was discussed and it is done so deliberately. I have added the build dependency when I merged the patch. There's no dependency on CONFIG_PSCI. > Could you add an optional "method" property for "arm,scmi-smc" for platforms > willing to not rely on PSCI Linux driver? If no property "method" is > defined in the FDT, invocation relies on arm_smccc_1_1_invoke(). > Nope, we don't want mixture here. Why is the system not using PSCI/SMCCC ? > "method" naming mimics what is done in the OP-TEE driver (drivers/tee/optee/). > Here is a proposal for the documenting property "method" in > Documentation/arm,scmi.txt: > > - method : "smc" or "hvc" > Optional property defining the conduit method for to be used > for invoking the SCMI server in secure world. > "smc" states instruction SMC #0 is used whereas "hvc" states > instruction HVC #0 is used. > > It was rejected, you can try your luck with OPTEE :) We will just use the system conduit here with SCMI for SMC/HVC transport. Details in previous version of the patch. [...] > > +struct scmi_smc { > > + struct scmi_chan_info *cinfo; > > + struct scmi_shared_mem __iomem *shmem; > > + u32 func_id; > > +}; > > Add here a field for the secure world invocation function handler: > > scmi_arm_smccc_invoke_fn *invoke_fn; > As stated not needed if we use arm_smccc_1_1_invoke() [...] > > The SCMI server is likely not to return a errno compliant value. > > SMCCC specification states that unsupported function IDs should return signed > extended -1. I suggest to change the return above with: > > return res.a0 == ~0 ? -EINVAL : 0; > I need to check that. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel