linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled
@ 2020-10-26 21:31 Asutosh Das
  2020-10-27  2:14 ` Stanley Chu
  0 siblings, 1 reply; 2+ messages in thread
From: Asutosh Das @ 2020-10-26 21:31 UTC (permalink / raw)
  To: cang, martin.petersen, linux-scsi
  Cc: Bao D. Nguyen, linux-arm-msm, Asutosh Das, Alim Akhtar,
	Avri Altman, James E.J. Bottomley, Stanley Chu, Bean Huo,
	Bart Van Assche, open list

From: "Bao D. Nguyen" <nguyenb@codeaurora.org>

When bkops is enabled, the UFS device may do bkops during suspend.
With bkops enabled during suspend, keep the regulators
in active operation configuration, allowing the device to draw
high power to support bkops and avoid over current event.

Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
---
 drivers/scsi/ufs/ufshcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 47c544d..a94543c 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8523,7 +8523,9 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	if (ret)
 		goto set_dev_active;
 
-	ufshcd_vreg_set_lpm(hba);
+	/* Device may perform bkops if autobkops is enabled */
+	if (!hba->auto_bkops_enabled)
+		ufshcd_vreg_set_lpm(hba);
 
 disable_clks:
 	/*
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled
  2020-10-26 21:31 [PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled Asutosh Das
@ 2020-10-27  2:14 ` Stanley Chu
  0 siblings, 0 replies; 2+ messages in thread
From: Stanley Chu @ 2020-10-27  2:14 UTC (permalink / raw)
  To: Asutosh Das
  Cc: cang, martin.petersen, linux-scsi, Bao D. Nguyen, linux-arm-msm,
	Alim Akhtar, Avri Altman, James E.J. Bottomley, Bean Huo,
	Bart Van Assche, open list

Hi,

On Mon, 2020-10-26 at 14:31 -0700, Asutosh Das wrote:
> From: "Bao D. Nguyen" <nguyenb@codeaurora.org>
> 
> When bkops is enabled, the UFS device may do bkops during suspend.
> With bkops enabled during suspend, keep the regulators
> in active operation configuration, allowing the device to draw
> high power to support bkops and avoid over current event.
> 
> Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
> ---
>  drivers/scsi/ufs/ufshcd.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 47c544d..a94543c 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8523,7 +8523,9 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>  	if (ret)
>  		goto set_dev_active;
>  
> -	ufshcd_vreg_set_lpm(hba);
> +	/* Device may perform bkops if autobkops is enabled */
> +	if (!hba->auto_bkops_enabled)
> +		ufshcd_vreg_set_lpm(hba);

If auto bkops is allowed and enabled during runtime suspend (currently
auto bkops is allow in runtime suspend only, and not allowed in system
suspend), hba->dev_info.b_rpm_dev_flush_capable would be true and keep
the current device power mode, say Active Power Mode. In this case,
regulator would not be set as lpm mode by ufshcd_vreg_set_lpm().

Please correct me if I was wrong.

Thanks,
Stanley Chu



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-27  2:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 21:31 [PATCH v1 1/1] scsi: ufs: Keep UFS regulators on when autobkops enabled Asutosh Das
2020-10-27  2:14 ` Stanley Chu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).