*/
static bool is_enabled(struct pass_policy *policy)
{
- if (policy->governor->gov_state != PASS_GOV_START)
+ if (policy->gov_state != PASS_GOV_START)
return false;
return true;
pass_rescon_set_level(res, policy->init_level);
/* Set PASS state as PASS_GOV_START */
- policy->governor->gov_state = PASS_GOV_START;
+ policy->gov_state = PASS_GOV_START;
_I("Start governor for '%s' resource", cdata->res_name);
}
return;
}
- if (policy->governor->gov_state == PASS_GOV_STOP) {
+ if (policy->gov_state == PASS_GOV_STOP) {
_E("PASS governor is already inactive state");
return;
}
}
/* Set PASS state as PASS_GOV_STOP */
- policy->governor->gov_state = PASS_GOV_STOP;
+ policy->gov_state = PASS_GOV_STOP;
_I("Stop governor for '%s' resource", cdata->res_name);
}
}
/* Set default PASS state */
- policy->governor->gov_state = PASS_GOV_STOP;
+ policy->gov_state = PASS_GOV_STOP;
ret = pass_notifier_init(res);
if (ret < 0) {
_E("cannot initialize notifier for the pmqos (%d)\n", ret);
#ifndef __PASS_GOV__
#define __PASS_GOV__
-enum pass_gov_state {
- PASS_GOV_NONE = 0,
- PASS_GOV_START,
- PASS_GOV_STOP,
-};
-
/* Init, exit and update the governor */
int pass_governor_init(struct pass_resource *res);
int pass_governor_exit(struct pass_resource *res);
PASS_GOV_END,
};
+enum pass_gov_state {
+ PASS_GOV_NONE = 0,
+ PASS_GOV_START,
+ PASS_GOV_STOP,
+};
+
/******************************************************
* PASS basic data *
******************************************************/
struct pass_policy {
enum pass_state state;
enum pass_gov_type gov_type;
+ enum pass_gov_state gov_state;
unsigned int pass_cpu_threshold;
unsigned int up_threshold;
unsigned int down_threshold;