drivers: thermal: Use first online cpu from the policy for cpufreq update

Each cpufreq cooling device is using its cpu id to update cpu
frequency vote with cpufreq driver. There is a possible chance that
cpufreq policy update callback will not be called if that particular
cpu is offline. In that case, if cooling device clears mitigation,
cpufreq policy update doesn't re-evaluate thermal client vote and
it stays in mitigation state until next cpufreq policy update.

Instead of using its cpu id, use first online cpu from the related
cpus from the policy whenever cpufreq cooling device needs to update
its vote. This ensures that cpufreq policy update/re-evaluation is
done immediately when cpufreq cooling device update its vote.

Change-Id: I1450d2a8b6ce00a69b71ba4e4eb2b0d452ef8315
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
1 file changed