Lines Matching +full:no +full:- +full:tick +full:- +full:in +full:- +full:suspend

1 // SPDX-License-Identifier: GPL-2.0-only
21 #include <linux/tick.h>
31 static int tos_resident_cpu = -1;
42 * "enable-method" property of each CPU in the DT, but given that there is no
43 * arch-specific way to check this, we assume that the DT is sensible.
47 int migrate_type = -1; in psci_ops_check()
52 return -EOPNOTSUPP; in psci_ops_check()
66 if (tos_resident_cpu == -1) in psci_ops_check()
67 pr_warn("UP Trusted OS resides on no online CPU\n"); in psci_ops_check()
85 /* Try to power down all CPUs in the mask. */ in down_and_up_cpus()
94 if (ret != -EBUSY) { in down_and_up_cpus()
101 if (ret != -EPERM) { in down_and_up_cpus()
156 return -ENOMEM; in alloc_init_cpu_groups()
162 return -ENOMEM; in alloc_init_cpu_groups()
174 return -ENOMEM; in alloc_init_cpu_groups()
188 int i, nb_cpu_group, err = -ENOMEM; in hotplug_tests()
217 page_buf[len - 1] = '\0'; in hotplug_tests()
236 struct cpuidle_state *state = &drv->states[index]; in suspend_cpu()
237 bool broadcast = state->flags & CPUIDLE_FLAG_TIMER_STOP; in suspend_cpu()
244 * The local timer will be shut down, we need to enter tick in suspend_cpu()
250 * In the absence of hardware broadcast mechanism, in suspend_cpu()
252 * may be why entering tick broadcast has failed. in suspend_cpu()
262 ret = state->enter(dev, drv, index); in suspend_cpu()
279 /* No need for an actual callback, we just want to wake up the CPU. */ in suspend_test_thread()
291 pr_info("CPU %d entering suspend cycles, states 1 through %d\n", in suspend_test_thread()
292 cpu, drv->state_count - 1); in suspend_test_thread()
301 for (index = 1; index < drv->state_count; ++index) { in suspend_test_thread()
303 struct cpuidle_state *state = &drv->states[index]; in suspend_test_thread()
306 * Set the timer to wake this CPU up in some time (which in suspend_test_thread()
307 * should be largely sufficient for entering suspend). in suspend_test_thread()
308 * If the local tick is disabled when entering suspend, in suspend_test_thread()
310 * tick, so the timer will still wake us up. in suspend_test_thread()
313 usecs_to_jiffies(state->target_residency)); in suspend_test_thread()
315 /* IRQs must be disabled during suspend operations. */ in suspend_test_thread()
321 * We have woken up. Re-enable IRQs to handle any in suspend_test_thread()
333 pr_err("Failed to suspend CPU %d: error %d " in suspend_test_thread()
359 pr_info("CPU %d suspend test results: success %d, shallow states %d, errors %d\n", in suspend_test_thread()
376 return -ENOMEM; in suspend_tests()
380 * mode, as it might interfere with the suspend threads on other CPUs. in suspend_tests()
381 * This does not prevent the suspend threads from using cpuidle (only in suspend_tests()
383 * the cpuidle driver and device look-up can be carried out safely. in suspend_tests()
409 err = -ENODEV; in suspend_tests()
416 * Wake up the suspend threads. To avoid the main thread being preempted in suspend_tests()
417 * before all the threads have been unparked, the suspend threads will in suspend_tests()
443 * Since we're in an initcall, we assume that all the CPUs that all in psci_checker()
448 * is no userspace yet in initcalls, that should be fine, as long as in psci_checker()
449 * no torture test is running at the same time (see Kconfig). in psci_checker()
465 pr_err("%d error(s) encountered in hotplug tests\n", ret); in psci_checker()
471 pr_info("Starting suspend tests (%d cycles per state)\n", in psci_checker()
475 pr_info("Suspend tests passed OK\n"); in psci_checker()
477 pr_err("%d error(s) encountered in suspend tests\n", ret); in psci_checker()
480 case -ENOMEM: in psci_checker()
483 case -ENODEV: in psci_checker()
484 pr_warn("Could not start suspend tests on any CPU\n"); in psci_checker()