@@ -5870,24 +5870,23 @@ static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status)
58705870/**
58715871 * ufshcd_bkops_ctrl - control the auto bkops based on current bkops status
58725872 * @hba: per-adapter instance
5873- * @status: bkops_status value
58745873 *
58755874 * Read the bkops_status from the UFS device and Enable fBackgroundOpsEn
58765875 * 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.
58795878 *
58805879 * Return: 0 for success, non-zero in case of failure.
58815880 *
58825881 * NOTE: Caller of this function can check the "hba->auto_bkops_enabled" flag
58835882 * to know whether auto bkops is enabled or disabled after this function
58845883 * returns control to it.
58855884 */
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 )
58885886{
5889- int err ;
5887+ enum bkops_status status = hba -> urgent_bkops_lvl ;
58905888 u32 curr_status = 0 ;
5889+ int err ;
58915890
58925891 err = ufshcd_get_bkops_status (hba , & curr_status );
58935892 if (err ) {
@@ -5909,23 +5908,6 @@ static int ufshcd_bkops_ctrl(struct ufs_hba *hba,
59095908 return err ;
59105909}
59115910
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-
59295911static inline int ufshcd_get_ee_status (struct ufs_hba * hba , u32 * status )
59305912{
59315913 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)
96829664 * allow background operations if bkops status shows
96839665 * that performance might be impacted.
96849666 */
9685- ret = ufshcd_urgent_bkops (hba );
9667+ ret = ufshcd_bkops_ctrl (hba );
96869668 if (ret ) {
96879669 /*
96889670 * 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)
98719853 * If BKOPs operations are urgently needed at this moment then
98729854 * keep auto-bkops enabled or else disable it.
98739855 */
9874- ufshcd_urgent_bkops (hba );
9856+ ufshcd_bkops_ctrl (hba );
98759857
98769858 if (hba -> ee_usr_mask )
98779859 ufshcd_write_ee_control (hba );
0 commit comments