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

Commit 7a9cf539 authored by Maria Yu's avatar Maria Yu
Browse files

PM / devfreq: governor_cpufreq: Update devfreq when cpu offline



Current cpufreq driver will not send CPUFREQ_REMOVE_POLICY
notification when all related cpu offlined, so use
paired notification of CPUFREQ_START and CPUFREQ_STOP
instead to handle the policy start and stop events.

Change-Id: I7cd9b666a282579c7fa10e628da95e77da1b56c5
Signed-off-by: default avatarMaria Yu <aiquny@codeaurora.org>
parent 008aa44c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2015, 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -182,14 +182,14 @@ static int cpufreq_policy_notifier(struct notifier_block *nb,
	struct cpufreq_policy *policy = data;

	switch (event) {
	case CPUFREQ_CREATE_POLICY:
	case CPUFREQ_START:
		mutex_lock(&state_lock);
		add_policy(policy);
		update_all_devfreqs();
		mutex_unlock(&state_lock);
		break;

	case CPUFREQ_REMOVE_POLICY:
	case CPUFREQ_STOP:
		mutex_lock(&state_lock);
		if (state[policy->cpu]) {
			state[policy->cpu]->on = false;