devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter@linaro.org>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"patches@linaro.org" <patches@linaro.org>,
	"bjorn@kryo.se" <bjorn@kryo.se>,
	"ashwin.chaugule@linaro.org" <ashwin.chaugule@linaro.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"s-anna@ti.com" <s-anna@ti.com>,
	"loic.pallardy@st.com" <loic.pallardy@st.com>,
	"lftan.linux@gmail.com" <lftan.linux@gmail.com>,
	"slapdau@yahoo.com.au" <slapdau@yahoo.com.au>,
	"courtney.cavin@sonymobile.com" <courtney.cavin@sonymobile.com>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	Mark Rutland <Mark.Rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"joshc@codeaurora.org" <joshc@codeaurora.org>,
	linus.walleij@linaro.org
Subject: Re: [PATCHv7 2/5] mailbox: Introduce framework for mailbox
Date: Thu, 19 Jun 2014 16:40:15 -0400	[thread overview]
Message-ID: <20140619204015.GU4173@beef> (raw)
In-Reply-To: <CAJe_ZhcTvn+8P71ZgDGYVQH8XHGgOfKvdkYQO8y4tR44KRWkqA@mail.gmail.com>

On Fri, Jun 20, 2014 at 01:59:30AM +0530, Jassi Brar wrote:
> On 20 June 2014 00:33, Matt Porter <mporter@linaro.org> wrote:
> > On Thu, Jun 19, 2014 at 07:17:11PM +0100, Sudeep Holla wrote:
> >
> >> >+ * After startup and before shutdown any data received on the chan
> >> >+ * is passed on to the API via atomic mbox_chan_received_data().
> >> >+ * The controller should ACK the RX only after this call returns.
> >>
> >> Does this mean we can't support asynchronous messages from the remote.
> >> One possible scenario I can think is if the remote system power controller
> >> has feature to configure the bounds for thermal sensors and it can send
> >> async interrupt when the bounds are crossed. We can't just block one channel
> >> for this always. Again this might have been discussed before and you might have
> >> solution, I could not gather it with my brief look at older discussions.
> >
> > The way I see it we are simply putting the burden on the client to
> > implement very little in the rx_callback. In my case, we will have a
> > single client which is the IPC layer. The controller driver will notify
> > the IPC client layer which will do as little as possible in the
> > rx_callback before returning. We'll handle asynchronous dispatch of
> > events within our IPC layer to the real client drivers rather than in
> > the controller driver.
> >
> Yes. So do I.
> 
> >> >+/**
> >> >+ * mbox_client_peek_data - A way for client driver to pull data
> >> >+ *                     received from remote by the controller.
> >> >+ * @chan: Mailbox channel assigned to this client.
> >> >+ *
> >> >+ * A poke to controller driver for any received data.
> >> >+ * The data is actually passed onto client via the
> >> >+ * mbox_chan_received_data()
> >> >+ * The call can be made from atomic context, so the controller's
> >> >+ * implementation of peek_data() must not sleep.
> >> >+ *
> >> >+ * Return: True, if controller has, and is going to push after this,
> >> >+ *          some data.
> >> >+ *         False, if controller doesn't have any data to be read.
> >> >+ */
> >> >+bool mbox_client_peek_data(struct mbox_chan *chan)
> >> >+{
> >> >+       if (chan->mbox->ops->peek_data)
> >> >+               return chan->mbox->ops->peek_data(chan);
> >> >+
> >> >+       return false;
> >> >+}
> >> >+EXPORT_SYMBOL_GPL(mbox_client_peek_data);
> >>
> >> I am unable to understand how this API will be used. IIUC when the controller
> >> receives any data from remote, it calls mbox_chan_received_data to push data to
> >> client.
> >
> > Good question.
> >
> > That function is a no-op if your client chooses not to populate
> > rx_callback. It's not explicitly stated, but the implementation is a
> > no-op if rx_callback is NULL so rx_callback seems to be intended as an
> > optional field in the client data.
> >
> > I'm also not clear of the scenario where this could be used. I
> > originally thought .peek_data() was an alternative to the callback for
> > polling purposes except it clearly states it needs the callback to carry
> > the data.
> >
> > I probably missed earlier discussion that explains this.
> >
> peek_data is just a trigger for controller to flush out any buffered
> RX via mbox_chan_received_data() to upper layer. Intended usecase is
> irq-mitigation for QMTM driver, as Arnd pointed out a few months ago.

Ok, that makes much more sense now.

Thanks,
Matt

  reply	other threads:[~2014-06-19 20:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 16:58 [PATCHv7 0/5] Common Mailbox Framework Jassi Brar
2014-06-12 17:00 ` [PATCHv7 1/5] mailbox: rename pl320-ipc specific mailbox.h Jassi Brar
2014-06-12 17:01 ` [PATCHv7 3/5] Mailbox: Generic: Specify mailbox api bindings Jassi Brar
     [not found] ` <1402592317-7043-1-git-send-email-jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-12 17:01   ` [PATCHv7 2/5] mailbox: Introduce framework for mailbox Jassi Brar
     [not found]     ` <1402592479-7244-1-git-send-email-jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-13 20:40       ` Mark Brown
2014-06-18  0:27       ` Kevin Hilman
     [not found]         ` <7hionz9i5e.fsf-4poPxKt068f/PtFMR13I2A@public.gmane.org>
2014-06-18  8:33           ` Jassi Brar
     [not found]             ` <CAJe_ZhcuOa39Db_tE4JupY74aze02=v1FWzduFD0sO15nMrKvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-18 17:03               ` Kevin Hilman
2014-06-19  2:55                 ` Jassi Brar
2014-06-19 12:14                   ` Ashwin Chaugule
2014-06-19 12:36                   ` Sudeep Holla
2014-06-19 18:17     ` Sudeep Holla
2014-06-19 19:03       ` Matt Porter
2014-06-19 20:29         ` Jassi Brar
2014-06-19 20:40           ` Matt Porter [this message]
2014-06-20 15:25         ` Sudeep Holla
2014-06-19 20:21       ` Jassi Brar
2014-06-20 16:07         ` Sudeep Holla
2014-06-20 16:30           ` Jassi Brar
2014-06-20 16:58             ` Sudeep Holla
2014-06-20 18:05     ` Lubomir Rintel
2014-06-22 10:56     ` Lubomir Rintel
2014-06-12 17:02   ` [PATCHv7 4/5] mailbox: Fix deleteing poll timer Jassi Brar
2014-06-12 17:02   ` [PATCHv7 5/5] MAINTAINERS: Add maintainer entry for Mailbox API Jassi Brar
2014-06-30 16:16   ` [PATCHv7 0/5] Common Mailbox Framework Lubomir Rintel
2014-06-30 16:22     ` Jassi Brar

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=20140619204015.GU4173@beef \
    --to=mporter@linaro.org \
    --cc=Mark.Rutland@arm.com \
    --cc=Pawel.Moll@arm.com \
    --cc=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --cc=bjorn@kryo.se \
    --cc=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jaswinder.singh@linaro.org \
    --cc=joshc@codeaurora.org \
    --cc=lftan.linux@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.pallardy@st.com \
    --cc=patches@linaro.org \
    --cc=robh+dt@kernel.org \
    --cc=s-anna@ti.com \
    --cc=slapdau@yahoo.com.au \
    --cc=sudeep.holla@arm.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).