Skip to content

Commit bdab404

Browse files
Bao D. Nguyenmartinkpetersen
authored andcommitted
scsi: ufs: core: Rename ufshcd_wb_presrv_usrspc_keep_vcc_on()
The ufshcd_wb_presrv_usrspc_keep_vcc_on() function has deviated from its original implementation. The "_keep_vcc_on" part of the function name is misleading. Rename the function to ufshcd_wb_curr_buff_threshold_check() to improve the readability. Also, updated the comments in the function. There is no change to the functionality. Signed-off-by: Bao D. Nguyen <[email protected]> Link: https://lore.kernel.org/r/02ae5e133f6ebf23b54d943e6d1d9de2544eb80e.1743192926.git.quic_nguyenb@quicinc.com Reviewed-by: Avri Altman <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent a2d5a00 commit bdab404

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/ufs/core/ufshcd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6068,7 +6068,7 @@ int ufshcd_wb_toggle_buf_flush(struct ufs_hba *hba, bool enable)
60686068
return ret;
60696069
}
60706070

6071-
static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba,
6071+
static bool ufshcd_wb_curr_buff_threshold_check(struct ufs_hba *hba,
60726072
u32 avail_buf)
60736073
{
60746074
u32 cur_buf;
@@ -6150,15 +6150,13 @@ static bool ufshcd_wb_need_flush(struct ufs_hba *hba)
61506150
}
61516151

61526152
/*
6153-
* The ufs device needs the vcc to be ON to flush.
61546153
* With user-space reduction enabled, it's enough to enable flush
61556154
* by checking only the available buffer. The threshold
61566155
* defined here is > 90% full.
61576156
* With user-space preserved enabled, the current-buffer
61586157
* should be checked too because the wb buffer size can reduce
61596158
* when disk tends to be full. This info is provided by current
6160-
* buffer (dCurrentWriteBoosterBufferSize). There's no point in
6161-
* keeping vcc on when current buffer is empty.
6159+
* buffer (dCurrentWriteBoosterBufferSize).
61626160
*/
61636161
index = ufshcd_wb_get_query_index(hba);
61646162
ret = ufshcd_query_attr_retry(hba, UPIU_QUERY_OPCODE_READ_ATTR,
@@ -6173,7 +6171,7 @@ static bool ufshcd_wb_need_flush(struct ufs_hba *hba)
61736171
if (!hba->dev_info.b_presrv_uspc_en)
61746172
return avail_buf <= UFS_WB_BUF_REMAIN_PERCENT(10);
61756173

6176-
return ufshcd_wb_presrv_usrspc_keep_vcc_on(hba, avail_buf);
6174+
return ufshcd_wb_curr_buff_threshold_check(hba, avail_buf);
61776175
}
61786176

61796177
static void ufshcd_rpm_dev_flush_recheck_work(struct work_struct *work)

0 commit comments

Comments
 (0)