mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
msm: camera: ope: Avoid dead lock during flush
During flush OPE driver takes lock on OPE context and calls the CDM flush, in which CDM notifies OPE for all pending requests. If at the same time CDM is notifying OPE for successful request that thread also tries to take lock on OPE context. CDM also tries to takes lock on CDM client in each notify call. Due to which, dead lock is occurring. So taking the lock on OPE context in OPE flush after CDM flush. CRs-Fixed: 2594541 Change-Id: I6ae9105d33a49a638141973cdd6a4a99621dc4c5 Signed-off-by: Rishabh Jain <risjai@codeaurora.org>
This commit is contained in:
parent
bd1e6c2420
commit
130865bbdf
1 changed files with 2 additions and 2 deletions
|
|
@ -2804,6 +2804,7 @@ static int cam_ope_mgr_flush_all(struct cam_ope_ctx *ctx_data,
|
|||
|
||||
rc = cam_cdm_flush_hw(ctx_data->ope_cdm.cdm_handle);
|
||||
|
||||
mutex_lock(&ctx_data->ctx_mutex);
|
||||
for (i = 0; i < hw_mgr->num_ope; i++) {
|
||||
rc = hw_mgr->ope_dev_intf[i]->hw_ops.process_cmd(
|
||||
hw_mgr->ope_dev_intf[i]->hw_priv, OPE_HW_RESET,
|
||||
|
|
@ -2823,6 +2824,7 @@ static int cam_ope_mgr_flush_all(struct cam_ope_ctx *ctx_data,
|
|||
ctx_data->req_list[i] = NULL;
|
||||
clear_bit(i, ctx_data->bitmap);
|
||||
}
|
||||
mutex_unlock(&ctx_data->ctx_mutex);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
@ -2855,9 +2857,7 @@ static int cam_ope_mgr_hw_flush(void *hw_priv, void *hw_flush_args)
|
|||
|
||||
switch (flush_args->flush_type) {
|
||||
case CAM_FLUSH_TYPE_ALL:
|
||||
mutex_lock(&ctx_data->ctx_mutex);
|
||||
cam_ope_mgr_flush_all(ctx_data, flush_args);
|
||||
mutex_unlock(&ctx_data->ctx_mutex);
|
||||
break;
|
||||
case CAM_FLUSH_TYPE_REQ:
|
||||
mutex_lock(&ctx_data->ctx_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue