Skip to contentSkip to conversation

scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()

PATCH Applied Bean Huo 4 participants 4 messages Nov 25, 2020 – Dec 1, 2020 SCSI

lore
Share & tools
lore

Bean Huo

author
#0 lore raw

PATCH 1/1 scsi: ufs: Remove unnecessary if condition in ufshcd_suspend()

From: Bean Huo <[email protected]>

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

---
 drivers/scsi/ufs/ufshcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -3
index 80cbce414678..d169db41ee16 100644
@@ -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);
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Bean Huo
Quoted 27 lines · Bean Huo

From: Bean Huo <[email protected]>

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

---
 drivers/scsi/ufs/ufshcd.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -3
index 80cbce414678..d169db41ee16 100644
@@ -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) {
Quoted 1 line

ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode);

#3 lore raw
In reply to Bean Huo

Bean,

Quoted 2 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering