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

Commit 61a59b82 authored by Pavankumar Kondeti's avatar Pavankumar Kondeti
Browse files

sched: walt: Use cpufreq transition notifier selectively



CPU frequency fast switching is disallowed if there are any cpufreq
transition notification listeners. cpufreq transition notifier is
needed in the scheduler in the absence of cycle counter support.
Unregister cpufreq transition notifier upon clock driver registering
cycle counter callback with the scheduler.

Change-Id: Ib19444be639a96589d0c3b29900b997c228df595
Signed-off-by: default avatarPavankumar Kondeti <pkondeti@codeaurora.org>
parent e48a92d9
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -288,21 +288,6 @@ update_window_start(struct rq *rq, u64 wallclock, int event)
	return old_window_start;
}

int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
{
	mutex_lock(&cluster_lock);
	if (!cb->get_cpu_cycle_counter) {
		mutex_unlock(&cluster_lock);
		return -EINVAL;
	}

	cpu_cycle_counter_cb = *cb;
	use_cycle_counter = true;
	mutex_unlock(&cluster_lock);

	return 0;
}

static void update_task_cpu_cycles(struct task_struct *p, int cpu)
{
	if (use_cycle_counter)
@@ -2400,6 +2385,23 @@ static int register_walt_callback(void)
 */
core_initcall(register_walt_callback);

int register_cpu_cycle_counter_cb(struct cpu_cycle_counter_cb *cb)
{
	mutex_lock(&cluster_lock);
	if (!cb->get_cpu_cycle_counter) {
		mutex_unlock(&cluster_lock);
		return -EINVAL;
	}

	cpu_cycle_counter_cb = *cb;
	use_cycle_counter = true;
	mutex_unlock(&cluster_lock);

	cpufreq_unregister_notifier(&notifier_trans_block,
				    CPUFREQ_TRANSITION_NOTIFIER);
	return 0;
}

static void transfer_busy_time(struct rq *rq, struct related_thread_group *grp,
				struct task_struct *p, int event);