diff options
author | Asutosh Das <asutoshd@codeaurora.org> | 2020-02-11 06:40:45 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-02-13 03:42:35 +0300 |
commit | 90d88f47e8d03b263f26345639da97de00c3b783 (patch) | |
tree | 5537e8132bfb80b12a8e6bc0b750d0d60116d089 /drivers/scsi | |
parent | 2824ec9f9e8116670e383a9db8df301d10507ca9 (diff) | |
download | linux-90d88f47e8d03b263f26345639da97de00c3b783.tar.xz |
scsi: ufs: set load before setting voltage in regulators
This sequence change is required to avoid dips in voltage during boot-up.
Apparently, this dip is caused because in the original sequence, the
regulators are initialized in lpm mode. And then when the load is set to
high, and more current is drawn, than is allowed in lpm, the dip is seen.
Link: https://lore.kernel.org/r/1581392451-28743-3-git-send-email-cang@codeaurora.org
Reviewed-by: Hongwu Su <hongwus@codeaurora.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index bae0a406ab7c..9c39fae99b61 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -7249,6 +7249,11 @@ static int ufshcd_config_vreg(struct device *dev, name = vreg->name; if (regulator_count_voltages(reg) > 0) { + uA_load = on ? vreg->max_uA : 0; + ret = ufshcd_config_vreg_load(dev, vreg, uA_load); + if (ret) + goto out; + if (vreg->min_uV && vreg->max_uV) { min_uV = on ? vreg->min_uV : 0; ret = regulator_set_voltage(reg, min_uV, vreg->max_uV); @@ -7259,11 +7264,6 @@ static int ufshcd_config_vreg(struct device *dev, goto out; } } - - uA_load = on ? vreg->max_uA : 0; - ret = ufshcd_config_vreg_load(dev, vreg, uA_load); - if (ret) - goto out; } out: return ret; |