public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Courtney Cavin <courtney.cavin@sonymobile.com>
To: Rob Herring <robherring2@gmail.com>
Cc: "s-anna@ti.com" <s-anna@ti.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	Tony Lindgren <tony@atomide.com>,
	"omar.ramirez@copitl.com" <omar.ramirez@copitl.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>, Rob Landley <rob@landley.net>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Mark Langsdorf <mark.langsdorf@gmail.com>
Subject: Re: [RFC 3/6] mailbox: pl320: migrate to mbox framework
Date: Mon, 10 Feb 2014 11:12:56 -0800	[thread overview]
Message-ID: <20140210191255.GT1706@sonymobile.com> (raw)
In-Reply-To: <CAL_JsqL7Ba2KJCP7YoUU-Z-rdq6zzWiRM3E3gbs7wgDZxVCtww@mail.gmail.com>

On Mon, Feb 10, 2014 at 07:28:54PM +0100, Rob Herring wrote:
> On Fri, Feb 7, 2014 at 6:50 PM, Courtney Cavin
> <courtney.cavin@sonymobile.com> wrote:
> > We don't remove the legacy methods here, but we mark them as deprecated
> > in the hopes that people with the ability to properly test modifications
> > can adapt its users.
> 
> The DT for highbank is pretty much fixed at this point. So adopting
> this will need a way to register without DT. Unfortunately, I don't
> have access to h/w either ATM.

That's fine. The lookup table stuff (see mbox_channel_lookup() and
mbox_add_table()) should solve this.

Hopefully we'll find someone with a test-setup for this.

> I should note that this driver is very much highbank specific and not
> really a generic pl320 driver. The pl320 has up to 8 mailboxes and 8
> interrupts. How it is used from there is a software decision. I've
> never seen any other user, but it could be done quite differently from
> how it is used in highbank. In the case of highbank, we assigned a tx
> and rx mailbox. While both the management core and linux side have all
> 8 interrupts wired up, we have assigned an interrupt to each side. I
> suppose you could have the interrupt tied to each mailbox, but really
> they are unrelated in the pl320 as each mailbox message could have
> multiple targets (interrupts). Probably splitting this between a pl320
> lib and platform specific drivers would be the right split if there
> are ever other users.

I'm not exactly sure I follow, and I probably should lookup the pl320
spec, but from the way you describe it and the simplicity of the
existing implementation, it seems to me that one could easily implement
this using DT to decribe how the hardware is hooked up.

> > -       ipc_irq = adev->irq[0];
> > -       ret = request_irq(ipc_irq, ipc_handler, 0, dev_name(&adev->dev), NULL);
> > +       pl->adapter.dev = &adev->dev;
> > +       pl->adapter.ops = &pl320_mbox_ops;
> > +       pl->adapter.nchannels = 1;
> 
> Shouldn't this be 2? The 2 channels here are not a single
> bi-directional channel in any way. They are completely independent and
> have unrelated events. For example we originally defined having 3
> mailboxes where we had 2 tx mailboxes for fast and slow messages, but
> we ultimately decided everything could be a single tx mailbox. Event
> completion is handled synchronously via the pl320's handshake
> mechanism. I'd imagine you could have a protocol where you have async
> completions via an rx mailbox instead.

I generally see a mailbox as having both rx & tx, and I thought that
this was what this driver was attempting to model, so I implemented it
that way.  If the channels are completely independent, there's no reason
why we can't model this as one rx, and one tx.  The proposed API for
this should be suitable.

If I understand what you mean, "event completion" in this case is an ACK
for each event.  Async event ACKing sounds pretty dirty, and I don't
really want to touch on that in the core implementation, but there
should be nothing stopping you from exposing a mailbox which uses
.put_message() to ACK an RX event.

> Rob

I'm glad you found this, as apparently I got your email address all
wrong.

Thanks for the comments! 

-Courtney

  reply	other threads:[~2014-02-10 19:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08  0:50 [RFC 0/6] mailbox: add common framework and port drivers Courtney Cavin
2014-02-08  0:50 ` [RFC 1/6] mailbox: add core framework Courtney Cavin
2014-02-10 14:11   ` Arnd Bergmann
2014-02-10 17:17     ` Courtney Cavin
2014-02-10 17:52     ` Rob Herring
2014-02-10 19:09       ` Josh Cartwright
2014-02-10 19:59         ` Courtney Cavin
2014-02-10 20:45           ` Rob Herring
2014-02-11  0:23             ` Courtney Cavin
2014-02-11  8:35               ` Arnd Bergmann
2014-02-12 18:31                 ` Courtney Cavin
2014-02-14 19:48                   ` Arnd Bergmann
2014-02-14 20:16                     ` Courtney Cavin
2014-02-08  0:50 ` [RFC 2/6] mailbox: document bindings Courtney Cavin
2014-02-08  0:50 ` [RFC 3/6] mailbox: pl320: migrate to mbox framework Courtney Cavin
2014-02-10 18:28   ` Rob Herring
2014-02-10 19:12     ` Courtney Cavin [this message]
2014-02-08  0:50 ` [RFC 4/6] mailbox: omap: remove omap-specific framework Courtney Cavin
2014-02-08  0:50 ` [RFC 5/6] mailbox: omap1: move to common mbox framework Courtney Cavin
2014-02-08  0:50 ` [RFC 6/6] mailbox: omap2+: " Courtney Cavin
2014-02-15  3:32 ` [RFC 0/6] mailbox: add common framework and port drivers Jassi Brar
2014-02-15  3:40   ` Greg Kroah-Hartman
2014-02-15  3:57     ` Jassi Brar
2014-02-15  4:11       ` Greg Kroah-Hartman
2014-02-15  4:14         ` 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=20140210191255.GT1706@sonymobile.com \
    --to=courtney.cavin@sonymobile.com \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.langsdorf@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=omar.ramirez@copitl.com \
    --cc=pawel.moll@arm.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rob@landley.net \
    --cc=robherring2@gmail.com \
    --cc=s-anna@ti.com \
    --cc=tony@atomide.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