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

Commit 62eca6d2 authored by Akhil Karuturi's avatar Akhil Karuturi
Browse files

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: default avatarAkhil Karuturi <akarutur@codeaurora.org>
parent dec796e3
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -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,