linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linaro-acpi@lists.linaro.org
Cc: Mark Brown <broonie@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Patch Tracking <patches@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux acpi <linux-acpi@vger.kernel.org>,
	"lv.zheng" <lv.zheng@intel.com>
Subject: Re: [Linaro-acpi] [PATCH v10 1/1] Mailbox: Add support for Platform Communication Channel
Date: Mon, 10 Nov 2014 21:29:57 +0100	[thread overview]
Message-ID: <6137834.nUiGJsT7Uj@wuerfel> (raw)
In-Reply-To: <20141110201310.GQ3815@sirena.org.uk>

On Monday 10 November 2014 20:13:10 Mark Brown wrote:
> On Mon, Nov 10, 2014 at 11:14:48PM +0530, Jassi Brar wrote:
> > On 10 November 2014 20:17, Ashwin Chaugule <ashwin.chaugule@linaro.org> wrote:
> > > What is there to stop two users from coming up with the same signature
> > > (0xdeadbeef / "string") for their mbox controllers? Things can break
> > > at run time, because with your patch, the first mbox controller with
> > > the duplicate signature/name will return a channel. The client may be
> > > expecting a channel from the "other" mbox.
> 
> > Two channels with same signature are supposed to be _identical_ i.e,
> > either channel could serve any client asking for a channel with that
> > signature. So even if an "unexpected" instance of the channel is
> > assigned, the client should still be happy.
> 
> > If a client differentiates between 2 instances of a channel, that's
> > probably a sign of bad design. The knowledge behind client's
> > preference of instance should actually lie on the provider(controller)
> > side. I am open to some example on the contrary.
> 
> The problem here is that ACPI isn't defining the context in a way which
> maps well onto the way Linux looks things up.  We may not like that and
> think it's a bad design but the spec is a done deal here and we have to
> address reality.  From an ACPI point of view the context is the fact
> that this is a PCC channel (there's a globally unique namespace for PCC
> channels) but Linux wants a struct device for the client to represent
> the context with a mapping table of some kind behind that to do the
> lookup.

Right.

> There's nothing in the ACPI description of the channel or controller to
> tie it to the client device, and there's nothing preventing some other
> mailbox mechanism that gets added to an ACPI system from reusing similar
> names (bear in mind that idiomatic naming for ACPI appears to be three
> or four character strings).  If we have a PCC channel "FOO" and some new
> mailbox type which also defines "FOO" the controllers aren't really
> going to be able to tell them apart just on the string.
> 
> We could fit the maping into Linux a bit by having a struct device
> representing the PCC controller that you use to do the lookup but at
> that point you may as well have a PCC specific request function that
> knows that device and does the lookup which is approximately what we
> have in Ashwin's patch.  We could also require that the lookup be
> something like "PCC:FOO" and use a global_xlate() but it's not clear to
> me that this is making things clearer.

Agreed. Having a special interface here the way that Ashwin's patch
introduces seems the least invasive. I don't think we would risk running
into the problems that Jassi mentioned regarding API growth if we
get other cases. In particular, anything that boots with DT will be
able to use the standard method, and even with ACPI if we have additional
mailboxes we would most likely use the named properties extension in
the future.

On a side note, I think we will actually have to add a DT binding
to PCC as well, but that should probably provide both the standard
mailbox API as well as support the pcc specific interfaces in order
to allow client drivers that do not have multiple ways of doing the
same thing.

	Arnd

  reply	other threads:[~2014-11-10 20:30 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 14:52 [PATCH v10 0/1] PCC: Platform Communication Channel Ashwin Chaugule
2014-11-07 14:52 ` [PATCH v10 1/1] Mailbox: Add support for " Ashwin Chaugule
2014-11-09 13:48   ` Jassi Brar
2014-11-09 15:20     ` Ashwin Chaugule
2014-11-09 16:18       ` Jassi Brar
2014-11-09 17:22         ` Ashwin Chaugule
2014-11-10  4:13           ` Jassi Brar
2014-11-10 12:57             ` Ashwin Chaugule
2014-11-10 13:39               ` Jassi Brar
2014-11-10 13:53                 ` Ashwin Chaugule
2014-11-10 14:16                   ` Jassi Brar
2014-11-10 14:47                     ` Ashwin Chaugule
2014-11-10 17:44                       ` Jassi Brar
2014-11-10 20:13                         ` Mark Brown
2014-11-10 20:29                           ` Arnd Bergmann [this message]
2014-11-11  4:31                             ` [Linaro-acpi] " Jassi Brar
2014-11-11  4:04                           ` Jassi Brar
2014-11-11 13:02                             ` Ashwin Chaugule
2014-11-11 13:57                               ` Jassi Brar
2014-11-11 16:33                                 ` [Linaro-acpi] " Arnd Bergmann
2014-11-11 17:39                                   ` Jassi Brar
2014-11-11 17:54                                     ` Arnd Bergmann
2014-11-11 19:08                                       ` Jassi Brar
2014-11-11 19:22                                         ` Ashwin Chaugule
2014-11-11 20:38                                         ` Arnd Bergmann
2014-11-11 17:53                                   ` Mark Brown
2014-11-11 10:30   ` Sudeep Holla
2014-11-11 13:18     ` Ashwin Chaugule
2014-11-11 15:01       ` Sudeep Holla
2014-11-11 20:25         ` Arnd Bergmann
2014-11-12 13:32           ` Sudeep Holla
2014-11-12 13:48             ` Ashwin Chaugule
2014-11-12 14:03               ` Sudeep Holla
2014-11-12 18:25           ` [Linaro-acpi] " Ashwin Chaugule
2014-11-12 18:26             ` Mark Brown
2014-11-12 19:04             ` Jassi Brar
2014-11-12 19:16               ` Ashwin Chaugule
2014-11-11 17:29     ` Mark Brown
2014-11-11 18:07       ` Sudeep Holla
2014-11-11 15:12   ` Jassi Brar
2014-11-11 15:19     ` Ashwin Chaugule
2014-11-11 15:25       ` 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=6137834.nUiGJsT7Uj@wuerfel \
    --to=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=lv.zheng@intel.com \
    --cc=patches@linaro.org \
    --cc=rjw@rjwysocki.net \
    /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).