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

Commit 47f80b32 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: kill session without acquiring lock



Mutex lock q->lock was already acquired before calling
start_streaming() so calling msm_comm_kill_session() from
inside start_streaming() may result in abort timeout error.
Kill session will send abort to firmware and waits for
abort done response which may not be processed ever if
response handler thread tries to acquire same q->lock.
All timeout errors are treated as fatal error so avoid
timeout error by moving msm_comm_kill_session() from inside
start_streaming() to after releasing q->lock functionality.

CRs-Fixed: 2135048
Change-Id: I01b25bb76b7191cf4df656a9b05363ea3529bdb9
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -605,8 +605,10 @@ int msm_vidc_streamon(void *instance, enum v4l2_buf_type i)
	mutex_lock(&q->lock);
	rc = vb2_streamon(&q->vb2_bufq, i);
	mutex_unlock(&q->lock);
	if (rc)
	if (rc) {
		dprintk(VIDC_ERR, "streamon failed on port: %d\n", i);
		msm_comm_kill_session(inst);
	}
	return rc;
}
EXPORT_SYMBOL(msm_vidc_streamon);
@@ -1010,10 +1012,9 @@ static inline int start_streaming(struct msm_vidc_inst *inst)
	}

fail_start:
	if (rc) {
		dprintk(VIDC_ERR, "%s: kill session %pK\n", __func__, inst);
		msm_comm_kill_session(inst);
	}
	if (rc)
		dprintk(VIDC_ERR, "%s: inst %pK session %x failed to start\n",
			__func__, inst, hash32_ptr(inst->session));
	return rc;
}