Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp469180rwe; Thu, 1 Sep 2022 02:39:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ynpk0ydhU3oSKaxHpOBQHbECXGjG3lX6sUAoaFBfkM3nWzhR2gWazgDFfWccVXijbMoJG X-Received: by 2002:a17:90b:4d07:b0:1ef:521c:f051 with SMTP id mw7-20020a17090b4d0700b001ef521cf051mr7863987pjb.164.1662025171627; Thu, 01 Sep 2022 02:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662025171; cv=none; d=google.com; s=arc-20160816; b=y/WLbZhYpCtMFAI6624q8qCiYpqeoeR4KEI3qmJeqz5j4FhU/PXFI0kbMf7PzQ2BnM TZL+o/w4GyL5OR/cqob6h/CPrChQ0BV3VMkXnKZgfqxmftXFjj1jfFDyF19zqZywKW5k HNgGbzdl+hQwttIEWXEx0uTergTDg0EUt/jktG2CiLEC7pRsTRiU0WqxFoWuX2RPoymM 4kVFYcVkaQ7XBSgx1XbgnNZBqFAwSOp7PGXYVrnw3k1bPO52SJ0Ei/KHJcycq8+rONFR xtVdv/hMKkgsPS1dlzSHDo7WDGLZ5MDP79eWnlwLKUOLLscYAi50q2QtW5ZfcMdiWJvV dnyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KTIPWhd11V5K9E60dJPbJEKTIo++TG+V66EiqdfR/i0=; b=B9vaMap2J0MfIfAVvRDHuG5g+Mwtq/HUAJhXmQSh024d9LFIAqzfGdp9hdn8e1ZBYG adWqK80JF+DvfJBR7n5p3j/Kw/Ce79zEYFPZu/WXRmgDn/jO2uFkyBn/TAQumZTiwzbF N6QANwvCSlwcmS83qT7CSOSKkhvZ2sqhLiiZmeD35G03x+aaI+KacC8ZGQwxFVLBownn 1Fu7SzznfJceCCAgkQJqBMhtIPWS6vHlXooKc+hRO9fKRbjggjoPsGqYYr7/1XVqp5V0 cUmvMoxguyzy7/WeIlaEHeMmloAsv1G6QzjncMFDS0QH5uc35VTMAwXzLQ5/gZ4ootT4 UBZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a17090a764f00b001f5858ef01fsi3867492pjl.17.2022.09.01.02.39.20; Thu, 01 Sep 2022 02:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234439AbiIAJGg (ORCPT + 99 others); Thu, 1 Sep 2022 05:06:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234413AbiIAJGC (ORCPT ); Thu, 1 Sep 2022 05:06:02 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37501BE for ; Thu, 1 Sep 2022 02:04:44 -0700 (PDT) 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 6504DD6E; Thu, 1 Sep 2022 02:04:49 -0700 (PDT) Received: from bogus (unknown [10.57.46.12]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 41D933F766; Thu, 1 Sep 2022 02:04:41 -0700 (PDT) Date: Thu, 1 Sep 2022 10:04:16 +0100 From: Sudeep Holla To: Jens Wiklander Cc: linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org, Marc Bonnici , Sudeep Holla , Achin Gupta , Valentin Laurent , Lukas Hanel , Coboy Chen Subject: Re: [PATCH 4/9] firmware: arm_ffa: Add support for querying FF-A features Message-ID: <20220901090416.25riofko2m5mrlnt@bogus> References: <20220830100700.344594-1-sudeep.holla@arm.com> <20220830100700.344594-5-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2022 at 09:56:41AM +0200, Jens Wiklander wrote: > On Tue, Aug 30, 2022 at 12:07 PM Sudeep Holla wrote: > > > > Add support for FFA_FEATURES to discover properties supported at the > > FF-A interface. This interface can be used to query: > > - If an FF-A interface is implemented by the component at the higher EL, > > - If an implemented FF-A interface also implements any optional features > > described in its interface definition, and > > - Any implementation details exported by an implemented FF-A interface > > as described in its interface definition. > > > > Signed-off-by: Sudeep Holla > > --- > > drivers/firmware/arm_ffa/driver.c | 23 +++++++++++++++++++++++ > > 1 file changed, 23 insertions(+) > > > > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c > > index 04e7cbb1b9aa..de94073f4109 100644 > > --- a/drivers/firmware/arm_ffa/driver.c > > +++ b/drivers/firmware/arm_ffa/driver.c > > @@ -571,6 +571,29 @@ static int ffa_memory_reclaim(u64 g_handle, u32 flags) > > return 0; > > } > > > > +static int ffa_features(u32 func_feat_id, u32 input_props, u32 *if_props) > > +{ > > + ffa_value_t id; > > + > > + if (!ARM_SMCCC_IS_FAST_CALL(func_feat_id) && input_props) { > > + pr_err("%s: Invalid Parameters: %x, %x", __func__, > > + func_feat_id, input_props); > > + return ffa_to_linux_errno(FFA_RET_INVALID_PARAMETERS); > > + } > > + > > + invoke_ffa_fn((ffa_value_t){ > > + .a0 = FFA_FEATURES, .a1 = func_feat_id, .a2 = input_props, > > + }, &id); > > + > > + if (id.a0 == FFA_ERROR) > > + return ffa_to_linux_errno((int)id.a2); > > + > > + if (if_props) > > + *if_props = id.a2; > > w3 (id.a3) also contains a value when querying for > FFA_MEM_RETRIEVE_REQ. I see that in "[PATCH 5/9] firmware: arm_ffa: > Use FFA_FEATURES to detect if native versions are supported" you're > using this function with if_props = NULL. So I guess that at the > moment we have more than needed, but in case you need to add another > parameter to this function you'll need to update all the call sites > too. > Right, I clearly missed to observe that. I am fine either way. Do you have any preference ? As long as the callers are with this driver, it shouldn't be much of an issue to change all, but happy to update to accommodate w3 as well in v2. -- Regards, Sudeep