Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 734e44be authored by George Shen's avatar George Shen
Browse files

msm: cvp: Avoid racing in session deletion and use



Avoid a deleted session being used for power update.

Change-Id: I44a6ea0a4c0dda499bc6adac94b2edafdeeab82c
Signed-off-by: default avatarGeorge Shen <sqiao@codeaurora.org>
parent 6a91a7d5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -754,6 +754,7 @@ static void aggregate_power_update(struct msm_cvp_core *core,
	unsigned long op_mpu_max[2] = {0}, op_ica_max[2] = {0};
	unsigned long op_fw_max[2] = {0}, bw_sum[2] = {0}, op_bw_max[2] = {0};

	mutex_lock(&core->lock);
	list_for_each_entry(inst, &core->instances, list) {
		if (inst->state == MSM_CVP_CORE_INVALID ||
			inst->state == MSM_CVP_CORE_UNINIT ||
@@ -824,6 +825,8 @@ static void aggregate_power_update(struct msm_cvp_core *core,
			core->dyn_clk.sum_fps[HFI_HW_ICA]);
	}

	mutex_unlock(&core->lock);

	for (i = 0; i < 2; i++) {
		fdu_sum[i] = max_3(fdu_sum[i], od_sum[i], mpu_sum[i]);
		fdu_sum[i] = max_3(fdu_sum[i], ica_sum[i], fw_sum[i]);