msm: ipa4: IPA PM Unit tests init fix

Destroy the PM before unit testing since every test
case will re-init the PM with their own parameters.
Take out rpmh dependency for unit tests and move in ipa.c.

Change-Id: I4975340b7ba0210aebe0631778fe85c4023feb11
CRs-fixed: 2238471
Signed-off-by: Michael Adisumarta <madisuma@codeaurora.org>
This commit is contained in:
Michael Adisumarta 2018-05-18 14:39:27 -07:00 committed by Gerrit - the friendly Code Review server
parent 410fd186cd
commit 24fda2a0b2
2 changed files with 31 additions and 15 deletions

View File

@ -3879,16 +3879,18 @@ int ipa3_set_clock_plan_from_pm(int idx)
{
u32 clk_rate;
if (!ipa3_ctx->enable_clock_scaling)
IPADBG_LOW("idx = %d\n", idx);
if (!ipa3_ctx->enable_clock_scaling) {
ipa3_ctx->ipa3_active_clients.bus_vote_idx = idx;
return 0;
}
if (ipa3_ctx->ipa3_hw_mode != IPA_HW_MODE_NORMAL) {
IPAERR("not supported in this mode\n");
return 0;
}
IPADBG_LOW("idx = %d\n", idx);
if (idx <= 0 || idx >= ipa3_ctx->ctrl->msm_bus_data_ptr->num_usecases) {
IPAERR("bad voltage\n");
return -EINVAL;

View File

@ -23,18 +23,32 @@ struct callback_param {
static int ipa_pm_ut_setup(void **ppriv)
{
int i;
IPA_UT_DBG("Start Setup\n");
/* decrement UT vote */
IPA_ACTIVE_CLIENTS_DEC_SPECIAL("IPA_UT");
/*decouple PM from RPM */
ipa3_ctx->enable_clock_scaling = false;
if (ipa3_ctx->use_ipa_pm) {
for (i = 0; i < IPA_PM_MAX_CLIENTS; i++) {
ipa_pm_deactivate_sync(i);
ipa_pm_deregister(i);
}
ipa_pm_destroy();
}
return 0;
}
static int ipa_pm_ut_teardown(void *priv)
{
IPA_UT_DBG("Start Teardown\n");
IPA_UT_ERR("WARNING: IPA_PM HAS BEEN DESTROYED, REBOOT TO RE_INIT\n");
/* undo UT vote */
IPA_ACTIVE_CLIENTS_INC_SPECIAL("IPA_UT");
@ -106,7 +120,7 @@ static int ipa_pm_ut_single_registration(void *priv)
struct callback_param user_data;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -223,7 +237,7 @@ static int ipa_pm_ut_double_register_activate(void *priv)
struct callback_param user_data;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -327,7 +341,7 @@ static int ipa_pm_ut_deferred_deactivate(void *priv)
struct callback_param user_data;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -436,7 +450,7 @@ static int ipa_pm_ut_two_clients_activate(void *priv)
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -648,7 +662,7 @@ static int ipa_pm_ut_deactivate_all_deferred(void *priv)
struct callback_param user_data;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -797,7 +811,7 @@ static int ipa_pm_ut_deactivate_after_activate(void *priv)
struct callback_param user_data;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -885,7 +899,7 @@ static int ipa_pm_ut_atomic_activate(void *priv)
unsigned long flags;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -957,7 +971,7 @@ static int ipa_pm_ut_deactivate_loop(void *priv)
int i, hdl_USB, hdl_WLAN, vote;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -1095,7 +1109,7 @@ static int ipa_pm_ut_set_perf_profile(void *priv)
int hdl_USB, hdl_WLAN, vote, idx;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -1210,7 +1224,7 @@ static int ipa_pm_ut_group_tput(void *priv)
int hdl_USB, hdl_WLAN, hdl_MODEM, vote, idx;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -1377,7 +1391,7 @@ static int ipa_pm_ut_skip_clk_vote_tput(void *priv)
int hdl_USB, hdl_WLAN, hdl_MODEM, vote, idx;
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000}
};
@ -1542,7 +1556,7 @@ static int ipa_pm_ut_simple_exception(void *priv)
};
struct ipa_pm_init_params init_params = {
.threshold_size = IPA_PM_THRESHOLD_MAX,
.threshold_size = 2,
.default_threshold = {600, 1000},
.exception_size = 1,
.exceptions[0] = exceptions,