msm: camera: sensor: Fix mutex handling in TPG driver

Issue:
TPG driver doesn't release the device mutex when the stop/
configure commands fail.

Fix:
Release the mutex everytime it's acquired in TPG driver.

Change-Id: I8414c73b89e1e69b60682d860ec1d97d6a7a8dbc
CRs-Fixed: 3594995
Signed-off-by: Shravan Nevatia <quic_snevatia@quicinc.com>
(cherry picked from commit 7b9602e996781f36a79c514780d1f776f5dfda8a)
This commit is contained in:
Shravan Nevatia
2023-08-28 15:04:16 +05:30
committed by Sridhar Gujje
parent 87406c4947
commit ed308a3020

View File

@@ -830,14 +830,14 @@ int tpg_hw_stop(struct tpg_hw *hw)
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw stop failed %d",
hw->hw_idx, rc);
return rc;
break;
}
}
rc = tpg_hw_soc_disable(hw);
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw soc disable failed %d",
hw->hw_idx, rc);
return rc;
break;
}
tpg_hw_free_waiting_requests_locked(hw);
tpg_hw_free_active_requests_locked(hw);
@@ -966,7 +966,7 @@ static int tpg_hw_configure_init_settings(
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw soc enable failed %d",
hw->hw_idx, rc);
return rc;
break;
}
if (hw->hw_info->ops->init)
@@ -975,7 +975,6 @@ static int tpg_hw_configure_init_settings(
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw init failed %d",
hw->hw_idx, rc);
return rc;
}
break;
default:
@@ -1011,7 +1010,7 @@ static int tpg_hw_configure_init_settings_v3(
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw soc enable failed %d",
hw->hw_idx, rc);
return rc;
break;
}
if (hw->hw_info->ops->init)
@@ -1020,7 +1019,6 @@ static int tpg_hw_configure_init_settings_v3(
if (rc) {
CAM_ERR(CAM_TPG, "TPG[%d] hw init failed %d",
hw->hw_idx, rc);
return rc;
}
break;
default: