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>,
"konrad.wilk@oracle.com" <konrad.wilk@oracle.com>,
Ian Campbell <Ian.Campbell@citrix.com>,
"arnd@arndb.de" <arnd@arndb.de>,
Marc Zyngier <Marc.Zyngier@arm.com>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>
Subject: Re: [PATCH v2 6/6] [RFC] arm: use PSCI if available
Date: Tue, 26 Mar 2013 12:01:02 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.03.1303261152141.1372@syhkavp.arg> (raw)
In-Reply-To: <20130326153730.GA22368@mudshark.cambridge.arm.com>
On Tue, 26 Mar 2013, Will Deacon wrote:
> On Tue, Mar 26, 2013 at 03:25:55PM +0000, Stefano Stabellini wrote:
> > On Tue, 26 Mar 2013, Will Deacon wrote:
> > > On Tue, Mar 26, 2013 at 02:41:15PM +0000, Stefano Stabellini wrote:
> > > > +struct smp_operations __initdata psci_smp_ops = {
> > > > + .smp_init_cpus = psci_smp_init_cpus,
> > > > + .smp_prepare_cpus = psci_smp_prepare_cpus,
> > > > + .smp_secondary_init = psci_secondary_init,
> > > > + .smp_boot_secondary = psci_boot_secondary,
> > > > +};
> > >
> > > Whilst I like the idea of this, I don't think things will pan out this
> > > nicely in practice. There will almost always be a level of indirection
> > > required between the internal Linux SMP operations and the expectations of
> > > the PSCI firmware, whether this is in CPU numbering or other,
> > > platform-specific fields in various parameters.
> > >
> > > Tying these two things together like this confuses the layering in my
> > > opinion and will likely lead to potentially subtle breakages if platforms
> > > start trying to adopt this.
> >
> > What you are saying is that psci could either be used directly, like we
> > are doing, or it could just be the base of some higher level platform
> > specific smp_ops.
> >
> > Honestly I think that psci is already high level enough that I would
> > worry if somebody started to wrap it around something else.
>
> I don't agree. PSCI is a low-level firmware interface, which will naturally
> have implementation-specific parts to it. For example, many of the CPU power
> functions have platform-specific state ID parameters which we can't just
> ignore. Furthermore, the method by which a CPU is identified needn't match
> the value in our logical map. The purpose of the PSCI code in Linux is to
> provide a basic abstraction on top of this interface, so that platforms can
> incorporate them into higher-level power management functions, which
> themselves might be plumbed into smp_operations structures.
Absolutely. PSCI is _not_ a Linux API. It is a firmware API. And
remember that Linux has no stable API by design. So it is best to keep
PSCI as one possible way to talk to the firmware, but a flexible shim
layer (flexible as in "we can change its interface whenever we want to")
around PSCI to provide a Linux API which also encompass all possible
low-level implementations alternatives is a better idea.
Nicolas
prev parent reply other threads:[~2013-03-26 16:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 14:40 [PATCH v2 0/6] xen/arm: move to mach-virt and support SMP Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 1/6] xen/arm: actually pass a non-NULL percpu pointer to request_percpu_irq Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 2/6] xen/arm: SMP support Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 3/6] xen: move the xenvm machine to mach-virt Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 4/6] xen/arm: implement HYPERVISOR_vcpu_op Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 5/6] xenvm: add a simple PSCI node and a second cpu Stefano Stabellini
2013-03-26 15:00 ` Arnd Bergmann
2013-03-26 16:39 ` Stefano Stabellini
2013-03-26 14:41 ` [PATCH v2 6/6] [RFC] arm: use PSCI if available Stefano Stabellini
2013-03-26 14:58 ` Arnd Bergmann
2013-03-26 15:09 ` Stefano Stabellini
2013-03-26 15:04 ` Will Deacon
2013-03-26 15:25 ` Stefano Stabellini
2013-03-26 15:37 ` Will Deacon
2013-03-26 15:46 ` Arnd Bergmann
2013-03-26 15:55 ` Stefano Stabellini
2013-03-26 16:03 ` Nicolas Pitre
2013-03-27 11:15 ` Stefano Stabellini
2013-03-26 15:49 ` Stefano Stabellini
2013-03-26 16:01 ` Nicolas Pitre [this message]
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.1303261152141.1372@syhkavp.arg \
--to=nicolas.pitre@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Marc.Zyngier@arm.com \
--cc=arnd@arndb.de \
--cc=konrad.wilk@oracle.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--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;
as well as URLs for NNTP newsgroup(s).