1. 10 8月, 2019 2 次提交
    • L
      PSCI: cpuidle: Refactor CPU suspend power_state parameter handling · 9ffeb6d0
      Lorenzo Pieralisi 提交于
      Current PSCI code handles idle state entry through the
      psci_cpu_suspend_enter() API, that takes an idle state index as a
      parameter and convert the index into a previously initialized
      power_state parameter before calling the PSCI.CPU_SUSPEND() with it.
      
      This is unwieldly, since it forces the PSCI firmware layer to keep track
      of power_state parameter for every idle state so that the
      index->power_state conversion can be made in the PSCI firmware layer
      instead of the CPUidle driver implementations.
      
      Move the power_state handling out of drivers/firmware/psci
      into the respective ACPI/DT PSCI CPUidle backends and convert
      the psci_cpu_suspend_enter() API to get the power_state
      parameter as input, which makes it closer to its firmware
      interface PSCI.CPU_SUSPEND() API.
      
      A notable side effect is that the PSCI ACPI/DT CPUidle backends
      now can directly handle (and if needed update) power_state
      parameters before handing them over to the PSCI firmware
      interface to trigger PSCI.CPU_SUSPEND() calls.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NSudeep Holla <sudeep.holla@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: NWill Deacon <will@kernel.org>
      9ffeb6d0
    • L
      ARM: psci: cpuidle: Enable PSCI CPUidle driver · 78896146
      Lorenzo Pieralisi 提交于
      Allow selection of the PSCI CPUidle in the kernel by updating
      the respective Kconfig entry.
      
      Remove PSCI callbacks from ARM/ARM64 generic CPU ops
      to prevent the PSCI idle driver from clashing with the generic
      ARM CPUidle driver initialization, that relies on CPU ops
      to initialize and enter idle states.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: NWill Deacon <will@kernel.org>
      78896146
  2. 31 5月, 2019 1 次提交
  3. 17 4月, 2019 1 次提交
  4. 12 4月, 2019 4 次提交
  5. 07 2月, 2018 2 次提交
  6. 09 1月, 2018 1 次提交
  7. 16 8月, 2017 1 次提交
  8. 26 1月, 2017 1 次提交
  9. 11 1月, 2017 1 次提交
  10. 26 11月, 2016 1 次提交
  11. 22 7月, 2016 1 次提交
  12. 26 4月, 2016 4 次提交
  13. 20 4月, 2016 1 次提交
  14. 11 2月, 2016 1 次提交
    • L
      ARM: 8511/1: ARM64: kernel: PSCI: move PSCI idle management code to drivers/firmware · 8b6f2499
      Lorenzo Pieralisi 提交于
      ARM64 PSCI kernel interfaces that initialize idle states and implement
      the suspend API to enter them are generic and can be shared with the
      ARM architecture.
      
      To achieve that goal, this patch moves ARM64 PSCI idle management
      code to drivers/firmware, so that the interface to initialize and
      enter idle states can actually be shared by ARM and ARM64 arches
      back-ends.
      
      The ARM generic CPUidle implementation also requires the definition of
      a cpuidle_ops section entry for the kernel to initialize the CPUidle
      operations at boot based on the enable-method (ie ARM64 has the
      statically initialized cpu_ops counterparts for that purpose); therefore
      this patch also adds the required section entry on CONFIG_ARM for PSCI so
      that the kernel can initialize the PSCI CPUidle back-end when PSCI is
      the probed enable-method.
      
      On ARM64 this patch provides no functional change.
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arch/arm64]
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Tested-by: NJisheng Zhang <jszhang@marvell.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Jisheng Zhang <jszhang@marvell.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      8b6f2499
  15. 05 1月, 2016 1 次提交
  16. 24 10月, 2015 1 次提交
    • L
      drivers: psci: make PSCI 1.0 functions initialization version dependent · 79b04beb
      Lorenzo Pieralisi 提交于
      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.pdfSigned-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Tested-by: NKevin Hilman <khilman@kernel.org>
      Acked-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      79b04beb
  17. 02 10月, 2015 7 次提交
  18. 03 8月, 2015 2 次提交
  19. 27 7月, 2015 1 次提交
  20. 19 6月, 2015 1 次提交
  21. 12 6月, 2015 1 次提交
  22. 27 5月, 2015 4 次提交
    • M
      arm64: psci: remove ACPI coupling · c5a13305
      Mark Rutland 提交于
      The 32-bit ARM port doesn't have ACPI headers, and conditionally
      including them is going to look horrendous. In preparation for sharing
      the PSCI invocation code with 32-bit, move the acpi_psci_* function
      declarations and definitions such that the PSCI client code need not
      include ACPI headers.
      
      While it would seem like we could simply hide the ACPI includes in
      psci.h, the ACPI headers have hilarious circular dependencies which make
      this infeasible without reorganising most of ACPICA. So rather than
      doing that, move the acpi_psci_* prototypes into psci.h.
      
      The psci_acpi_init function is made dependent on CONFIG_ACPI (with a
      stub implementation in asm/psci.h) such that it need not be built for
      32-bit ARM or kernels without ACPI support. The currently missing __init
      annotations are added to the prototypes in the header.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: NAl Stone <al.stone@linaro.org>
      Reviewed-by: NAshwin Chaugule <ashwin.chaugule@linaro.org>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      c5a13305
    • M
      arm64: psci: kill psci_power_state · c8cc4273
      Mark Rutland 提交于
      A PSCI 1.0 implementation may choose to use the new extended StateID
      format, the presence of which may be queried via the PSCI_FEATURES call.
      The layout of this new StateID format is incompatible with the existing
      format, and so to handle both we must abstract attempts to parse the
      fields.
      
      In preparation for PSCI 1.0 support, this patch introduces
      psci_power_state_loses_context and psci_power_state_is_valid functions
      to query information from a PSCI power state, which is no longer
      decomposed (and hence the pack/unpack functions are removed). As it is
      no longer decomposed, it is now passed round as an opaque u32 token.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      c8cc4273
    • M
      arm64: psci: account for Trusted OS instances · ff3010e6
      Mark Rutland 提交于
      Software resident in the secure world (a "Trusted OS") may cause CPU_OFF
      calls for the CPU it is resident on to be denied. Such a denial would be
      fatal for the kernel, and so we must detect when this can happen before
      the point of no return.
      
      This patch implements Trusted OS detection for PSCI 0.2+ systems, using
      MIGRATE_INFO_TYPE and MIGRATE_INFO_UP_CPU. When a trusted OS is detected
      as resident on a particular CPU, attempts to hot unplug that CPU will be
      denied early, before they can prove fatal.
      
      Trusted OS migration is not implemented by this patch. Implementation of
      migratable UP trusted OSs seems unlikely, and the right policy for
      migration is unclear (and will likely differ across implementations). As
      such, it is likely that migration will require cooperation with Trusted
      OS drivers.
      
      PSCI implementations prior to 0.1 do not provide the facility to detect
      the presence of a Trusted OS, nor the CPU any such OS is resident on, so
      without additional information it is not possible to handle Trusted OSs
      with PSCI 0.1.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      ff3010e6
    • M
      arm64: psci: support unsigned return values · a06eed3e
      Mark Rutland 提交于
      PSCI_VERSION and MIGRATE_INFO_TYPE_UP_CPU return unsigned values, with
      the latter returning a 64-bit value. However, the PSCI invocation
      functions have prototypes returning int.
      
      This patch upgrades the invocation functions to return unsigned long,
      with a new typedef to keep things legible. As PSCI_VERSION cannot return
      a negative value, the erroneous check against PSCI_RET_NOT_SUPPORTED is
      also removed. The unrelated psci_initcall_t typedef is moved closer to
      its first user, to avoid confusion with the invocation functions.
      
      In preparation for sharing the code with ARM, unsigned long is used in
      preference of u64. In the SMC32 calling convention, the relevant fields
      will be 32 bits wide.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: NHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      a06eed3e