public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jassi Brar <jaswinder.singh@linaro.org>
Cc: "linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
	Ashwin Chaugule <ashwin.chaugule@linaro.org>,
	Patch Tracking <patches@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	linux acpi <linux-acpi@vger.kernel.org>,
	Mark Brown <broonie@kernel.org>, "lv.zheng" <lv.zheng@intel.com>
Subject: Re: [Linaro-acpi] [PATCH v10 1/1] Mailbox: Add support for Platform Communication Channel
Date: Tue, 11 Nov 2014 18:54:34 +0100	[thread overview]
Message-ID: <1625601.1yb4h3sjoe@wuerfel> (raw)
In-Reply-To: <CAJe_ZhfQ7_T3LRz-OgmDj1yopZ2Jc0s3op_yFAfT+8wQZ_yS4Q@mail.gmail.com>

On Tuesday 11 November 2014 23:09:16 Jassi Brar wrote:
> On 11 November 2014 22:03, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 11 November 2014 19:27:07 Jassi Brar wrote:
> >> On 11 November 2014 18:32, Ashwin Chaugule <ashwin.chaugule@linaro.org> wrote:
> >> > On 10 November 2014 23:04, Jassi Brar <jaswinder.singh@linaro.org> wrote:
> >>
> >> In even simpler terms.... I prefer controller specific
> >> encoding(0x50434300) instead of controller specific api
> >> (pcc_mbox_request_channel).  For a different class of controller, it
> >> is much cleaner to define a new encoding as compared to another
> >> xyz_mbox_request_channel() api.
> >
> > The problem with this approach is that it still leaves the interface
> > as controller specific, because the client now has to know that it
> > must pass the PCC identifier instead of an index.
> >
> Yup. I hope you are aware that the "index" argument of
> pcc_mbox_request_channel() is just the same thing. The "index" there
> is actually the 'Type' value defined in ACPI for the client.

The problem is that it's not an index relative to the client, but
into an array of the mailbox provide. I only today noticed that both
are called 'index' in the source code, which is highly confusing,
and the pcc driver should name it 'subspaceid' or similar instead,
to minimize the confusion.

> > A client driver using DT would just specify to use the first channel
> > that is defined locally in the "mboxes" properties, so it can ask for
> >
> >         chan = mbox_request_channel(client, 0);
> >
> > to get the first channel defined for this client while a driver using
> > ACPI has to look up the identifier in its own local tables:
> >
> >         u32 channel_id = this_driver_parse_acpi_and_find_pccid(dev);
> >         chan = mbox_request_channel(client, channel_id);
> >
> > which is not the same interface as the first, even if you assume the
> > channel_id to be globally unique in the system.
> >
> Yes. As I said, same for pcc_mbox_request_channel(). But since PCC
> clients are limited and specified by ACPI (Type value won't change
> across platforms, I understand), the client drivers could have that
> value hardcoded.

Not really:

> > Since we will need clients to have a consistent interface across
> > DT and ACPI, I think the difference in firmware interfaces is better
> > abstracted in a PCC specific interface.
> >
> > The client driver would still need to parse two different firmware
> > structures, but it would at least have a consistent interface:
> >
> >         u32 channel_id = of_property_read_u32(dev->of_node, "pccid");
> >         if (!channel_id)
> >                 channel_id = this_driver_parse_acpi_and_find_pccid(dev);
> >         chan = mbox_request_channel(client, channel_id);
> >
> > Alternatively, the driver could use the regular API on DT:
> >
> >         chan = mbox_request_channel(cl, 0);
> >         if (!chan) {
> >                 u32 chan_id = this_driver_parse_acpi_and_find_pccid(dev);
> >                 chan =  mbox_request_channel(client, channel_id);
> >         }
> >
> OK, but if the 'Type' value, that a client passes to
> (pcc_)mbox_req_chan(), does not change across platforms, would we need
> that?

As I understand the ACPI specification, we have multiple clients to the
PCC, and each of them has its own client-specific hardcoded interface
to /find/ the subspace ID from the ACPI tables, but the subspace ID itself
has to be read from the table and is not constant.

	Arnd

  reply	other threads:[~2014-11-11 17:54 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                           ` [Linaro-acpi] " Arnd Bergmann
2014-11-11  4:31                             ` 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 [this message]
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=1625601.1yb4h3sjoe@wuerfel \
    --to=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --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