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

Commit a888c5c9 authored by Rohit Kumar's avatar Rohit Kumar Committed by Banajit Goswami
Browse files

ASoC: msm: qdsp6v2: Add mutex in afe_map_cal_data



Add mutex_lock in afe_map_cal_data around afe_cmd_memory_map to
avoid update of this_afe.status by afe_set_lpass_clk_cfg afe callback.
This fixes the failure of afe_cmd_memory_map waitqueue to enter into
sleep when wait_event_timeout is called as this_afe.status is already
zero leading to invalid map_handle.

CRs-Fixed: 1094151
Change-Id: I4833253803c162c98578ba7ce599ea1edafc1724
Signed-off-by: default avatarRohit Kumar <rohitkr@codeaurora.org>
parent bb09530b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -6366,6 +6366,7 @@ static int afe_map_cal_data(int32_t cal_type,
	}


	mutex_lock(&this_afe.afe_cmd_lock);
	atomic_set(&this_afe.mem_map_cal_index, cal_index);
	ret = afe_cmd_memory_map(cal_block->cal_data.paddr,
			cal_block->map_data.map_size);
@@ -6378,10 +6379,12 @@ static int afe_map_cal_data(int32_t cal_type,
			__func__,
			&cal_block->cal_data.paddr,
			cal_block->map_data.map_size);
		mutex_unlock(&this_afe.afe_cmd_lock);
		goto done;
	}
	cal_block->map_data.q6map_handle = atomic_read(&this_afe.
		mem_map_cal_handles[cal_index]);
	mutex_unlock(&this_afe.afe_cmd_lock);
done:
	return ret;
}