Setting 1 allows to finish calculation and throttle devices.
Signed-off-by: Lukasz Luba <l.luba@partner.samsung.com>
i++;
}
+ /* protect 'weights' changes in the background */
mutex_lock(&zone->lock);
/* estimate cooling dev's power and total power */
i = 0;
}
mutex_unlock(&zone->lock);
- if (sum_power <= 0)
- goto cleanup;
+ if (sum_power == 0)
+ sum_power = 1;
/* split power budget to cooling devices */
i = 0;
i++;
}
+ /* clamp max possible power for devices and re-share the rest */
+
/* set the new state for cooling device based on its granted power */
i = 0;
list_for_each_entry(inst, &zone->cooling_list, node) {
i++;
}
-cleanup:
kfree(power);
return 0;