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>
Bu işleme şunda yer alıyor:
Govindaraj Rajagopal
2021-05-26 20:32:28 +05:30
ebeveyn 8d81cd480b
işleme 69e6b8c0ca
3 değiştirilmiş dosya ile 9 ekleme ve 0 silme

Dosyayı Görüntüle

@@ -833,6 +833,7 @@ enum msm_vidc_allow {
MSM_VIDC_DISALLOW = 0,
MSM_VIDC_ALLOW,
MSM_VIDC_DEFER,
MSM_VIDC_DISCARD,
MSM_VIDC_IGNORE,
};

Dosyayı Görüntüle

@@ -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",
__func__, state_name(inst->state));
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 {
i_vpr_e(inst, "%s: input psc in wrong state %s\n",
__func__, state_name(inst->state));

Dosyayı Görüntüle

@@ -1517,6 +1517,9 @@ void handle_session_response_work_handler(struct work_struct *work)
} else if (allow == MSM_VIDC_DEFER) {
/* continue to next entry processing */
continue;
} else if (allow == MSM_VIDC_DISCARD) {
/* discard current entry processing */
break;
} else if (allow == MSM_VIDC_ALLOW) {
rc = handle_session_response_work(inst, resp_work);
if (!rc)