Commit 11ac18ab authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Anas Nashif
Browse files

power: Add an assert for an unexpected condition



Exit latency time should never be greater than the residency time.
Just add an assert in case the policy does not properly handle it.

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent fba5779a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -182,6 +182,14 @@ enum pm_state pm_system_suspend(int32_t ticks)
	post_ops_done = 0;

	if (ticks != K_TICKS_FOREVER) {
		/*
		 * Just a sanity check in case the policy manager does not
		 * handle this error condition properly.
		 */
		__ASSERT(z_power_state.min_residency_us >=
			z_power_state.exit_latency_us,
			"min_residency_us < exit_latency_us");

		/*
		 * We need to set the timer to interrupt a little bit early to
		 * accommodate the time required by the CPU to fully wake up.