An error occurred fetching the project authors.
  1. 21 Jul, 2016 1 commit
  2. 26 Apr, 2016 2 commits
    • Sudeep Holla's avatar
      drivers: firmware: psci: unify enable-method binding on ARM {64,32}-bit systems · 978fa436
      Sudeep Holla authored
      Currently ARM CPUs DT bindings allows different enable-method value for
      PSCI based systems. On ARM 64-bit this property is required and must be
      "psci" while on ARM 32-bit systems this property is optional and must
      be "arm,psci" if present.
      
      However, "arm,psci" has always been the compatible string for the PSCI
      node, and was never intended to be the enable-method. So this is a bug
      in the binding and not a deliberate attempt at specifying 32-bit
      differently.
      
      This is problematic if 32-bit OS is run on 64-bit system which has
      "psci" as enable-method rather than the expected "arm,psci".
      
      So let's unify the value into "psci" and remove support for "arm,psci"
      before it finds any users.
      Reported-by: default avatarSoby Mathew <Soby.Mathew@arm.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      978fa436
    • Arnd Bergmann's avatar
      drivers: firmware: psci: make two helper functions inline · 2b9cf189
      Arnd Bergmann authored
      The previous patch marked these two as 'static' which showed that they
      are sometimes unused:
      
      drivers/firmware/psci.c:103:13: error: 'psci_power_state_is_valid' defined but not used [-Werror=unused-function]
       static bool psci_power_state_is_valid(u32 state)
      drivers/firmware/psci.c:94:13: error: 'psci_power_state_loses_context' defined but not used [-Werror=unused-function]
       static bool psci_power_state_loses_context(u32 state)
      
      This also marks the functions 'inline', which has the main effect of
      silently ignoring them when they are unused. The compiler will typically
      inline small static functions anyway, so this seems more appropriate
      than using __maybe_unused, which would have the same result otherwise.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: 21e8868e ("drivers: firmware: psci: make two helper functions static")
      2b9cf189
  3. 25 Apr, 2016 2 commits
  4. 20 Apr, 2016 1 commit
  5. 11 Feb, 2016 1 commit
    • Lorenzo Pieralisi's avatar
      ARM: 8511/1: ARM64: kernel: PSCI: move PSCI idle management code to drivers/firmware · 8b6f2499
      Lorenzo Pieralisi authored
      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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arch/arm64]
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Tested-by: default avatarJisheng 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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      8b6f2499
  6. 04 Jan, 2016 1 commit
  7. 23 Oct, 2015 1 commit
    • Lorenzo Pieralisi's avatar
      drivers: psci: make PSCI 1.0 functions initialization version dependent · 79b04beb
      Lorenzo Pieralisi authored
      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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Tested-by: default avatarKevin Hilman <khilman@kernel.org>
      Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      79b04beb
  8. 02 Oct, 2015 7 commits
  9. 03 Aug, 2015 2 commits
  10. 27 Jul, 2015 1 commit
  11. 19 Jun, 2015 1 commit
  12. 11 Jun, 2015 1 commit
  13. 27 May, 2015 6 commits
    • Mark Rutland's avatar
      arm64: psci: remove ACPI coupling · c5a13305
      Mark Rutland authored
      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: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Reviewed-by: default avatarAl Stone <al.stone@linaro.org>
      Reviewed-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      c5a13305
    • Mark Rutland's avatar
      arm64: psci: kill psci_power_state · c8cc4273
      Mark Rutland authored
      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: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      c8cc4273
    • Mark Rutland's avatar
      arm64: psci: account for Trusted OS instances · ff3010e6
      Mark Rutland authored
      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: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      ff3010e6
    • Mark Rutland's avatar
      arm64: psci: support unsigned return values · a06eed3e
      Mark Rutland authored
      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: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      a06eed3e
    • Mark Rutland's avatar
      arm64: psci: remove unnecessary id indirection · 2a7cd0eb
      Mark Rutland authored
      PSCI 0.1 did not define canonical IDs for CPU_ON, CPU_OFF, CPU_SUSPEND,
      or MIGRATE, and so these need to be provided when using firmware
      compliant to PSCI 0.1.
      
      However, functions introduced in 0.2 or later have canonical IDs, and
      these cannot be provided via DT. There's no need to indirect the IDs via
      a table; they can be used directly at callsites (and already are for
      SYSTEM_OFF and SYSTEM_RESET).
      
      This patch removes the unnecessary function ID indirection for
      AFFINITY_INFO and MIGRATE_INFO_TYPE.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      2a7cd0eb
    • Mark Rutland's avatar
      arm64: smp: consistently use error codes · 6b99c68c
      Mark Rutland authored
      cpu_kill currently returns one for success and zero for failure, which
      is unlike all the other cpu_operations, which return zero for success
      and an error code upon failure. This difference is unnecessarily
      confusing.
      
      Make cpu_kill consistent with the other cpu_operations.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      6b99c68c
  14. 19 May, 2015 1 commit
    • Lorenzo Pieralisi's avatar
      ARM64: kernel: make cpu_ops hooks DT agnostic · 819a8826
      Lorenzo Pieralisi authored
      ARM64 CPU operations such as cpu_init and cpu_init_idle take
      a struct device_node pointer as a parameter, which corresponds to
      the device tree node of the logical cpu on which the operation
      has to be applied.
      
      With the advent of ACPI on arm64, where MADT static table entries
      are used to initialize cpus, the device tree node parameter
      in cpu_ops hooks become useless when booting with ACPI, since
      in that case cpu device tree nodes are not present and can not be
      used for cpu initialization.
      
      The current cpu_init hook requires a struct device_node pointer
      parameter because it is called while parsing the device tree to
      initialize CPUs, when the cpu_logical_map (that is used to match
      a cpu node reg property to a device tree node) for a given logical
      cpu id is not set up yet. This means that the cpu_init hook cannot
      rely on the of_get_cpu_node function to retrieve the device tree
      node corresponding to the logical cpu id passed in as parameter,
      so the cpu device tree node must be passed in as a parameter to fix
      this catch-22 dependency cycle.
      
      This patch reshuffles the cpu_logical_map initialization code so
      that the cpu_init cpu_ops hook can safely use the of_get_cpu_node
      function to retrieve the cpu device tree node, removing the need for
      the device tree node pointer parameter.
      
      In the process, the patch removes device tree node parameters
      from all cpu_ops hooks, in preparation for SMP DT/ACPI cpus
      initialization consolidation.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Tested-by: default avatarHanjun Guo <hanjun.guo@linaro.org>
      Tested-by: Mark Rutland <mark.rutland@arm.com> [DT]
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      819a8826
  15. 26 Mar, 2015 2 commits
  16. 25 Mar, 2015 1 commit
  17. 26 Feb, 2015 1 commit
    • Will Deacon's avatar
      arm64: psci: move psci firmware calls out of line · f5e0a12c
      Will Deacon authored
      An arm64 allmodconfig fails to build with GCC 5 due to __asmeq
      assertions in the PSCI firmware calling code firing due to mcount
      preambles breaking our assumptions about register allocation of function
      arguments:
      
        /tmp/ccDqJsJ6.s: Assembler messages:
        /tmp/ccDqJsJ6.s:60: Error: .err encountered
        /tmp/ccDqJsJ6.s:61: Error: .err encountered
        /tmp/ccDqJsJ6.s:62: Error: .err encountered
        /tmp/ccDqJsJ6.s:99: Error: .err encountered
        /tmp/ccDqJsJ6.s:100: Error: .err encountered
        /tmp/ccDqJsJ6.s:101: Error: .err encountered
      
      This patch fixes the issue by moving the PSCI calls out-of-line into
      their own assembly files, which are safe from the compiler's meddling
      fingers.
      Reported-by: default avatarAndy Whitcroft <apw@canonical.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      f5e0a12c
  18. 27 Jan, 2015 1 commit
    • Lorenzo Pieralisi's avatar
      arm64: kernel: remove ARM64_CPU_SUSPEND config option · af3cfdbf
      Lorenzo Pieralisi authored
      ARM64_CPU_SUSPEND config option was introduced to make code providing
      context save/restore selectable only on platforms requiring power
      management capabilities.
      
      Currently ARM64_CPU_SUSPEND depends on the PM_SLEEP config option which
      in turn is set by the SUSPEND config option.
      
      The introduction of CPU_IDLE for arm64 requires that code configured
      by ARM64_CPU_SUSPEND (context save/restore) should be compiled in
      in order to enable the CPU idle driver to rely on CPU operations
      carrying out context save/restore.
      
      The ARM64_CPUIDLE config option (ARM64 generic idle driver) is therefore
      forced to select ARM64_CPU_SUSPEND, even if there may be (ie PM_SLEEP)
      failed dependencies, which is not a clean way of handling the kernel
      configuration option.
      
      For these reasons, this patch removes the ARM64_CPU_SUSPEND config option
      and makes the context save/restore dependent on CPU_PM, which is selected
      whenever either SUSPEND or CPU_IDLE are configured, cleaning up dependencies
      in the process.
      
      This way, code previously configured through ARM64_CPU_SUSPEND is
      compiled in whenever a power management subsystem requires it to be
      present in the kernel (SUSPEND || CPU_IDLE), which is the behaviour
      expected on ARM64 kernels.
      
      The cpu_suspend and cpu_init_idle CPU operations are added only if
      CPU_IDLE is selected, since they are CPU_IDLE specific methods and
      should be grouped and defined accordingly.
      
      PSCI CPU operations are updated to reflect the introduced changes.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      af3cfdbf
  19. 11 Dec, 2014 1 commit
    • Krzysztof Kozlowski's avatar
      arm64: psci: Fix build breakage without PM_SLEEP · e5e62d47
      Krzysztof Kozlowski authored
      Fix build failure of defconfig when PM_SLEEP is disabled (e.g. by
      disabling SUSPEND) and CPU_IDLE enabled:
      
      arch/arm64/kernel/psci.c:543:2: error: unknown field ‘cpu_suspend’ specified in initializer
        .cpu_suspend = cpu_psci_cpu_suspend,
        ^
      arch/arm64/kernel/psci.c:543:2: warning: initialization from incompatible pointer type [enabled by default]
      arch/arm64/kernel/psci.c:543:2: warning: (near initialization for ‘cpu_psci_ops.cpu_prepare’) [enabled by default]
      make[1]: *** [arch/arm64/kernel/psci.o] Error 1
      
      The cpu_operations.cpu_suspend field exists only if ARM64_CPU_SUSPEND is
      defined, not CPU_IDLE.
      Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      e5e62d47
  20. 30 Oct, 2014 1 commit
  21. 29 Oct, 2014 1 commit
  22. 12 Sep, 2014 1 commit
    • Lorenzo Pieralisi's avatar
      arm64: add PSCI CPU_SUSPEND based cpu_suspend support · 18910ab0
      Lorenzo Pieralisi authored
      This patch implements the cpu_suspend cpu operations method through
      the PSCI CPU SUSPEND API. The PSCI implementation translates the idle state
      index passed by the cpu_suspend core call into a valid PSCI state according to
      the PSCI states initialized at boot through the cpu_init_idle() CPU
      operations hook.
      
      The PSCI CPU suspend operation hook checks if the PSCI state is a
      standby state. If it is, it calls the PSCI suspend implementation
      straight away, without saving any context. If the state is a power
      down state the kernel calls the __cpu_suspend API (that saves the CPU
      context) and passed the PSCI suspend finisher as a parameter so that PSCI
      can be called by the __cpu_suspend implementation after saving and flushing
      the context as last function before power down.
      
      For power down states, entry point is set to cpu_resume physical address,
      that represents the default kernel execution address following a CPU reset.
      Reviewed-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      18910ab0
  23. 18 Jul, 2014 2 commits
  24. 15 May, 2014 1 commit