Merge "dsp: unmap cma memory before hyp unassign during adm close"

This commit is contained in:
qctecmdr 2020-11-25 18:57:01 -08:00 • committed by Gerrit - the friendly Code Review server
commit f3bf502f35

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,