linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v1 1/2] PSCI: Use DT Function ID values only for old versions of spec
Date: Thu, 20 Mar 2014 14:26:23 +0000	[thread overview]
Message-ID: <20140320142623.GD23372@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAL_Jsq+XXMjZ_qCCWD7u98Tq-u4Pj+fHyupJbAov98Zs8xttKg@mail.gmail.com>

On Thu, Mar 20, 2014 at 01:25:53AM +0000, Rob Herring wrote:
> On Wed, Mar 19, 2014 at 7:54 PM, Ashwin Chaugule
> <ashwin.chaugule@linaro.org> wrote:
> > The PSCI v0.2+ spec mandates specific values of Function IDs
> > for ARM32 and ARM64. Use DT bindings of Function IDs only
> > when using older versions. Use static values otherwise.
> > This patch also prepares the code to easily use the ACPI API
> > which is based off of PSCI v0.2+.
> >
> > Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
> > ---
> >  arch/arm/include/asm/psci.h   |  15 ++++++
> >  arch/arm/kernel/psci.c        | 110 +++++++++++++++++++++++++++++++++++++-----
> >  arch/arm64/include/asm/psci.h |  12 +++++
> >  arch/arm64/kernel/psci.c      | 106 +++++++++++++++++++++++++++++++++++-----
> >  4 files changed, 218 insertions(+), 25 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/psci.h b/arch/arm/include/asm/psci.h
> > index c4ae171..3f8ebf9 100644
> > --- a/arch/arm/include/asm/psci.h
> > +++ b/arch/arm/include/asm/psci.h
> > @@ -17,6 +17,19 @@
> >  #define PSCI_POWER_STATE_TYPE_STANDBY          0
> >  #define PSCI_POWER_STATE_TYPE_POWER_DOWN       1
> >
> > +/* PSCI Function ID's for ARM32 as per PSCI spec v0.2 */
> > +
> > +#define PSCI_ID_VERSION                                0x84000000
> > +#define PSCI_ID_CPU_SUSPEND                    0x84000001
> > +#define PSCI_ID_CPU_OFF                                0x84000002
> > +#define PSCI_ID_CPU_ON                         0x84000003
> > +#define PSCI_ID_AFFINITY_INFO          0x84000004
> > +#define PSCI_ID_CPU_MIGRATE                    0x84000005
> > +#define PSCI_ID_MIGRATE_INFO_TYPE      0x84000006
> > +#define PSCI_ID_MIGRATE_INFO_UP_CPU    0x84000007
> > +#define PSCI_ID_SYSTEM_OFF                     0x84000008
> > +#define PSCI_ID_SYSTEM_RESET           0x84000009
> 
> With the KVM patches[1], this makes 4 copies of these defines in the
> kernel (and then QEMU has more). This needs to go into a common header
> under include/linux. Probably under uapi so QEMU can use. There is
> some sync of headers between the kernel and QEMU I think.

I agree we should have a common header, but I don't think this is uapi
material. This is most definitely _not_ part of the user API, and it's
from an external spec that we're not in control of -- I don't see why we
should have to export a set of numbers forever because it happens to be
marginally useful at this point in time.

Having the IDs handled by the kernel and those used by hypervisors also
encourages people to validate the use of the correct IDs rather than
everyone making the same mistake.

Cheers,
Mark.

> 
> Rob
> 
> [1] https://patches.linaro.org/23918/
> 

  parent reply	other threads:[~2014-03-20 14:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20  0:54 [PATCH v1 1/2] PSCI: Use DT Function ID values only for old versions of spec Ashwin Chaugule
2014-03-20  0:54 ` [PATCH v1 2/2] Documentation: devicetree: Add new binding for PSCIv0.2 Ashwin Chaugule
2014-03-20  3:03   ` Christoffer Dall
2014-03-20 14:22     ` Mark Rutland
2014-03-20 14:53       ` Christoffer Dall
2014-03-20  1:25 ` [PATCH v1 1/2] PSCI: Use DT Function ID values only for old versions of spec Rob Herring
2014-03-20  2:51   ` Christoffer Dall
2014-03-20 14:26   ` Mark Rutland [this message]
2014-03-20 17:04     ` Rob Herring
2014-03-20 17:09       ` Christoffer Dall
2014-03-20  3:06 ` Christoffer Dall
2014-03-20 14:57 ` Mark Rutland
2014-03-20 15:39   ` Ashwin Chaugule
2014-03-21 10:51     ` Mark Rutland
2014-03-21 12:49       ` 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=20140320142623.GD23372@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).