1. 15 Aug, 2019 1 commit
    • Sudeep Holla's avatar
      arm64: smp: disable hotplug on trusted OS resident CPU · d55c5f28
      Sudeep Holla authored
      The trusted OS may reject CPU_OFF calls to its resident CPU, so we must
      avoid issuing those. We never migrate a Trusted OS and we already take
      care to prevent CPU_OFF PSCI call. However, this is not reflected
      explicitly to the userspace. Any user can attempt to hotplug trusted OS
      resident CPU. The entire motion of going through the various state
      transitions in the CPU hotplug state machine gets executed and the
      PSCI layer finally refuses to make CPU_OFF call.
      
      This results is unnecessary unwinding of CPU hotplug state machine in
      the kernel. Instead we can mark the trusted OS resident CPU as not
      available for hotplug, so that the user attempt or request to do the
      same will get immediately rejected.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      d55c5f28
  2. 09 Aug, 2019 6 commits
    • Lorenzo Pieralisi's avatar
      PSCI: cpuidle: Refactor CPU suspend power_state parameter handling · 9ffeb6d0
      Lorenzo Pieralisi authored
      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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarSudeep 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: default avatarWill Deacon <will@kernel.org>
      9ffeb6d0
    • Lorenzo Pieralisi's avatar
      ARM: psci: cpuidle: Enable PSCI CPUidle driver · 78896146
      Lorenzo Pieralisi authored
      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: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reviewed-by: default avatarUlf 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: default avatarWill Deacon <will@kernel.org>
      78896146
    • Lorenzo Pieralisi's avatar
      ARM: psci: cpuidle: Introduce PSCI CPUidle driver · 81d549e0
      Lorenzo Pieralisi authored
      PSCI firmware is the standard power management control for
      all ARM64 based platforms and it is also deployed on some
      ARM 32 bit platforms to date.
      
      Idle state entry in PSCI is currently achieved by calling
      arm_cpuidle_init() and arm_cpuidle_suspend() in a generic
      idle driver, which in turn relies on ARM/ARM64 CPUidle back-end
      to relay the call into PSCI firmware if PSCI is the boot method.
      
      Given that PSCI is the standard idle entry method on ARM64 systems
      (which means that no other CPUidle driver are expected on ARM64
      platforms - so PSCI is already a generic idle driver), in order to
      simplify idle entry and code maintenance, it makes sense to have a PSCI
      specific idle driver so that idle code that it is currently living in
      drivers/firmware directory can be hoisted out of it and moved
      where it belongs, into a full-fledged PSCI driver, leaving PSCI code
      in drivers/firmware as a pure firmware interface, as it should be.
      
      Implement a PSCI CPUidle driver. By default it is a silent Kconfig entry
      which is left unselected, since it selection would clash with the
      generic ARM CPUidle driver that provides a PSCI based idle driver
      through the arm/arm64 arches back-ends CPU operations.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      81d549e0
    • Lorenzo Pieralisi's avatar
      drivers: firmware: psci: Decouple checker from generic ARM CPUidle · e76d8b70
      Lorenzo Pieralisi authored
      The PSCI checker currently relies on the generic ARM CPUidle
      infrastructure to enter an idle state, which in turn creates
      a dependency that is not really needed.
      
      The PSCI checker code to test PSCI CPU suspend is built on
      top of the CPUidle framework and can easily reuse the
      struct cpuidle_state.enter() function (previously initialized
      by an idle driver, with a PSCI back-end) to trigger an entry
      into an idle state, decoupling the PSCI checker from the
      generic ARM CPUidle infrastructure and simplyfing the code
      in the process.
      
      Convert the PSCI checker suspend entry function to use
      the struct cpuidle_state.enter() function callback.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      e76d8b70
    • Lorenzo Pieralisi's avatar
      ARM: cpuidle: Remove overzealous error logging · 6460d7ba
      Lorenzo Pieralisi authored
      CPUidle back-end operations are not implemented in some platforms
      but this should not be considered an error serious enough to be
      logged. Check the arm_cpuidle_init() return value to detect whether
      the failure must be reported or not in the kernel log and do
      not log it if the platform does not support CPUidle operations.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      6460d7ba
    • Lorenzo Pieralisi's avatar
      ARM: cpuidle: Remove useless header include · 63e3ee61
      Lorenzo Pieralisi authored
      The generic ARM CPUidle driver includes <linux/topology.h> by mistake.
      
      Remove the topology header include.
      Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      63e3ee61
  3. 05 Aug, 2019 1 commit
  4. 04 Aug, 2019 10 commits
  5. 03 Aug, 2019 22 commits