linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()
@ 2020-11-25 18:53 Bean Huo
  2020-11-26  1:08 ` Stanley Chu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bean Huo @ 2020-11-25 18:53 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
	stanley.chu, beanhuo, bvanassche, tomas.winkler, cang
  Cc: linux-scsi, linux-kernel

From: Bean Huo <beanhuo@micron.com>

In the case that auto_bkops_enable is false, which means auto bkops
has been disabled, so no need to call ufshcd_disable_auto_bkops().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufshcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 80cbce414678..d169db41ee16 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -8543,11 +8543,9 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	}
 
 	if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
-		if ((ufshcd_is_runtime_pm(pm_op) && !hba->auto_bkops_enabled) ||
-		    !ufshcd_is_runtime_pm(pm_op)) {
+		if (!ufshcd_is_runtime_pm(pm_op))
 			/* ensure that bkops is disabled */
 			ufshcd_disable_auto_bkops(hba);
-		}
 
 		if (!hba->dev_info.b_rpm_dev_flush_capable) {
 			ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode);
-- 
2.17.1


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

* Re: [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()
  2020-11-25 18:53 [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend() Bean Huo
@ 2020-11-26  1:08 ` Stanley Chu
  2020-11-26  2:07 ` Can Guo
  2020-12-01  4:44 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Stanley Chu @ 2020-11-26  1:08 UTC (permalink / raw)
  To: Bean Huo
  Cc: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
	beanhuo, bvanassche, tomas.winkler, cang, linux-scsi,
	linux-kernel

On Wed, 2020-11-25 at 19:53 +0100, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> In the case that auto_bkops_enable is false, which means auto bkops
> has been disabled, so no need to call ufshcd_disable_auto_bkops().
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>

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

* Re: [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()
  2020-11-25 18:53 [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend() Bean Huo
  2020-11-26  1:08 ` Stanley Chu
@ 2020-11-26  2:07 ` Can Guo
  2020-12-01  4:44 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Can Guo @ 2020-11-26  2:07 UTC (permalink / raw)
  To: Bean Huo
  Cc: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
	stanley.chu, beanhuo, bvanassche, tomas.winkler, linux-scsi,
	linux-kernel

On 2020-11-26 02:53, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> In the case that auto_bkops_enable is false, which means auto bkops
> has been disabled, so no need to call ufshcd_disable_auto_bkops().
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 80cbce414678..d169db41ee16 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8543,11 +8543,9 @@ static int ufshcd_suspend(struct ufs_hba *hba,
> enum ufs_pm_op pm_op)
>  	}
> 
>  	if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
> -		if ((ufshcd_is_runtime_pm(pm_op) && !hba->auto_bkops_enabled) ||
> -		    !ufshcd_is_runtime_pm(pm_op)) {
> +		if (!ufshcd_is_runtime_pm(pm_op))
>  			/* ensure that bkops is disabled */
>  			ufshcd_disable_auto_bkops(hba);
> -		}
> 
>  		if (!hba->dev_info.b_rpm_dev_flush_capable) {
>  			ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode);

Reviewed-by: Can Guo <cang@codeaurora.org>

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

* Re: [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()
  2020-11-25 18:53 [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend() Bean Huo
  2020-11-26  1:08 ` Stanley Chu
  2020-11-26  2:07 ` Can Guo
@ 2020-12-01  4:44 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-12-01  4:44 UTC (permalink / raw)
  To: Bean Huo
  Cc: alim.akhtar, avri.altman, asutoshd, jejb, martin.petersen,
	stanley.chu, beanhuo, bvanassche, tomas.winkler, cang,
	linux-scsi, linux-kernel


Bean,

> In the case that auto_bkops_enable is false, which means auto bkops
> has been disabled, so no need to call ufshcd_disable_auto_bkops().

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-12-01  4:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 18:53 [PATCH] scsi: ufs: Remove unnecessary if condition in ufshcd_suspend() Bean Huo
2020-11-26  1:08 ` Stanley Chu
2020-11-26  2:07 ` Can Guo
2020-12-01  4:44 ` Martin K. Petersen

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).