All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ks.giri@samsung.com" <ks.giri@samsung.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"ijc@hellion.org.uk" <ijc@hellion.org.uk>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"robh@kernel.org" <robh@kernel.org>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"courtney.cavin@sonymobile.com" <courtney.cavin@sonymobile.com>,
	"mporter@linaro.org" <mporter@linaro.org>,
	"slapdau@yahoo.com.au" <slapdau@yahoo.com.au>,
	"lftan.linux@gmail.com" <lftan.linux@gmail.com>,
	"loic.pallardy@st.com" <loic.pallardy@st.com>,
	"s-anna@ti.com" <s-anna@ti.com>,
	"ashwin.chaugule@linaro.org" <ashwin.chaugule@linaro.org>,
	"bjorn@kryo.se" <bjorn@kryo.se>,
	"patches@linaro.org" <patches@linaro.org>,
	"t.takinishi@jp.fujitsu.com" <t.takinishi@jp.fujitsu.com>,
	"broonie@linaro.org" <broonie@linaro.org>,
	"khilman@linaro.org" <khilman@linaro.org>,
	"mollie.wu@linaro.org" <mollie.wu@linaro.org>,
	"andy.green@linaro.org" <andy.green@linaro.org>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>
Subject: Re: [PATCHv9 2/4] mailbox: Introduce framework for mailbox
Date: Fri, 01 Aug 2014 18:33:40 +0100	[thread overview]
Message-ID: <53DBCF74.3030301@arm.com> (raw)
In-Reply-To: <CAJe_ZheEeKpc2TZG5a4QD34Jqhj-sCvAZbkdoaeruv9GCZogwg@mail.gmail.com>



On 01/08/14 17:38, Jassi Brar wrote:
> On 1 August 2014 18:08, Sudeep Holla <sudeep.holla@arm.com> wrote:
>> On 01/08/14 13:28, Jassi Brar wrote:
>>>
>>>>>> Probably this is discussed already, but again I missed to find it
>>>>>> in archives, so asking here. If the protocol has some payload
>>>>>> associated
>>>>>> with the message and controller expects it to be in place before
>>>>>> calling
>>>>>> send_data, we essentially end up not using this queue at all by waiting
>>>>>> in the protocol layer(may be in it's own queue)
>>>>>>
>>>>> Why essentially?
>>>>>      The 'data' is a void *  i.o.w the packet format is a completely
>>>>> internal understanding between a controller and a client. The 'data'
>>>>> can point to a copy of payload that the controller driver sets up in
>>>>> the shared payload region as the first thing in send_data() callback.
>>>>> OR, like my 'server' type platform, where the access is serialized to
>>>>> the shared payload region.
>>>>>
>>>>
>>>> Yes that's exactly what I have now. But based on your driver I thought
>>>> that the shared memory should not be associated with the mailbox
>>>> controller
>>>> and should be completely handled in the protocol/client.
>>>>
>>>> Also to handle async packet from remote, controller has to pass shared
>>>> memory pointer always to the client to read the data as the buffer won't
>>>> to ready in such case. So I thought it's good idea to handle shared
>>>> memory
>>>> completely in client/protocol.
>>>>
>>> Again ur platform has the freedom. The async client should have a free
>>> packet to copy the data as soon as it arrives.
>>> My platform divides the SHM into two parts - one for each direction.
>>>
>>
>> I understand that, but I wanted to know what's the general
>> recommendation for mailbox controller drivers. Do they need to be
>> associated with the shared memory or is it left the protocol ?
>>
> The framework already provides for either way ('data' may point to
> signal/code as well as payload info).
> I would leave the decision to the platforms that share the controller
> driver. Otherwise by 'recommending' a scheme we may end up controller
> drivers implement code that nobody ever uses.
>     Personally, I would write a controller driver that manages only the
> resources within the controller and leave SHM for clients to manage.
> However, if a controller can't convey enough info on its own (like a
> simple irq raise) and no meaningful IPC can be had without SHM, then
> the driver may assume SHM to always be used.
>

Thanks for the confirmation, this is exactly what had in mind too when
I first raised question on prepare_data.

