dsp: unmap cma memory before hyp unassign during adm close

unmap memory before hyp unassign during adm close
for handset/speaker FNN usecase.

Change-Id: I1d4d335c5179e42af4dcf7cf8e82e48669b32830
Signed-off-by: Akhil Karuturi <akarutur@codeaurora.org>
This commit is contained in:
Akhil Karuturi 2020-11-13 18:00:24 -08:00
commit 62eca6d27b

View file

@ -4005,6 +4005,20 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
ret = -EINVAL;
goto fail;
}
/**
* call unmap CMA before hyp unassign during
* end of handset/speaker usecase.
*/
if (cal_block->map_data.q6map_handle != 0) {
atomic_set(&this_adm.mem_map_handles[cal_index],
cal_block->map_data.q6map_handle);
atomic_set(&this_adm.mem_map_index, cal_index);
ret = adm_memory_unmap_regions();
if (ret < 0)
pr_err("%s: unmap did not work! cal_type %i ret %d\n",
__func__, cal_index, ret);
cal_block->map_data.q6map_handle = 0;
}
ret = hyp_assign_phys(
cal_block->cal_data.paddr,
cal_block->map_data.map_size,
@ -4076,6 +4090,17 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
ret = -EINVAL;
goto fail;
}
/* call unmap CMA before hyp unassign during end of handset/speaker usecase */
if (cal_block->map_data.q6map_handle != 0) {
atomic_set(&this_adm.mem_map_handles[cal_index],
cal_block->map_data.q6map_handle);
atomic_set(&this_adm.mem_map_index, cal_index);
ret = adm_memory_unmap_regions();
if (ret < 0)
pr_err("%s: unmap did not work! cal_type %i ret %d\n",
__func__, cal_index, ret);
cal_block->map_data.q6map_handle = 0;
}
ret = hyp_assign_phys(cal_block->cal_data.paddr,
cal_block->map_data.map_size,
source_vm, 2, dest_vm,