//////////////////////////////////////////////////////////////
-static bool should_update_next_weight(u64 time, int flags)
+static bool should_process_next_request(u64 time, int flags)
{
if (flags & SCHED_POWER_FORCE_UPDATE_RT)
return 1;
- if (time >= sched_clock() + MINIMUM_UPDATE_TIME)
- return 1;
+ /* if (time >= sched_clock() + MINIMUM_UPDATE_TIME) */
+ /* return 1; */
- return 0;
+ return 1;
}
static int play_idle_setup;
mutex_unlock(&tz_list_lock);
if (system_zone) {
+ pr_info("zone found\n");
mutex_lock(&system_zone->lock);
cluster_inst->weight = weight;
mutex_unlock(&system_zone->lock);
thermal_notify_framework(system_zone->tz,
system_zone->trip_ctrl_alg.desired_id);
} else {
+ pr_info("no such zone\n");
return -ENODEV;
}
cpower = (&per_cpu(cpu_power, req->cpu));
+ pr_info("req->flags=%d\n", req->flags);
switch (req->flags) {
case SCHED_POWER_CPU_WEIGHT:
break;
}
static void
-sched_power_update_cpu_weight(struct cpu_power *cpower, int cpu, int weight,
+sched_power_update_weight(struct cpu_power *cpower, int cpu, int weight,
int flags, int time)
{
raw_spin_lock(&cpower->update_lock);
return;
/* Filter to frequent changes or not needed*/
- if (!should_update_next_weight(time, flags))
+ if (!should_process_next_request(time, flags))
return;
+ flags &= 0x3;
+
switch (flags) {
case SCHED_POWER_CPU_WEIGHT:
- sched_power_update_cpu_weight(cpower, cpu, weight, flags, time);
+ sched_power_update_weight(cpower, cpu, weight, flags, time);
break;
case SCHED_POWER_CLUSTER_WEIGHT:
-
+ sched_power_update_weight(cpower, cpu, weight, flags, time);
break;
default:
return;
irq_work_queue(&sp->irq_work);
}
- if (!play_idle_setup && cpu == 4) {
+ if (!play_idle_setup) {
+ pr_info("play idle demo\n");
play_idle_setup = 1;
idle_inject_set_duration(cpower->ii_dev, 10, 4);
idle_inject_start(cpower->ii_dev);
cdev = inst->cooling->cdev;
ret = cdev->ops->power2state(cdev, tz, power, &state);
- pr_info("set_power=%u, state=%lu, temp=%d\n", power, state,
- tz->temperature);
+ pr_info("inst_weight=%u, set_power=%u, state=%lu, temp=%d\n",
+ inst->weight, power, state, tz->temperature);
if (!ret) {
ret = cooling_dev_set_state(zone, inst->cooling, state);
}