>> The main reason I am asking is that the MHU driver you had didn't
>> deal with any shared memory. That's fine and if we want to make that
>> common/generic we need to know if we are going to handle shared
>> memory in there or leave it to client/protocol implementations.
>>
> Well, that driver is for MHU, which has nothing to do with SHM which
> may or may not be present on a platform.

Again agreed.

>   Anyways, could we please discuss the MHU driver in the patchset that
> introduces it? This API already supports both, and this patchset has
> had enough delays for more than a year now.
>

Sorry I have no intention to delay this getting merged(I too need it
ASAP) as long as the APIs can be extended if needed in future(which I
think should be).

Now coming back to my original question: If the protocol/client manage
the SHM and assume there's some payload associated with a message and
controller expects it to be in place before calling send_data, then
how can you achieve this without blocking for one command to complete
before copying the payload for the next. If you wait in the protocol
to update payload before queueing the request, you end-up with no use of
Tx queue in mailbox.c

Now as you said we can do this in controller's send_data(also agreed
and that's what I too thought of) or in mailbox just before calling
send_data(doesn't matter where). But doesn't it make sense to have
standard API like mbox_chan_prepare_data so that we can do that in
standard way?

Regards,
Sudeep

  reply	other threads:[~2014-08-01 17:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 18:54 [PATCHv9 0/4] Common Mailbox Framework Jassi Brar
2014-07-22 18:54 ` Jassi Brar
     [not found] ` <1406055250-29159-1-git-send-email-jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-22 18:55   ` [PATCHv9 1/4] mailbox: rename pl320-ipc specific mailbox.h Jassi Brar
2014-07-22 18:55     ` Jassi Brar
2014-07-22 18:56   ` [PATCHv9 2/4] mailbox: Introduce framework for mailbox Jassi Brar
2014-07-22 18:56     ` Jassi Brar
     [not found]     ` <1406055374-29275-1-git-send-email-jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-07-23  8:54       ` Lee Jones
2014-07-23  8:54         ` Lee Jones
2014-07-23 15:00         ` Jassi Brar
2014-07-23 15:00           ` Jassi Brar
     [not found]           ` <CAJe_ZhfaLqgKb3oK-m5Rpae5+zeAEk9-DLFOovq4qjBgg64b-w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-23 15:26             ` Lee Jones
2014-07-23 15:26               ` Lee Jones
2014-07-31 16:56               ` Jassi Brar
     [not found]                 ` <CAJe_ZhcOXyGO49sZUXnqCk9wm7WvQ01b76k7Wqxxi1S3qisDPA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-08-01  8:17                   ` Lee Jones
2014-08-01  8:17                     ` Lee Jones
2014-07-31 17:32     ` Sudeep Holla
2014-07-31 17:32       ` Sudeep Holla
2014-07-31 17:58       ` Jassi Brar
2014-08-01  9:39         ` Sudeep Holla
2014-08-01 12:28           ` Jassi Brar
2014-08-01 12:38             ` Sudeep Holla
2014-08-01 16:38               ` Jassi Brar
2014-08-01 17:33                 ` Sudeep Holla [this message]
2014-08-02  3:58                   ` Jassi Brar
2014-08-05 17:18                     ` Sudeep Holla
2014-07-22 18:57   ` [PATCHv9 3/4] doc: add documentation for mailbox framework Jassi Brar
2014-07-22 18:57     ` Jassi Brar
2014-07-22 18:57   ` [PATCHv9 4/4] dt: mailbox: add generic bindings Jassi Brar
2014-07-22 18:57     ` Jassi Brar
2014-07-28 13:50     ` Grant Likely
2014-07-28 13:50       ` Grant Likely

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=53DBCF74.3030301@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=Mark.Rutland@arm.com \
    --cc=Pawel.Moll@arm.com \
    --cc=andy.green@linaro.org \
    --cc=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --cc=bjorn@kryo.se \
    --cc=broonie@linaro.org \
    --cc=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc@hellion.org.uk \
    --cc=jaswinder.singh@linaro.org \
    --cc=khilman@linaro.org \
    --cc=ks.giri@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=lftan.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=mollie.wu@linaro.org \
    --cc=mporter@linaro.org \
    --cc=patches@linaro.org \
    --cc=robh@kernel.org \
    --cc=s-anna@ti.com \
    --cc=slapdau@yahoo.com.au \
    --cc=t.takinishi@jp.fujitsu.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 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.