Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1b56ae8c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cpuidle: lpm-levels: Check for negative sleep times"

parents 19a2db2c a791bcff
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -445,8 +445,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
	int best_level = -1;
	uint32_t latency_us = pm_qos_request_for_cpu(PM_QOS_CPU_DMA_LATENCY,
							dev->cpu);
	uint32_t sleep_us =
		(uint32_t)(ktime_to_us(tick_nohz_get_sleep_length()));
	s64 sleep_us = ktime_to_us(tick_nohz_get_sleep_length());
	uint32_t modified_time_us = 0;
	uint32_t next_event_us = 0;
	int i;
@@ -456,7 +455,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
	if (!cpu)
		return -EINVAL;

	if (sleep_disabled)
	if (sleep_disabled || sleep_us  < 0)
		return 0;

	next_event_us = (uint32_t)(ktime_to_us(get_next_event_time(dev->cpu)));
@@ -464,7 +463,7 @@ static int cpu_power_select(struct cpuidle_device *dev,
	for (i = 0; i < cpu->nlevels; i++) {
		struct lpm_cpu_level *level = &cpu->levels[i];
		struct power_params *pwr_params = &level->pwr;
		uint32_t next_wakeup_us = sleep_us;
		uint32_t next_wakeup_us = (uint32_t)sleep_us;
		enum msm_pm_sleep_mode mode = level->mode;
		bool allow;