Pārlūkot izejas kodu

fix(rpi3): tighten platform pwr_domain_pwr_down_wfi behaviour

Platforms which implement pwr_domain_pwr_down_wfi differ substantially
in behaviour. However, different cpus require similar sequences to power
down. This patch tightens the behaviour of these platforms to end on a
wfi loop after performing platform power down. This is required so that
platforms behave more consistently on power down, in cases where the wfi
can fall through.

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: Ie29bd3a5e654780bacb4e07a6d123ac6d2467c1f
Boyan Karatotev 1 gadu atpakaļ
vecāks
revīzija
028c4e42d8
2 mainītis faili ar 5 papildinājumiem un 3 dzēšanām
  1. 2 1
      docs/getting_started/porting-guide.rst
  2. 3 2
      plat/rpi/common/rpi3_pm.c

+ 2 - 1
docs/getting_started/porting-guide.rst

@@ -2769,7 +2769,8 @@ must ensure that races between multiple CPUs cannot occur.
 The ``target_state`` has a similar meaning as described in the ``pwr_domain_off()``
 operation and it encodes the platform coordinated target local power states for
 the CPU power domain and its parent power domain levels. This function must
-not return back to the caller.
+not return back to the caller (by calling wfi in an infinite loop to ensure
+some CPUs power down mitigations work properly).
 
 If this function is not implemented by the platform, PSCI generic
 implementation invokes ``psci_power_down_wfi()`` for power down.

+ 3 - 2
plat/rpi/common/rpi3_pm.c

@@ -187,8 +187,9 @@ static void __dead2 rpi3_pwr_down_wfi(
 
 	write_rmr_el3(RMR_EL3_RR_BIT | RMR_EL3_AA64_BIT);
 
-	while (1)
-		;
+	while (1) {
+		wfi();
+	}
 }
 
 /*******************************************************************************