@@ -5870,24 +5870,23 @@ static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status)
5870
5870
/**
5871
5871
* ufshcd_bkops_ctrl - control the auto bkops based on current bkops status
5872
5872
* @hba: per-adapter instance
5873
- * @status: bkops_status value
5874
5873
*
5875
5874
* Read the bkops_status from the UFS device and Enable fBackgroundOpsEn
5876
5875
* flag in the device to permit background operations if the device
5877
- * bkops_status is greater than or equal to "status" argument passed to
5878
- * this function, disable otherwise.
5876
+ * bkops_status is greater than or equal to the "hba->urgent_bkops_lvl",
5877
+ * disable otherwise.
5879
5878
*
5880
5879
* Return: 0 for success, non-zero in case of failure.
5881
5880
*
5882
5881
* NOTE: Caller of this function can check the "hba->auto_bkops_enabled" flag
5883
5882
* to know whether auto bkops is enabled or disabled after this function
5884
5883
* returns control to it.
5885
5884
*/
5886
- static int ufshcd_bkops_ctrl (struct ufs_hba * hba ,
5887
- enum bkops_status status )
5885
+ static int ufshcd_bkops_ctrl (struct ufs_hba * hba )
5888
5886
{
5889
- int err ;
5887
+ enum bkops_status status = hba -> urgent_bkops_lvl ;
5890
5888
u32 curr_status = 0 ;
5889
+ int err ;
5891
5890
5892
5891
err = ufshcd_get_bkops_status (hba , & curr_status );
5893
5892
if (err ) {
@@ -5909,23 +5908,6 @@ static int ufshcd_bkops_ctrl(struct ufs_hba *hba,
5909
5908
return err ;
5910
5909
}
5911
5910
5912
- /**
5913
- * ufshcd_urgent_bkops - handle urgent bkops exception event
5914
- * @hba: per-adapter instance
5915
- *
5916
- * Enable fBackgroundOpsEn flag in the device to permit background
5917
- * operations.
5918
- *
5919
- * If BKOPs is enabled, this function returns 0, 1 if the bkops in not enabled
5920
- * and negative error value for any other failure.
5921
- *
5922
- * Return: 0 upon success; < 0 upon failure.
5923
- */
5924
- static int ufshcd_urgent_bkops (struct ufs_hba * hba )
5925
- {
5926
- return ufshcd_bkops_ctrl (hba , hba -> urgent_bkops_lvl );
5927
- }
5928
-
5929
5911
static inline int ufshcd_get_ee_status (struct ufs_hba * hba , u32 * status )
5930
5912
{
5931
5913
return ufshcd_query_attr_retry (hba , UPIU_QUERY_OPCODE_READ_ATTR ,
@@ -9682,7 +9664,7 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
9682
9664
* allow background operations if bkops status shows
9683
9665
* that performance might be impacted.
9684
9666
*/
9685
- ret = ufshcd_urgent_bkops (hba );
9667
+ ret = ufshcd_bkops_ctrl (hba );
9686
9668
if (ret ) {
9687
9669
/*
9688
9670
* If return err in suspend flow, IO will hang.
@@ -9871,7 +9853,7 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
9871
9853
* If BKOPs operations are urgently needed at this moment then
9872
9854
* keep auto-bkops enabled or else disable it.
9873
9855
*/
9874
- ufshcd_urgent_bkops (hba );
9856
+ ufshcd_bkops_ctrl (hba );
9875
9857
9876
9858
if (hba -> ee_usr_mask )
9877
9859
ufshcd_write_ee_control (hba );
0 commit comments