video: driver: fix race between streamoff and ipsc
During input port streamoff, state is changed from START_INPUT to OPEN and then sent CMD_STOP to firmware. So reverse thread acquired the lock and trying to process IPSC. Since IPSC is not allowed in OPEN state, driver treats that as a fatal issue and moves inst->state to ERROR state. Added change to avoid above mentioned issue. Change-Id: If0e18f01b6ecac3c810c0dab878ae392c48ffc27 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -833,6 +833,7 @@ enum msm_vidc_allow {
|
|||||||
MSM_VIDC_DISALLOW = 0,
|
MSM_VIDC_DISALLOW = 0,
|
||||||
MSM_VIDC_ALLOW,
|
MSM_VIDC_ALLOW,
|
||||||
MSM_VIDC_DEFER,
|
MSM_VIDC_DEFER,
|
||||||
|
MSM_VIDC_DISCARD,
|
||||||
MSM_VIDC_IGNORE,
|
MSM_VIDC_IGNORE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1487,6 +1487,11 @@ enum msm_vidc_allow msm_vidc_allow_input_psc(struct msm_vidc_inst *inst)
|
|||||||
i_vpr_h(inst, "%s: defer input psc, inst state %s\n",
|
i_vpr_h(inst, "%s: defer input psc, inst state %s\n",
|
||||||
__func__, state_name(inst->state));
|
__func__, state_name(inst->state));
|
||||||
allow = MSM_VIDC_DEFER;
|
allow = MSM_VIDC_DEFER;
|
||||||
|
} else if (inst->state == MSM_VIDC_OPEN ||
|
||||||
|
inst->state == MSM_VIDC_START_OUTPUT) {
|
||||||
|
i_vpr_h(inst, "%s: discard input psc, inst state %s\n",
|
||||||
|
__func__, state_name(inst->state));
|
||||||
|
allow = MSM_VIDC_DISCARD;
|
||||||
} else {
|
} else {
|
||||||
i_vpr_e(inst, "%s: input psc in wrong state %s\n",
|
i_vpr_e(inst, "%s: input psc in wrong state %s\n",
|
||||||
__func__, state_name(inst->state));
|
__func__, state_name(inst->state));
|
||||||
|
@@ -1517,6 +1517,9 @@ void handle_session_response_work_handler(struct work_struct *work)
|
|||||||
} else if (allow == MSM_VIDC_DEFER) {
|
} else if (allow == MSM_VIDC_DEFER) {
|
||||||
/* continue to next entry processing */
|
/* continue to next entry processing */
|
||||||
continue;
|
continue;
|
||||||
|
} else if (allow == MSM_VIDC_DISCARD) {
|
||||||
|
/* discard current entry processing */
|
||||||
|
break;
|
||||||
} else if (allow == MSM_VIDC_ALLOW) {
|
} else if (allow == MSM_VIDC_ALLOW) {
|
||||||
rc = handle_session_response_work(inst, resp_work);
|
rc = handle_session_response_work(inst, resp_work);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
|
Reference in New Issue
Block a user