All of lore.kernel.org
 help / color / mirror / Atom feed
From: khilman@kernel.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] drivers: psci: make PSCI 1.0 functions initialization version dependent
Date: Fri, 23 Oct 2015 08:21:44 -0700	[thread overview]
Message-ID: <7h611xr4on.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1445611610-12871-1-git-send-email-lorenzo.pieralisi@arm.com> (Lorenzo Pieralisi's message of "Fri, 23 Oct 2015 15:46:50 +0100")

Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> writes:

> The PSCI specifications [1] and the SMC calling convention mandate
> that unimplemented functions ids must return NOT_SUPPORTED (0xffffffff)
> if a function id is called but it is not implemented.
>
> Consequently, PSCI 1.0 function ids that require the 1.0 PSCI_FEATURES
> call to be initialized:
>
> CPU_SUSPEND (psci_init_cpu_suspend())
> SYSTEM_SUSPEND (psci_init_system_suspend())
>
> call the PSCI_FEATURES function id independently of the detected
> PSCI firmware version, since, if the PSCI_FEATURES function id is not
> implemented, it must return NOT_SUPPORTED according to the PSCI
> specifications, causing the initialization functions to fail as expected.
>
> Some existing PSCI implementations (ie Qemu PSCI emulation), do not
> comply with the SMC calling convention and fail if function ids that are
> not implemented are called from the OS, causing boot failures.
>
> To solve this issue, this patch adds code that checks the PSCI firmware
> version before calling PSCI 1.0 initialization functions so that the
> OS makes sure that it is calling 1.0 functions only if the firmware
> version detected is 1.0 or greater, therefore avoiding PSCI calls
> that are bound to fail and might cause system boot failures owing
> to non-compliant PSCI firmware implementations.
>
> [1] http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Olof Johansson <olof@lixom.net>
> Cc: Mark Rutland <mark.rutland@arm.com>
> ---
> Arnd, Kevin, Olof,
>
> this applies to current arm-soc drivers/psci branch, and solves the
> issue Kevin detected through kernelci with Qemu emulation:
>
> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/380304.html
>
> Tested on:
>
> - Juno host
> - AMD Seattle host
> - kvmtool arm64 guest (on Juno arm64 defconfig host)
> - Qemu x86 host (aarch64 emulation)
>
> A run on kernelci and consequent tested-by tags would be much appreciated,
> thanks for spotting this and for your help.

I tested manually on my local qemu that was failing without this patch,
and it works:

Tested-by: Kevin Hilman <khilman@linaro.org>

We'll add this onto arm-soc drivers/psci and then it will have a spin through
kernelci.

Thanks for the quick fix,

Kevin

  parent reply	other threads:[~2015-10-23 15:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-23 14:46 [PATCH] drivers: psci: make PSCI 1.0 functions initialization version dependent Lorenzo Pieralisi
2015-10-23 14:58 ` Sudeep Holla
2015-10-23 16:00   ` Lorenzo Pieralisi
2015-10-23 15:21 ` Kevin Hilman [this message]
2015-10-23 16:02   ` Lorenzo Pieralisi
2015-10-23 19:09   ` Kevin Hilman
2015-10-23 16:59 ` Olof Johansson
2015-10-26 10:02   ` Lorenzo Pieralisi

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=7h611xr4on.fsf@deeprootsystems.com \
    --to=khilman@kernel.org \
    --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 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.