linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Bonnici <Marc.Bonnici@arm.com>
To: Sudeep Holla <Sudeep.Holla@arm.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Cc: Sudeep Holla <Sudeep.Holla@arm.com>,
	Trilok Soni <tsoni@codeaurora.org>,
	"arve@android.com" <arve@android.com>,
	Andrew Walbran <qwandor@google.com>,
	David Hartley <dhh@qti.qualcomm.com>,
	Achin Gupta <Achin.Gupta@arm.com>,
	Jens Wiklander <jens.wiklander@linaro.org>,
	Arunachalam Ganapathy <Arunachalam.Ganapathy@arm.com>
Subject: RE: [PATCH v5 6/7] firmware: arm_ffa: Setup in-kernel users of FFA partitions
Date: Fri, 9 Apr 2021 15:45:13 +0000	[thread overview]
Message-ID: <VI1PR08MB356704472CA87B757B89AB5296739@VI1PR08MB3567.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20210325143255.1532452-7-sudeep.holla@arm.com>

Hi Sudeep, 

> -----Original Message-----
> From: Sudeep Holla <sudeep.holla@arm.com>
> Sent: 25 March 2021 14:33
> To: linux-arm-kernel@lists.infradead.org; devicetree@vger.kernel.org
> Cc: Sudeep Holla <Sudeep.Holla@arm.com>; Trilok Soni
> <tsoni@codeaurora.org>; arve@android.com; Andrew Walbran
> <qwandor@google.com>; David Hartley <dhh@qti.qualcomm.com>; Achin
> Gupta <Achin.Gupta@arm.com>; Jens Wiklander
> <jens.wiklander@linaro.org>; Arunachalam Ganapathy
> <Arunachalam.Ganapathy@arm.com>; Marc Bonnici <Marc.Bonnici@arm.com>
> Subject: [PATCH v5 6/7] firmware: arm_ffa: Setup in-kernel users of
> FFA partitions
> 
> Parse the FFA nodes from the device-tree and register all the
> partitions whose services will be used in the kernel.
> 
> In order to also enable in-kernel users of FFA interface, let us add
> simple set of operations for such devices.
> 
> The in-kernel users are registered without the character device
> interface.
> 
> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
> Tested-by: Jens Wiklander <jens.wiklander@linaro.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/firmware/arm_ffa/common.h |   2 +
>  drivers/firmware/arm_ffa/driver.c | 188
> ++++++++++++++++++++++++++++++
>  include/linux/arm_ffa.h           |  38 +++++-
>  3 files changed, 227 insertions(+), 1 deletion(-)
> 
[snip]
> 
> +static int ffa_msg_send_direct_req(u16 src_id, u16 dst_id, bool
> mode_32bit,
> +				   struct ffa_send_direct_data *data) {
> +	u32 req_id, resp_id, src_dst_ids = PACK_TARGET_INFO(src_id,
> dst_id);
> +	ffa_res_t ret;
> +
> +	if (mode_32bit) {
> +		req_id = FFA_MSG_SEND_DIRECT_REQ;
> +		resp_id = FFA_MSG_SEND_DIRECT_RESP;
> +	} else {
> +		req_id = FFA_FN_NATIVE(MSG_SEND_DIRECT_REQ);
> +		resp_id = FFA_FN_NATIVE(MSG_SEND_DIRECT_RESP);
> +	}
> +
> +	ret = invoke_ffa_fn(req_id, src_dst_ids, 0, data->data0, data-
> >data1,
> +			    data->data2, data->data3, data->data4);
> +
> +	while (ret.a0 == FFA_INTERRUPT)
> +		ret = invoke_ffa_fn(FFA_RUN, ret.a1, 0, 0, 0, 0, 0, 0);
> +	if (ret.a0 == FFA_ERROR)
> +		return ffa_to_linux_errno((int)ret.a2);
> +
> +	if (ret.a0 == resp_id) {
> +		data->data0 = ret.a3;
> +		data->data1 = ret.a4;
> +		data->data2 = ret.a5;
> +		data->data3 = ret.a6;
> +		data->data4 = ret.a7;
> +	}
> +
> +	return 0;
> +}	
> +

If the returned function ID is not FFA_ERROR but still not what we're 
expecting here we should return an error to the calling code rather
than success.

Kind Regards
Marc Bonnici

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-04-09 15:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 14:32 [PATCH v5 0/7] firmware: Add initial support for Arm FF-A Sudeep Holla
2021-03-25 14:32 ` [PATCH v5 1/7] dt-bindings: Arm: Add Firmware Framework for Armv8-A (FF-A) binding Sudeep Holla
2021-03-26  5:05   ` Sumit Garg
2021-03-26 10:55     ` Sudeep Holla
2021-03-26 11:56       ` Sumit Garg
2021-03-30 15:03         ` Rob Herring
2021-04-06 15:08           ` Achin Gupta
2021-03-25 14:32 ` [PATCH v5 2/7] arm64: smccc: Add support for SMCCCv1.2 input/output registers Sudeep Holla
2021-03-25 14:41   ` Mark Rutland
2021-03-26 12:18     ` Mark Rutland
2021-03-26 12:51       ` Sudeep Holla
2021-04-01 15:50         ` Michael Kelley
2021-03-25 14:32 ` [PATCH v5 3/7] firmware: arm_ffa: Add initial FFA bus support for device enumeration Sudeep Holla
2021-03-25 14:32 ` [PATCH v5 4/7] firmware: arm_ffa: Add initial Arm FFA driver support Sudeep Holla
2021-03-25 14:32 ` [PATCH v5 5/7] firmware: arm_ffa: Add support for SMCCC as transport to FFA driver Sudeep Holla
2021-03-25 14:32 ` [PATCH v5 6/7] firmware: arm_ffa: Setup in-kernel users of FFA partitions Sudeep Holla
2021-04-09 15:45   ` Marc Bonnici [this message]
2021-03-25 14:32 ` [PATCH v5 7/7] firmware: arm_ffa: Add support for MEM_* interfaces Sudeep Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR08MB356704472CA87B757B89AB5296739@VI1PR08MB3567.eurprd08.prod.outlook.com \
    --to=marc.bonnici@arm.com \
    --cc=Achin.Gupta@arm.com \
    --cc=Arunachalam.Ganapathy@arm.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=arve@android.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dhh@qti.qualcomm.com \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=qwandor@google.com \
    --cc=tsoni@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).