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

Commit e2271913 authored by Dilip Gopalakrishna's avatar Dilip Gopalakrishna Committed by Gerrit - the friendly Code Review server
Browse files

camera: Make stop_session a blocking call



For stop_session, we want to wait for it to complete before return.
Otherwise, we run into race condition when next start_session
happens.

Bug: 11045420
Change-Id: I283f6e374898120e0bfb95d39fb9561809779498
Signed-off-by: default avatarShuzhen Wang <shuzhenw@codeaurora.org>
parent 0600f6c1
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -669,14 +669,11 @@ static int camera_v4l2_close(struct file *filep)

		camera_pack_event(filep, MSM_CAMERA_SET_PARM,
			MSM_CAMERA_PRIV_DEL_STREAM, -1, &event);

		/* Donot wait, imaging server may have crashed */
		msm_post_event(&event, MSM_POST_EVT_TIMEOUT);

		camera_pack_event(filep, MSM_CAMERA_DEL_SESSION, 0, -1, &event);
		msm_post_event(&event, MSM_POST_EVT_TIMEOUT);

		/* Donot wait, imaging server may have crashed */
		msm_post_event(&event, -1);
		msm_delete_command_ack_q(pvdev->vdev->num, 0);

		/* This should take care of both normal close
@@ -687,9 +684,8 @@ static int camera_v4l2_close(struct file *filep)
	} else {
		camera_pack_event(filep, MSM_CAMERA_SET_PARM,
			MSM_CAMERA_PRIV_DEL_STREAM, -1, &event);

		/* Donot wait, imaging server may have crashed */
		msm_post_event(&event, MSM_POST_EVT_TIMEOUT);

		msm_delete_command_ack_q(pvdev->vdev->num,
			sp->stream_id);