1. 18 7月, 2014 1 次提交
  2. 26 5月, 2014 1 次提交
  3. 26 11月, 2013 1 次提交
    • D
      ARM: vexpress/TC2: Implement MCPM power_down_finish() · 33cb667a
      Dave Martin 提交于
      This patch implements the power_down_finish() method for TC2, to
      enable the kernel to confirm when CPUs are safely powered down.
      
      The information required for determining when a CPU is parked
      cannot be obtained from any single place, so a few sources of
      information must be combined:
      
        * mcpm_cpu_power_down() must be pending for the CPU, so that we
          don't get confused by false STANDBYWFI positives arising from
          CPUidle.  This is detected by waiting for the tc2_pm use count
          for the target CPU to reach 0.
      
        * Either the SPC must report that the CPU has asserted
          STANDBYWFI, or the TC2 tile's reset control logic must be
          holding the CPU in reset.
      
          Just checking for STANDBYWFI is not sufficient, because this
          signal is not latched when the the cluster is clamped off and
          powered down: the relevant status bits just drop to zero.  This
          means that STANDBYWFI status cannot be used for reliable
          detection of the last CPU in a cluster reaching WFI.
      
      This patch is required in order for kexec to work with MCPM on TC2.
      
      MCPM code was changed in commit 0de0d646 ('ARM: 7848/1: mcpm:
      Implement cpu_kill() to synchronise on powerdown'), and since then it
      will hit a WARN_ON_ONCE() due to power_down_finish not being implemented
      on the TC2 platform.
      Signed-off-by: NDave Martin <Dave.Martin@arm.com>
      Acked-by: NPawel Moll <pawel.moll@arm.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      33cb667a
  4. 30 10月, 2013 1 次提交
  5. 29 10月, 2013 1 次提交
  6. 01 10月, 2013 1 次提交
    • L
      ARM: vexpress: tc2: fix hotplug/idle/kexec race on cluster power down · 64270d82
      Lorenzo Pieralisi 提交于
      On the TC2 testchip, when all CPUs in a cluster enter standbywfi
      and commit a power down request, the power controller will wait
      for standbywfil2 coming from L2 cache controller to shut the
      cluster down.
      By the time all CPUs in a cluster commit a power down request
      and enter wfi, the power controller cannot backtrack, or put it
      another way, a CPU must not be allowed to complete execution
      independently of the power controller, the only way for it to
      resume properly must be upon wake-up IRQ pending and subsequent
      reset triggered from the power controller.
      
      Current MCPM back-end for TC2 disables the GIC CPU IF only when
      power down is committed through the tc2_pm_suspend() method, that
      makes sense since a suspended CPU is still online and can receive
      interrupts whereas a hotplugged CPU, since it is offline,
      migrated all IRQs and shutdown the per-CPU peripherals, hence
      their PPIs.
      
      The flaw with this reasoning is the following. If all CPUs in
      a clusters are entering a power down state either through CPU
      idle or CPU hotplug, when the last man successfully completes
      the MCPM power down sequence (and executes wfi), power controller
      waits for L2 wfi signal to quiesce the cluster and shut it down.
      If, when all CPUs are sitting in wfi, an online CPU hotplugs back
      in one of the CPUs in the cluster being shutdown, that CPU
      receives an IPI that causes wfi to complete (since tc2_pm_down()
      method does not disable the GIC CPU IF in that case - CPU being
      hotplugged out, not idle) and the power controller will never see
      the stanbywfil2 signal coming from L2 that is required for
      shutdown to happen and the system deadlocks.
      
      Further to this issue, kexec hotplugs secondary CPUs out during
      kernel reload/restart.
      Because kexec may (deliberately) trash the old kernel text, it is
      not OK for CPUs to follow the MCPM soft reboot path, since
      instructions after the WFI may have been replaced by kexec.
      
      If tc2_pm_down() does not disable the GIC cpu interface, there is a
      race between CPU powerdown in the old kernel and the IPI from the
      new kernel that triggers secondary boot, particularly if the
      powerdown is slow (due to L2 cache cleaning for example).  If the
      new kernel wins the race, the affected CPU(s) will not really be
      reset and may execute garbage after the WFI.
      
      The only solution to this problem consists in disabling the GIC
      CPU IF on a CPU committed to power down regardless of the power
      down entry method (CPU hotplug or CPU idle). This way, CPU wake-up
      is under power controller control, which prevents unexpected wfi
      exit caused by a pending IRQ.
      
      This patch moves the GIC CPU IF disable call in the TC2 MCPM
      implementation from the tc2_pm_suspend() method to the
      tc2_pm_down() method to fix the mentioned race condition(s).
      Reviewed-by: NDave Martin <Dave.Martin@arm.com>
      Tested-by: Dave Martin <Dave.Martin@arm.com> (for kexec)
      Signed-off-by: NSudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      64270d82
  7. 29 8月, 2013 1 次提交
    • L
      ARM: vexpress: tc2: disable GIC CPU IF in tc2_pm_suspend · 9ee2ee0f
      Lorenzo Pieralisi 提交于
      To prevent cores from exiting wfi when they are about to be shut down
      the GIC CPU IF must be disabled so that the GIC CPU IF IRQ output line
      is not asserted to the cores. wfi completion must be prevented since,
      in absence of coordinating HW logic, if the power controller receives
      a standbywfi signal but in the meantime the processor restarts executing
      owing to a pending IRQ, the core might be reset when running in a
      non-quiescent state (eg with pending load/store transactions)
      
      Raw GIC distributor IRQ signals are routed to the power controller, that
      is capable of taking core out of reset on pending IRQs even if their GIC
      CPU IF is disabled, thus keeping the normal wfi behaviour.
      
      GIC CPU IF is restored upon CPU wake-up by the respective MCPM API
      consumers (ie CPU idle driver and suspend to RAM thread).
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Signed-off-by: NOlof Johansson <olof@lixom.net>
      9ee2ee0f
  8. 15 8月, 2013 1 次提交
  9. 07 8月, 2013 2 次提交