mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: Will Deacon <will.deacon@arm.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"olof@lixom.net" <olof@lixom.net>
Subject: Re: [PATCH v8 1/2] arm: introduce psci_smp_ops
Date: Thu, 25 Apr 2013 10:58:19 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.03.1304251054420.1258@syhkavp.arg> (raw)
In-Reply-To: <20130425104508.GG12848@mudshark.cambridge.arm.com>

On Thu, 25 Apr 2013, Will Deacon wrote:

> On Thu, Apr 25, 2013 at 11:12:54AM +0100, Stefano Stabellini wrote:
> > On Thu, 25 Apr 2013, Will Deacon wrote:
> > > > +/*
> > > > + * cpu_suspend   Suspend the execution on a CPU
> > > > + * @state        we don't currently describe affinity levels, so just pass 0.
> > > > + * @entry_point  the first instruction to be executed on return
> > > > + * returns 0  success, < 0 on failure
> > > > + *
> > > > + * cpu_off       Power down a CPU
> > > > + * @state        we don't currently describe affinity levels, so just pass 0.
> > > > + * no return on successful call
> > > > + *
> > > > + * cpu_on        Power up a CPU
> > > > + * @cpuid        cpuid of target CPU, as from MPIDR
> > > > + * @entry_point  the first instruction to be executed on return
> > > > + * returns 0  success, < 0 on failure
> > > > + *
> > > > + * migrate       Migrate the context to a different CPU
> > > > + * @cpuid        cpuid of target CPU, as from MPIDR
> > > > + * returns 0  success, < 0 on failure
> > > > + *
> > > > + */
> > > 
> > > Can you move these comments into psci-smp.c please? They're really specific
> > > to the implementation there, and if we put them in a header we're lying to
> > > ourselves about the parameters actually described by the PSCI specification.
> > 
> > You have a good point about the PSCI spec.
> > 
> > However from the Linux POV these comments should regard the functions
> > exported by psci_operations, not the firmware interface, this is why I
> > think it makes sense to keep them in psci.h.
> > What we are saying is for example that psci_operations.cpu_on returns 0
> > on success and < 0 on failure, and it takes a cpuid and an entry point
> > as parameters. We are not saying anything about the firmware interface.
> 
> I disagree. You're explicitly stating that we pass the `cpuid of target CPU,
> as from MPIDR'. That's simply not true -- the firmware could choose any
> numbering scheme to identify the CPUs. For KVM and Xen, it *is* the mpidr,
> which is why psci-smp.c works at all, but that's where the comment belongs,
> not in this header file.

At some point, the _kernel_ API for interfacing with the firmware's PSCI 
will have to ensure uniformity somehow.  The PSCI interface code could 
translate the passed MPIDR into whatever the firmware decided to use for 
identifying CPUs if needed, keeping this issue localized.


Nicolas

  parent reply	other threads:[~2013-04-25 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-24 18:38 [PATCH 0/2 v8] " Stefano Stabellini
2013-04-24 18:40 ` [PATCH v8 1/2] " Stefano Stabellini
2013-04-25  8:47   ` Will Deacon
2013-04-25 10:12     ` Stefano Stabellini
2013-04-25 10:45       ` Will Deacon
2013-04-25 11:08         ` Stefano Stabellini
2013-04-25 11:11           ` Will Deacon
2013-04-25 11:13             ` Stefano Stabellini
2013-04-25 14:58         ` Nicolas Pitre [this message]
2013-04-26 15:36           ` Stefano Stabellini
2013-04-26 16:10             ` Will Deacon
2013-04-24 18:40 ` [PATCH v8 2/2] ARM: Enable selection of SMP operations at boot time Stefano Stabellini
2013-04-25  8:49   ` Will Deacon
2013-04-25 10:25     ` Stefano Stabellini
2013-04-25 14:42     ` Nicolas Pitre
2013-04-26 15:36       ` Stefano Stabellini

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=alpine.LFD.2.03.1304251054420.1258@syhkavp.arg \
    --to=nicolas.pitre@linaro.org \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=rob.herring@calxeda.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=will.deacon@arm.com \
    --cc=xen-devel@lists.xensource.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

all inboxes | Powered by JetHome®