@@ -5199,7 +5199,7 @@ static int ufshcd_wb_ctrl(struct ufs_hba *hba, bool enable)
5199
5199
else
5200
5200
opcode = UPIU_QUERY_OPCODE_CLEAR_FLAG ;
5201
5201
5202
- index = ufshcd_wb_get_flag_index (hba );
5202
+ index = ufshcd_wb_get_query_index (hba );
5203
5203
ret = ufshcd_query_flag_retry (hba , opcode ,
5204
5204
QUERY_FLAG_IDN_WB_EN , index , NULL );
5205
5205
if (ret ) {
@@ -5225,7 +5225,7 @@ static int ufshcd_wb_toggle_flush_during_h8(struct ufs_hba *hba, bool set)
5225
5225
else
5226
5226
val = UPIU_QUERY_OPCODE_CLEAR_FLAG ;
5227
5227
5228
- index = ufshcd_wb_get_flag_index (hba );
5228
+ index = ufshcd_wb_get_query_index (hba );
5229
5229
return ufshcd_query_flag_retry (hba , val ,
5230
5230
QUERY_FLAG_IDN_WB_BUFF_FLUSH_DURING_HIBERN8 ,
5231
5231
index , NULL );
@@ -5248,7 +5248,7 @@ static int ufshcd_wb_buf_flush_enable(struct ufs_hba *hba)
5248
5248
if (!ufshcd_is_wb_allowed (hba ) || hba -> wb_buf_flush_enabled )
5249
5249
return 0 ;
5250
5250
5251
- index = ufshcd_wb_get_flag_index (hba );
5251
+ index = ufshcd_wb_get_query_index (hba );
5252
5252
ret = ufshcd_query_flag_retry (hba , UPIU_QUERY_OPCODE_SET_FLAG ,
5253
5253
QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN ,
5254
5254
index , NULL );
@@ -5270,7 +5270,7 @@ static int ufshcd_wb_buf_flush_disable(struct ufs_hba *hba)
5270
5270
if (!ufshcd_is_wb_allowed (hba ) || !hba -> wb_buf_flush_enabled )
5271
5271
return 0 ;
5272
5272
5273
- index = ufshcd_wb_get_flag_index (hba );
5273
+ index = ufshcd_wb_get_query_index (hba );
5274
5274
ret = ufshcd_query_flag_retry (hba , UPIU_QUERY_OPCODE_CLEAR_FLAG ,
5275
5275
QUERY_FLAG_IDN_WB_BUFF_FLUSH_EN ,
5276
5276
index , NULL );
@@ -5290,10 +5290,12 @@ static bool ufshcd_wb_presrv_usrspc_keep_vcc_on(struct ufs_hba *hba,
5290
5290
{
5291
5291
u32 cur_buf ;
5292
5292
int ret ;
5293
+ u8 index ;
5293
5294
5295
+ index = ufshcd_wb_get_query_index (hba );
5294
5296
ret = ufshcd_query_attr_retry (hba , UPIU_QUERY_OPCODE_READ_ATTR ,
5295
5297
QUERY_ATTR_IDN_CURR_WB_BUFF_SIZE ,
5296
- 0 , 0 , & cur_buf );
5298
+ index , 0 , & cur_buf );
5297
5299
if (ret ) {
5298
5300
dev_err (hba -> dev , "%s dCurWriteBoosterBufferSize read failed %d\n" ,
5299
5301
__func__ , ret );
@@ -5316,6 +5318,7 @@ static bool ufshcd_wb_keep_vcc_on(struct ufs_hba *hba)
5316
5318
{
5317
5319
int ret ;
5318
5320
u32 avail_buf ;
5321
+ u8 index ;
5319
5322
5320
5323
if (!ufshcd_is_wb_allowed (hba ))
5321
5324
return false;
@@ -5330,9 +5333,10 @@ static bool ufshcd_wb_keep_vcc_on(struct ufs_hba *hba)
5330
5333
* buffer (dCurrentWriteBoosterBufferSize). There's no point in
5331
5334
* keeping vcc on when current buffer is empty.
5332
5335
*/
5336
+ index = ufshcd_wb_get_query_index (hba );
5333
5337
ret = ufshcd_query_attr_retry (hba , UPIU_QUERY_OPCODE_READ_ATTR ,
5334
5338
QUERY_ATTR_IDN_AVAIL_WB_BUFF_SIZE ,
5335
- 0 , 0 , & avail_buf );
5339
+ index , 0 , & avail_buf );
5336
5340
if (ret ) {
5337
5341
dev_warn (hba -> dev , "%s dAvailableWriteBoosterBufferSize read failed %d\n" ,
5338
5342
__func__ , ret );
0 commit comments