gk20a_pmu_disable_elpg can be called before the PMU driver has
received and processed the INIT message from the PMU. If change
ensures that the ELPG ref-count has been initialized to zero
before that can happen.
Bug
200016313
Change-Id: Ic80ec1ee69b1eb0499effb1abf556f78cb041f5e
Signed-off-by: Neil Gabriel <ngabriel@nvidia.com>
Reviewed-on: http://git-master/r/431927
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Robert Shih <rshih@nvidia.com>
Tested-by: Robert Shih <rshih@nvidia.com>
Reviewed-by: Mitch Luban <mluban@nvidia.com>
+ /* start with elpg disabled until first enable call */
+ mutex_init(&pmu->elpg_mutex);
+ pmu->elpg_refcnt = 0;
+
if (pmu->sw_ready) {
for (i = 0; i < pmu->mutex_cnt; i++) {
pmu->mutex[i].id = i;
if (pmu->sw_ready) {
for (i = 0; i < pmu->mutex_cnt; i++) {
pmu->mutex[i].id = i;
pmu->sw_ready = true;
skip_init:
pmu->sw_ready = true;
skip_init:
- mutex_init(&pmu->elpg_mutex);
mutex_init(&pmu->isr_mutex);
mutex_init(&pmu->isr_enable_lock);
mutex_init(&pmu->pmu_copy_lock);
mutex_init(&pmu->isr_mutex);
mutex_init(&pmu->isr_enable_lock);
mutex_init(&pmu->pmu_copy_lock);
gk20a_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ,
pmu_handle_pg_elpg_msg, pmu, &seq, ~0);
gk20a_pmu_cmd_post(g, &cmd, NULL, NULL, PMU_COMMAND_QUEUE_HPQ,
pmu_handle_pg_elpg_msg, pmu, &seq, ~0);
- /* start with elpg disabled until first enable call */
- pmu->elpg_refcnt = 0;
-
pmu->pmu_state = PMU_STATE_STARTING;
return 0;
pmu->pmu_state = PMU_STATE_STARTING;
return 0;