return -errno;
}
}
+ } else if (MATCH(result->name, "scenario_max_timeout_ms")) {
+ int max_timeout_ms = atoi(result->value);
+
+ if (max_timeout_ms < 0) {
+ _E("failed to get maximum timeout of scenario");
+ return -ERANGE;
+ }
+ scenarios->max_timeout_ms = max_timeout_ms;
}
}
if (scenarios->num > 0 && !scenarios->list) {
scenarios->num = 0;
+ scenarios->max_timeout_ms = 0;
free(scenarios->list);
}
{
int ret;
+ /* Initialize the variables before parsing the pass-pmqos.conf */
+ scenarios->num = 0;
+ scenarios->max_timeout_ms = 0;
+
/* get configuration file */
ret = config_parse(path, pmqos_load_config, scenarios);
if (ret < 0) {
static dd_list *pmqos_head;
static Ecore_Timer *unlock_timer;
+static int unlock_max_timeout_ms;
static struct timespec unlock_timer_start_st;
static struct timespec unlock_timer_end_st;
static struct pmqos_cpu unlock_timer_owner = {"", 0};
int ret;
/* Check valid parameter */
- if (val > DEFAULT_PMQOS_TIMER) {
- _I("The timer value cannot be higher than default time value(%dms)", DEFAULT_PMQOS_TIMER);
- val = DEFAULT_PMQOS_TIMER;
+ if (val > unlock_max_timeout_ms) {
+ _I("Timeout cannot be higher than maximum timeout (%d ms)",
+ unlock_max_timeout_ms);
+ val = unlock_max_timeout_ms;
}
/* find cpu */
DD_LIST_FOREACH(pmqos_head, elem, cpu) {
_D("support [%s] scenario", scenarios.list[i].name);
}
+ /*
+ * Set maximum timeout for the sceanrio by using the parsed data from
+ * pass-pmqos.conf. But, if there is no setting from pass-pmqos.conf
+ * pmqos uses the default timeout value (3000 millisecond).
+ */
+ if (scenarios.max_timeout_ms)
+ unlock_max_timeout_ms = scenarios.max_timeout_ms;
+ else
+ unlock_max_timeout_ms = DEFAULT_PMQOS_TIMER;
+
*edbus_methods = methods;
ret = count;
pmqos_put_scenario(&scenarios);