RE: [PATCH v5 6/7] firmware: arm_ffa: Setup in-kernel users of FFA partitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sudeep, 

> -----Original Message-----
> From: Sudeep Holla <sudeep.holla@xxxxxxx>
> Sent: 25 March 2021 14:33
> To: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx
> Cc: Sudeep Holla <Sudeep.Holla@xxxxxxx>; Trilok Soni
> <tsoni@xxxxxxxxxxxxxx>; arve@xxxxxxxxxxx; Andrew Walbran
> <qwandor@xxxxxxxxxx>; David Hartley <dhh@xxxxxxxxxxxxxxxx>; Achin
> Gupta <Achin.Gupta@xxxxxxx>; Jens Wiklander
> <jens.wiklander@xxxxxxxxxx>; Arunachalam Ganapathy
> <Arunachalam.Ganapathy@xxxxxxx>; Marc Bonnici <Marc.Bonnici@xxxxxxx>
> 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@xxxxxxxxxx>
> Tested-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
> ---
>  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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux