All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Marc Bonnici <Marc.Bonnici@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Olivier Deprez <Olivier.Deprez@arm.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Jens Wiklander <jens.wiklander@linaro.org>
Subject: Re: [PATCH 4/4] firmware: arm_ffa: Add support for FFA_MSG_SEND2
Date: Tue, 16 Apr 2024 10:47:32 +0100	[thread overview]
Message-ID: <Zh5JNLViX7lX3vPa@bogus> (raw)
In-Reply-To: <148629C4-5203-47C4-A001-214B1F8B1E53@arm.com>

On Tue, Apr 16, 2024 at 08:26:55AM +0100, Bertrand Marquis wrote:
> Hi Sudeep,
> 
> > On 15 Apr 2024, at 18:05, Sudeep Holla <sudeep.holla@arm.com> wrote:
> >
> > The FFA_MSG_SEND2 can be  used to transmit a partition message from
> > the Tx buffer of the sender(the driver in this case) endpoint to the Rx
> > buffer of the receiver endpoint.
> >
> > An invocation of the FFA_MSG_SEND2 transfers the ownership to the
> > receiver endpoint(or any intermediate consumer). Completion of an
> > FFA_MSG_SEND2 invocation transfers the ownership back to the sender
> > endpoint.
> >
> > The framework defines the FFA_MSG_SEND2 interface to transmit a partition
> > message from the Tx buffer of the sender to the Rx buffer of a receiver
> > and inform the scheduler that the receiver must be run.
> >
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> > drivers/firmware/arm_ffa/driver.c | 40 +++++++++++++++++++++++++++++++++++++++
> > include/linux/arm_ffa.h           |  9 +++++++++
> > 2 files changed, 49 insertions(+)
> >
> > diff --git a/drivers/firmware/arm_ffa/driver.c b/drivers/firmware/arm_ffa/driver.c
> > index d5087e4f6d35..6c2602f7e7cc 100644
> > --- a/drivers/firmware/arm_ffa/driver.c
> > +++ b/drivers/firmware/arm_ffa/driver.c
> > @@ -344,6 +344,34 @@ static int ffa_msg_send_direct_req(u16 src_id, u16 dst_id, bool mode_32bit,
> > return -EINVAL;
> > }
> >
> > +static int ffa_msg_send2(u16 src_id, u16 dst_id, void *buf, size_t sz)
> > +{
> > + u32 src_dst_ids = PACK_TARGET_INFO(src_id, dst_id);
> > + struct ffa_indirect_msg_hdr *msg;
> > + ffa_value_t ret;
> > +
> > + mutex_lock(&drv_info->tx_lock);
> > +
> > + msg = drv_info->tx_buffer;
> > + msg->flags = 0;
> > + msg->res0 = 0;
> > + msg->offset = sizeof(*msg);
> > + msg->send_recv_id = src_dst_ids;
> > + msg->size = sz;
> > + memcpy(msg + msg->offset, buf, sz);
> 
> Here there should be a check that the user is not trying to send more data
> than what can fit in the TX Buffer.
>

Good point.

> Other than that LGTM.
>

Thanks!

--
Regards,
Sudeep

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

  reply	other threads:[~2024-04-16  9:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 16:05 [PATCH 0/4] firmware: arm_ffa: Support for MSG_SEND2 and minor harderning checks Sudeep Holla
2024-04-15 16:05 ` [PATCH 1/4] firmware: arm_ffa: Stash the partition properties for query purposes Sudeep Holla
2024-04-15 16:05 ` [PATCH 2/4] firmware: arm_ffa: Check if receiving direct requests are supported before sending Sudeep Holla
2024-04-16  7:18   ` Jens Wiklander
2024-04-15 16:05 ` [PATCH 3/4] firmware: arm_ffa: Check if receiving notifications " Sudeep Holla
2024-04-16  7:31   ` Jens Wiklander
2024-04-15 16:05 ` [PATCH 4/4] firmware: arm_ffa: Add support for FFA_MSG_SEND2 Sudeep Holla
2024-04-16  7:26   ` Bertrand Marquis
2024-04-16  9:47     ` Sudeep Holla [this message]
2024-04-16  7:41   ` Jens Wiklander
2024-04-16  8:48     ` Sudeep Holla
2024-04-16 10:53       ` Jens Wiklander

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=Zh5JNLViX7lX3vPa@bogus \
    --to=sudeep.holla@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Marc.Bonnici@arm.com \
    --cc=Olivier.Deprez@arm.com \
    --cc=jens.wiklander@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lpieralisi@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.