All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux acpi <linux-acpi@vger.kernel.org>,
	"linaro-acpi@lists.linaro.org" <linaro-acpi@lists.linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH v3 1/3] Mailbox: Add support for PCC mailbox and channels
Date: Wed, 27 Aug 2014 20:09:02 +0100	[thread overview]
Message-ID: <20140827190902.GR17528@sirena.org.uk> (raw)
In-Reply-To: <CAJ5Y-eak9A14z3im_5sgvnqMQDRf5rNgcQNGwDV2aYh_POkLOA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2931 bytes --]

On Wed, Aug 27, 2014 at 09:07:15AM -0400, Ashwin Chaugule wrote:
> On 27 August 2014 06:27, Mark Brown <broonie@kernel.org> wrote:
> > On Tue, Aug 26, 2014 at 03:35:36PM -0400, Ashwin Chaugule wrote:

> >> +static struct mbox_controller *
> >> +mbox_find_pcc_controller(char *name)
> >> +{
> >> +     struct mbox_controller *mbox;
> >> +     list_for_each_entry(mbox, &mbox_cons, node) {
> >> +             if (mbox->name)
> >> +                     if (!strcmp(mbox->name, name))
> >> +                             return mbox;
> >> +     }
> >> +
> >> +     return NULL;
> >> +}

> > This doesn't look particularly PCC specific?

> Call this mbox_find_controller_by_name() instead?

That certainly looks like what it's doing.  Probably also make the name
that gets passed in const while you're at it.

> >>       /* Sanity check */
> >> -     if (!mbox || !mbox->dev || !mbox->ops || !mbox->num_chans)
> >> +
> >> +     /*
> >> +      * PCC clients and controllers are currently not backed by
> >> +      * platform device structures.
> >> +      */
> >> +#ifndef CONFIG_PCC
> >> +     if (!mbox->dev)
> >> +             return -EINVAL;
> >> +#endif

> > It seems better to make this consistent - either enforce it all the time
> > or don't enforce it.

> So this is where it got really messy. We're trying to create a

The messiness is orthogonal to my comment here - either it's legal to
request a mailbox without a device or it isn't, it shouldn't depend on a
random kernel configuration option for a particular mailbox driver which
it is.

> "device" out of something that isn't. The PCCT, which is used as a
> mailbox controller here, is a table and not a peripheral device. To
> treat this as a device (without faking it by manually putting together
> a struct device), would require adding a DSDT entry which is really a
> wrong place for it. Are there examples today where drivers manually
> create a struct driver and struct device and match them internally?
> (i.e. w/o using the generic driver subsystem)

Arguably that's what things like cpufreq end up doing, though people
tend to just shove a device into DT.  Are you sure there isn't any
device at all in ACPI that you could hang this off, looking at my
desktop I see rather a lot of apparently synthetic ACPI devices with
names starting LNX including for example LNXSYSTM:00?

> The main reason why I thought this Mailbox framework looked useful
> (after you pointed me to it) for PCC was due to its async notification
> features. But thats easy and small enough to add to the PCC driver
> itself. We can also add a generic controller lookup mechanism in the
> PCC driver for anyone who doesn't want to use ACPI. I think thats a
> much cleaner way to handle PCC support. Adding PCC as a generic
> mailbox controller is turning out to be more messier that we'd
> originally imagined.

If PCC is described by ACPI tables how would non-ACPI users be able to
use it?

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-08-27 19:09 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 19:35 [PATCH v3 0/3] PCC: Platform Communication Channel Ashwin Chaugule
2014-08-26 19:35 ` [PATCH v3 1/3] Mailbox: Add support for PCC mailbox and channels Ashwin Chaugule
2014-08-27 10:27   ` Mark Brown
2014-08-27 13:07     ` Ashwin Chaugule
2014-08-27 19:09       ` Mark Brown [this message]
2014-08-27 21:49         ` Ashwin Chaugule
2014-08-28 10:10           ` Mark Brown
2014-08-28 12:31             ` Ashwin Chaugule
2014-08-28  8:39         ` Arnd Bergmann
2014-08-28 10:15           ` Mark Brown
2014-08-28 20:34             ` Ashwin Chaugule
2014-09-02 18:16               ` Ashwin Chaugule
2014-09-02 19:22                 ` [Linaro-acpi] " Arnd Bergmann
2014-09-02 20:15                   ` Ashwin Chaugule
2014-09-02 23:03                     ` Mark Brown
2014-09-03 15:23                       ` Ashwin Chaugule
2014-09-03 15:27                         ` Arnd Bergmann
2014-09-03 15:36                         ` Mark Brown
2014-09-03 15:41                           ` Arnd Bergmann
2014-09-03 15:51                             ` Mark Brown
2014-09-03 11:23                     ` Arnd Bergmann
2014-09-03 14:49                       ` Mark Brown
2014-09-03 14:50                         ` Arnd Bergmann
2014-08-28 12:21           ` Ashwin Chaugule
2014-08-26 19:35 ` [PATCH v3 2/3] Add support for Platform Communication Channel Ashwin Chaugule
2014-08-27 10:29   ` Mark Brown
2014-08-26 19:35 ` [PATCH v3 3/3] PCC-test: Test driver to trigger PCC commands Ashwin Chaugule
2014-08-27 10:30   ` Mark Brown
2014-08-27 11:53     ` Ashwin Chaugule

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=20140827190902.GR17528@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=arnd@arndb.de \
    --cc=ashwin.chaugule@linaro.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.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 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.