lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V4 2/2] firmware: arm_scmi: add smc/hvc transport
Date
Hi Sudeep,

> Subject: Re: [PATCH V4 2/2] firmware: arm_scmi: add smc/hvc transport
>
> On Tue, Mar 03, 2020 at 10:06:59AM +0800, peng.fan@nxp.com wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > Take arm,smc-id as the 1st arg, leave the other args as zero for now.
> > There is no Rx, only Tx because of smc/hvc not support Rx.
> >
> > Signed-off-by: Peng Fan <peng.fan@nxp.com>
>
> [...]
>
> > +static int smc_send_message(struct scmi_chan_info *cinfo,
> > + struct scmi_xfer *xfer)
> > +{
> > + struct scmi_smc *scmi_info = cinfo->transport_info;
> > + struct arm_smccc_res res;
> > +
> > + shmem_tx_prepare(scmi_info->shmem, xfer);
>
> How do we protect another thread/process on another CPU going and
> modifying the same shmem with another request ? We may need notion of
> channel with associated shmem and it is protected with some lock.

This is valid concern. But I think if shmem is shared bwteen protocols,
the access to shmem should be protected in
drivers/firmware/arm_scmi/driver.c: scmi_do_xfer,
because send_message and fetch_response both touches shmem

The mailbox transport also has the issue you mentioned, I think.

Thanks,
Peng.
>
> --
> Regards,
> Sudeep

\
 
 \ /
  Last update: 2020-03-04 13:53    [W:0.095 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site