From: Daeyeong Lee Date: Mon, 18 Jun 2018 02:44:00 +0000 (+0900) Subject: sched: ems: ontime: Modify to initialize the boundary value by ratio X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=509ada966159aa59e81b40916ab426080ad1fe67;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git sched: ems: ontime: Modify to initialize the boundary value by ratio Change-Id: Iab4450579898d8b5d561d00f7c627d7c88ce88ab Signed-off-by: Daeyeong Lee --- diff --git a/kernel/sched/ems/ontime.c b/kernel/sched/ems/ontime.c index bb21451a80b8..b5516d8c9e05 100644 --- a/kernel/sched/ems/ontime.c +++ b/kernel/sched/ems/ontime.c @@ -785,16 +785,16 @@ out: pr_err("ONTIME(%s): failed to create sysfs node\n", __func__); return -EINVAL; } -late_initcall(ontime_sysfs_init); /****************************************************************/ /* initialization */ /****************************************************************/ -static void +static void __init parse_ontime(struct device_node *dn, struct ontime_cond *cond, int cnt) { struct device_node *ontime, *coregroup; char name[15]; + unsigned long capacity; unsigned int prop; int res = 0; @@ -808,12 +808,14 @@ parse_ontime(struct device_node *dn, struct ontime_cond *cond, int cnt) goto disable; cond->coregroup = cnt; + capacity = capacity_orig_of(cpumask_first(&cond->cpus)); + /* If any of ontime parameter isn't, disable ontime of this coregroup */ res |= of_property_read_u32(coregroup, "upper-boundary", &prop); - cond->upper_boundary = prop; + cond->upper_boundary = capacity * prop / 100; res |= of_property_read_u32(coregroup, "lower-boundary", &prop); - cond->lower_boundary = prop; + cond->lower_boundary = capacity * prop / 100; res |= of_property_read_u32(coregroup, "coverage-ratio", &prop); cond->coverage_ratio = prop; @@ -825,6 +827,7 @@ parse_ontime(struct device_node *dn, struct ontime_cond *cond, int cnt) return; disable: + pr_err("ONTIME(%s): failed to parse ontime node\n", __func__); cond->enabled = false; cond->upper_boundary = ULONG_MAX; cond->lower_boundary = 0; @@ -855,7 +858,9 @@ static int __init init_ontime(void) list_add_tail(&cond->list, &cond_list); } + ontime_sysfs_init(); + of_node_put(dn); return 0; } -pure_initcall(init_ontime); +late_initcall(init_ontime);