1. 29 12月, 2013 1 次提交
  2. 29 10月, 2013 1 次提交
    • D
      ARM: 7848/1: mcpm: Implement cpu_kill() to synchronise on powerdown · 0de0d646
      Dave Martin 提交于
      CPU hotplug and kexec rely on smp_ops.cpu_kill(), which is supposed
      to wait for the CPU to park or power down, and perform the last
      rites (such as disabling clocks etc., where the platform doesn't do
      this automatically).
      
      kexec in particular is unsafe without performing this
      synchronisation to park secondaries.  Without it, the secondaries
      might not be parked when kexec trashes the kernel.
      
      There is no generic way to do this synchronisation, so a new mcpm
      platform_ops method power_down_finish() is added by this patch.
      
      The new method is mandatory.  A platform which provides no way to
      detect when CPUs are parked is likely broken.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      0de0d646
  3. 03 10月, 2013 1 次提交
    • N
      ARM: 7842/1: MCPM: don't explode if invoked without being initialized first · d0cdef6e
      Nicolas Pitre 提交于
      Currently mcpm_cpu_power_down() and mcpm_cpu_suspend() trigger BUG()
      if mcpm_platform_register() is not called beforehand.  This may occur
      for many reasons such as some incomplete device tree passed to the kernel
      or the like.
      
      Let's be nicer to users and avoid killing the kernel if that happens by
      logging a warning and returning to the caller.  The mcpm_cpu_suspend()
      user is already set to deal with this situation, and so is cpu_die()
      invoking mcpm_cpu_die().
      
      The problematic case would have been the B.L switcher's usage of
      mcpm_cpu_power_down(), however it has to call mcpm_cpu_power_up() first
      which is already set to catch an error resulting from a missing
      mcpm_platform_register() call.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d0cdef6e
  4. 24 9月, 2013 1 次提交
  5. 24 4月, 2013 3 次提交
    • D
      ARM: mcpm: introduce helpers for platform coherency exit/setup · 7fe31d28
      Dave Martin 提交于
      This provides helper methods to coordinate between CPUs coming down
      and CPUs going up, as well as documentation on the used algorithms,
      so that cluster teardown and setup
      operations are not done for a cluster simultaneously.
      
      For use in the power_down() implementation:
        * __mcpm_cpu_going_down(unsigned int cluster, unsigned int cpu)
        * __mcpm_outbound_enter_critical(unsigned int cluster)
        * __mcpm_outbound_leave_critical(unsigned int cluster)
        * __mcpm_cpu_down(unsigned int cluster, unsigned int cpu)
      
      The power_up_setup() helper should do platform-specific setup in
      preparation for turning the CPU on, such as invalidating local caches
      or entering coherency.  It must be assembler for now, since it must
      run before the MMU can be switched on.  It is passed the affinity level
      for which initialization should be performed.
      
      Because the mcpm_sync_struct content is looked-up and modified
      with the cache enabled or disabled depending on the code path, it is
      crucial to always ensure proper cache maintenance to update main memory
      right away.  The sync_cache_*() helpers are used to that end.
      
      Also, in order to prevent a cached writer from interfering with an
      adjacent non-cached writer, we ensure each state variable is located to
      a separate cache line.
      
      Thanks to Nicolas Pitre and Achin Gupta for the help with this
      patch.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      7fe31d28
    • N
      ARM: mcpm: introduce the CPU/cluster power API · 7c2b8605
      Nicolas Pitre 提交于
      This is the basic API used to handle the powering up/down of individual
      CPUs in a (multi-)cluster system.  The platform specific backend
      implementation has the responsibility to also handle the cluster level
      power as well when the first/last CPU in a cluster is brought up/down.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      7c2b8605
    • N
      ARM: multi-cluster PM: secondary kernel entry code · e8db288e
      Nicolas Pitre 提交于
      CPUs in cluster based systems, such as big.LITTLE, have special needs
      when entering the kernel due to a hotplug event, or when resuming from
      a deep sleep mode.
      
      This is vectorized so multiple CPUs can enter the kernel in parallel
      without serialization.
      
      The mcpm prefix stands for "multi cluster power management", however
      this is usable on single cluster systems as well.  Only the basic
      structure is introduced here.  This will be extended with later patches.
      
      In order not to complexify things more than they currently have to,
      the planned work to make runtime adjusted MPIDR based indexing and
      dynamic memory allocation for cluster states is postponed to a later
      cycle. The MAX_NR_CLUSTERS and MAX_CPUS_PER_CLUSTER static definitions
      should be sufficient for those systems expected to be available in the
      near future.
      Signed-off-by: NNicolas Pitre <nico@linaro.org>
      Reviewed-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Reviewed-by: NWill Deacon <will.deacon@arm.com>
      e8db288e