devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific
Date: Wed, 1 Apr 2020 10:12:08 +0100	[thread overview]
Message-ID: <20200401091208.GB3954@bogus> (raw)
In-Reply-To: <AM0PR04MB4481562E2A31386752F92C4488C90@AM0PR04MB4481.eurprd04.prod.outlook.com>

On Wed, Apr 01, 2020 at 01:12:37AM +0000, Peng Fan wrote:
> Hi Sudeep,
>
> > Subject: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific
> >
> > In order to support multiple SMC/HVC transport channels with associated
> > shared memory,
>
> Does this mean each channel will have its own shared memory? Or
> All channels share the same shared memory?
>

It depends on platform firmware and DT. If there is only one shmem at
the top level scmi node, all share that single channel. If some/all
protocols have their own channel, they there must be shmem entry in the
corresponding child node.

> it is better to maintain the mutex per channel instead of
> > existing global one.
>
> If all channels shared the same memory, use per channel mutex lock
> will not be able to prevent other channels accessing shared memory
> at the same time.
>

No we don't create channel per protocol. If they share, we just share
the channel pointer. Look at:

       if (!info->desc->ops->chan_available(dev, idx)) {
                cinfo = idr_find(idr, SCMI_PROTOCOL_BASE);
                if (unlikely(!cinfo)) /* Possible only if platform has no Rx */
                        return -EINVAL;
                goto idr_alloc;
        }

If a protocol doesn't have a dedicated channel, we just assign the base
protocol channel to it. We don't call chan_setup at all on that channel.
Your patch assumed so but the core driver never did that.

Hope this clarifies you doubt.

--
Regards,
Sudeep

  reply	other threads:[~2020-04-01  9:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 16:36 [PATCH 0/4] firmware: arm_scmi: Extend SMC/HVC to support multiple channels Sudeep Holla
2020-03-27 16:36 ` [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific Sudeep Holla
2020-04-01  1:12   ` Peng Fan
2020-04-01  9:12     ` Sudeep Holla [this message]
2020-04-01  9:14       ` Peng Fan
2020-04-01  9:28         ` Sudeep Holla
2020-04-01  9:14   ` Peng Fan
2020-03-27 16:36 ` [PATCH 2/4] firmware: arm_scmi: Drop empty stub for smc_mark_txdone Sudeep Holla
2020-04-01  1:15   ` Peng Fan
2020-03-27 16:36 ` [PATCH 3/4] firmware: arm_scmi: Check shmem property for channel availablity Sudeep Holla
2020-04-01  1:15   ` Peng Fan
2020-04-01  9:05     ` Sudeep Holla
2020-03-27 16:36 ` [PATCH 4/4] firmware: arm_scmi: Drop checking for shmem property in parent node Sudeep Holla
2020-04-01  1:19   ` Peng Fan
2020-03-31 13:53 ` [PATCH 0/4] firmware: arm_scmi: Extend SMC/HVC to support multiple channels Peng Fan
2020-03-31 14:21   ` 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=20200401091208.GB3954@bogus \
    --to=sudeep.holla@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=peng.fan@nxp.com \
    /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).