Reduce time lock in psci_do_cpu_off
authorRoberto Vargas <roberto.vargas@arm.com>
Mon, 4 Sep 2017 15:49:41 +0000 (16:49 +0100)
committerRoberto Vargas <roberto.vargas@arm.com>
Wed, 6 Sep 2017 13:48:15 +0000 (14:48 +0100)
psci_set_power_off_state only initializes a local variable, so there
isn't any reason why it should be done while the lock is held.

Change-Id: I1c62f4cd5d860d102532e5a5350152180d41d127
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
lib/psci/psci_off.c

index e7fb6532203adfc705fcd99e29469f16d1de7a3b..231deea2d3b4151f63372ec99e99315788831c50 100644 (file)
@@ -49,6 +49,9 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
         */
        assert(psci_plat_pm_ops->pwr_domain_off);
 
+       /* Construct the psci_power_state for CPU_OFF */
+       psci_set_power_off_state(&state_info);
+
        /*
         * This function acquires the lock corresponding to each power
         * level so that by the time all locks are taken, the system topology
@@ -68,9 +71,6 @@ int psci_do_cpu_off(unsigned int end_pwrlvl)
                        goto exit;
        }
 
-       /* Construct the psci_power_state for CPU_OFF */
-       psci_set_power_off_state(&state_info);
-
        /*
         * This function is passed the requested state info and
         * it returns the negotiated state info for each power level upto