kthread_queue_work(&power->worker, &power->work);
}
+static void
+sched_power_update_cpu_weight(struct cpu_power *cpower, int cpu, int weight,
+ int flags, int time)
+{
+ struct sched_power *sp;
+
+ raw_spin_lock(&cpower->update_lock);
+ cpower->req.weight = weight;
+ cpower->req.cpu = cpu;
+ cpower->req.time = time;
+ cpower->req.flags = flags;
+ raw_spin_unlock(&cpower->update_lock);
+}
+
+
static void sched_power_update(struct update_sched_power *update, int cpu,
int weight, int flags, int time)
{
if (!should_update_next_weight(time, flags))
return;
- sp = cpower->sched_power;
+ switch (flags) {
+ case SCHED_POWER_CPU_WEIGHT:
+ sched_power_update_cpu_weight(cpower, cpu, weight, flags, time);
+ break;
+ case SCHED_POWER_CLUSTER_WEIGHT:
- raw_spin_lock(&cpower->update_lock);
- cpower->req.weight = weight;
- cpower->req.cpu = cpu;
- cpower->req.time = time;
- cpower->req.flags = flags;
- raw_spin_unlock(&cpower->update_lock);
+ break;
+ default:
+ return;
+ }
+
+ sp = cpower->sched_power;
if (!sp->work_in_progress) {
sp->work_in_progress = true;
#endif
#define SCHED_POWER_FORCE_UPDATE_RT 0x01
-#define SCHED_POWER_CLUSTER_REQ 0x2
+#define SCHED_POWER_CPU_WEIGHT 0x2
+#define SCHED_POWER_CLUSTER_WEIGHT 0x4
+
#ifdef CONFIG_THERMAL
struct update_sched_power {
void (*func)(struct update_sched_power *, int, int, int, int);
void sched_power_change_cluster_weight(int cpu, int weight, int flags)
{
sched_power_change_cpu_weight(cpu, weight, flags |
- SCHED_POWER_CLUSTER_REQ);
+ SCHED_POWER_CLUSTER_WEIGHT);
}
#else
static inline