Message ID | 20201125185300.3394-1-huobean@gmail.com |
---|---|
State | New |
Headers | show |
Series | scsi: ufs: Remove unnecessary if condition in ufshcd_suspend() | expand |
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>
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>
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
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);