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

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

Merge "cpufreq: interactive: Do not reschedule timer if policy->max changes"

parents 2c22c253 485a6189
Loading
Loading
Loading
Loading
+1 −21
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ struct cpufreq_interactive_cpuinfo {
	spinlock_t target_freq_lock; /*protects target freq */
	unsigned int target_freq;
	unsigned int floor_freq;
	unsigned int max_freq;
	unsigned int min_freq;
	u64 floor_validate_time;
	u64 local_fvtime; /* per-cpu floor_validate_time */
@@ -1624,7 +1623,6 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
			pcpu->hispeed_validate_time =
				pcpu->floor_validate_time;
			pcpu->local_hvtime = pcpu->floor_validate_time;
			pcpu->max_freq = policy->max;
			pcpu->min_freq = policy->min;
			pcpu->reject_notification = true;
			down_write(&pcpu->enable_sem);
@@ -1681,26 +1679,8 @@ static int cpufreq_governor_interactive(struct cpufreq_policy *policy,
			pcpu->min_freq = policy->min;

			up_read(&pcpu->enable_sem);

			/* Reschedule timer only if policy->max is raised.
			 * Delete the timers, else the timer callback may
			 * return without re-arm the timer when failed
			 * acquire the semaphore. This race may cause timer
			 * stopped unexpectedly.
			 */

			if (policy->max > pcpu->max_freq) {
				pcpu->reject_notification = true;
				down_write(&pcpu->enable_sem);
				del_timer_sync(&pcpu->cpu_timer);
				del_timer_sync(&pcpu->cpu_slack_timer);
				cpufreq_interactive_timer_resched(j, false);
				up_write(&pcpu->enable_sem);
				pcpu->reject_notification = false;
		}

			pcpu->max_freq = policy->max;
		}
		break;
	}
	return 0;