mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 07:37:31 -04:00
clk: qcom: gdsc: Remove global mutex lock in enable/disable callbacks
The global mutex lock which was introduced to correct a droop issue on certain devices during multiple enable/disable of GDSCs is no longer a requirement, so remove the same to avoid the GDSC lock being acquired while holding clock global lock causing the deadlock scenario. Change-Id: Idc674dea06935509524afb89602599902dd03c56 Signed-off-by: Taniya Das <tdas@codeaurora.org> Signed-off-by: Odelu Kukatla <okukatla@codeaurora.org>
This commit is contained in:
parent
eade63525a
commit
1920eabf61
1 changed files with 4 additions and 32 deletions
|
|
@ -73,8 +73,6 @@ enum gdscr_status {
|
|||
DISABLED,
|
||||
};
|
||||
|
||||
static DEFINE_MUTEX(gdsc_seq_lock);
|
||||
|
||||
static inline u32 gdsc_mb(struct gdsc *gds)
|
||||
{
|
||||
u32 reg;
|
||||
|
|
@ -184,15 +182,11 @@ static int gdsc_enable(struct regulator_dev *rdev)
|
|||
uint32_t regval, hw_ctrl_regval = 0x0;
|
||||
int i, ret = 0;
|
||||
|
||||
mutex_lock(&gdsc_seq_lock);
|
||||
|
||||
if (sc->parent_regulator) {
|
||||
ret = regulator_set_voltage(sc->parent_regulator,
|
||||
RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX);
|
||||
if (ret) {
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (sc->root_en || sc->force_root_en)
|
||||
|
|
@ -331,8 +325,6 @@ end:
|
|||
if (sc->parent_regulator)
|
||||
regulator_set_voltage(sc->parent_regulator, 0, INT_MAX);
|
||||
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -342,15 +334,11 @@ static int gdsc_disable(struct regulator_dev *rdev)
|
|||
uint32_t regval;
|
||||
int i, ret = 0;
|
||||
|
||||
mutex_lock(&gdsc_seq_lock);
|
||||
|
||||
if (sc->parent_regulator) {
|
||||
ret = regulator_set_voltage(sc->parent_regulator,
|
||||
RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX);
|
||||
if (ret) {
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (sc->force_root_en)
|
||||
|
|
@ -406,8 +394,6 @@ static int gdsc_disable(struct regulator_dev *rdev)
|
|||
|
||||
sc->is_gdsc_enabled = false;
|
||||
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -417,20 +403,15 @@ static unsigned int gdsc_get_mode(struct regulator_dev *rdev)
|
|||
uint32_t regval;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&gdsc_seq_lock);
|
||||
|
||||
if (sc->parent_regulator) {
|
||||
ret = regulator_set_voltage(sc->parent_regulator,
|
||||
RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX);
|
||||
if (ret) {
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regulator_enable(sc->parent_regulator);
|
||||
if (ret) {
|
||||
regulator_set_voltage(sc->parent_regulator, 0, INT_MAX);
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
@ -442,8 +423,6 @@ static unsigned int gdsc_get_mode(struct regulator_dev *rdev)
|
|||
regulator_set_voltage(sc->parent_regulator, 0, INT_MAX);
|
||||
}
|
||||
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
|
||||
if (regval & HW_CONTROL_MASK)
|
||||
return REGULATOR_MODE_FAST;
|
||||
|
||||
|
|
@ -456,20 +435,15 @@ static int gdsc_set_mode(struct regulator_dev *rdev, unsigned int mode)
|
|||
uint32_t regval;
|
||||
int ret = 0;
|
||||
|
||||
mutex_lock(&gdsc_seq_lock);
|
||||
|
||||
if (sc->parent_regulator) {
|
||||
ret = regulator_set_voltage(sc->parent_regulator,
|
||||
RPMH_REGULATOR_LEVEL_LOW_SVS, INT_MAX);
|
||||
if (ret) {
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = regulator_enable(sc->parent_regulator);
|
||||
if (ret) {
|
||||
regulator_set_voltage(sc->parent_regulator, 0, INT_MAX);
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
@ -516,8 +490,6 @@ static int gdsc_set_mode(struct regulator_dev *rdev, unsigned int mode)
|
|||
regulator_set_voltage(sc->parent_regulator, 0, INT_MAX);
|
||||
}
|
||||
|
||||
mutex_unlock(&gdsc_seq_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue