@@ -453,7 +453,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
453
453
454
454
intr = ufshcd_readl (hba , REG_INTERRUPT_STATUS );
455
455
456
- if (is_mcq_enabled ( hba ) ) {
456
+ if (hba -> mcq_enabled ) {
457
457
struct ufs_hw_queue * hwq = ufshcd_mcq_req_to_hwq (hba , rq );
458
458
459
459
hwq_id = hwq -> id ;
@@ -2301,7 +2301,7 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag,
2301
2301
if (unlikely (ufshcd_should_inform_monitor (hba , lrbp )))
2302
2302
ufshcd_start_monitor (hba , lrbp );
2303
2303
2304
- if (is_mcq_enabled ( hba ) ) {
2304
+ if (hba -> mcq_enabled ) {
2305
2305
int utrd_size = sizeof (struct utp_transfer_req_desc );
2306
2306
struct utp_transfer_req_desc * src = lrbp -> utr_descriptor_ptr ;
2307
2307
struct utp_transfer_req_desc * dest ;
@@ -3000,7 +3000,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
3000
3000
goto out ;
3001
3001
}
3002
3002
3003
- if (is_mcq_enabled ( hba ) )
3003
+ if (hba -> mcq_enabled )
3004
3004
hwq = ufshcd_mcq_req_to_hwq (hba , scsi_cmd_to_rq (cmd ));
3005
3005
3006
3006
ufshcd_send_command (hba , tag , hwq );
@@ -3059,7 +3059,7 @@ static int ufshcd_clear_cmd(struct ufs_hba *hba, u32 task_tag)
3059
3059
unsigned long flags ;
3060
3060
int err ;
3061
3061
3062
- if (is_mcq_enabled ( hba ) ) {
3062
+ if (hba -> mcq_enabled ) {
3063
3063
/*
3064
3064
* MCQ mode. Clean up the MCQ resources similar to
3065
3065
* what the ufshcd_utrl_clear() does for SDB mode.
@@ -3169,7 +3169,7 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
3169
3169
__func__ , lrbp -> task_tag );
3170
3170
3171
3171
/* MCQ mode */
3172
- if (is_mcq_enabled ( hba ) ) {
3172
+ if (hba -> mcq_enabled ) {
3173
3173
/* successfully cleared the command, retry if needed */
3174
3174
if (ufshcd_clear_cmd (hba , lrbp -> task_tag ) == 0 )
3175
3175
err = - EAGAIN ;
@@ -5560,7 +5560,7 @@ static int ufshcd_poll(struct Scsi_Host *shost, unsigned int queue_num)
5560
5560
u32 tr_doorbell ;
5561
5561
struct ufs_hw_queue * hwq ;
5562
5562
5563
- if (is_mcq_enabled ( hba ) ) {
5563
+ if (hba -> mcq_enabled ) {
5564
5564
hwq = & hba -> uhq [queue_num ];
5565
5565
5566
5566
return ufshcd_mcq_poll_cqe_lock (hba , hwq );
@@ -6201,7 +6201,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
6201
6201
/* Complete requests that have door-bell cleared */
6202
6202
static void ufshcd_complete_requests (struct ufs_hba * hba , bool force_compl )
6203
6203
{
6204
- if (is_mcq_enabled ( hba ) )
6204
+ if (hba -> mcq_enabled )
6205
6205
ufshcd_mcq_compl_pending_transfer (hba , force_compl );
6206
6206
else
6207
6207
ufshcd_transfer_req_compl (hba );
@@ -6458,7 +6458,7 @@ static bool ufshcd_abort_one(struct request *rq, void *priv)
6458
6458
* ret ? "failed" : "succeeded" );
6459
6459
6460
6460
/* Release cmd in MCQ mode if abort succeeds */
6461
- if (is_mcq_enabled ( hba ) && (* ret == 0 )) {
6461
+ if (hba -> mcq_enabled && (* ret == 0 )) {
6462
6462
hwq = ufshcd_mcq_req_to_hwq (hba , scsi_cmd_to_rq (lrbp -> cmd ));
6463
6463
spin_lock_irqsave (& hwq -> cq_lock , flags );
6464
6464
if (ufshcd_cmd_inflight (lrbp -> cmd ))
@@ -7389,7 +7389,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
7389
7389
goto out ;
7390
7390
}
7391
7391
7392
- if (is_mcq_enabled ( hba ) ) {
7392
+ if (hba -> mcq_enabled ) {
7393
7393
for (pos = 0 ; pos < hba -> nutrs ; pos ++ ) {
7394
7394
lrbp = & hba -> lrb [pos ];
7395
7395
if (ufshcd_cmd_inflight (lrbp -> cmd ) &&
@@ -7485,7 +7485,7 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
7485
7485
*/
7486
7486
dev_err (hba -> dev , "%s: cmd at tag %d not pending in the device.\n" ,
7487
7487
__func__ , tag );
7488
- if (is_mcq_enabled ( hba ) ) {
7488
+ if (hba -> mcq_enabled ) {
7489
7489
/* MCQ mode */
7490
7490
if (ufshcd_cmd_inflight (lrbp -> cmd )) {
7491
7491
/* sleep for max. 200us same delay as in SDB mode */
@@ -7563,7 +7563,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
7563
7563
7564
7564
ufshcd_hold (hba );
7565
7565
7566
- if (!is_mcq_enabled ( hba ) ) {
7566
+ if (!hba -> mcq_enabled ) {
7567
7567
reg = ufshcd_readl (hba , REG_UTP_TRANSFER_REQ_DOOR_BELL );
7568
7568
if (!test_bit (tag , & hba -> outstanding_reqs )) {
7569
7569
/* If command is already aborted/completed, return FAILED. */
@@ -7596,7 +7596,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
7596
7596
}
7597
7597
hba -> req_abort_count ++ ;
7598
7598
7599
- if (!is_mcq_enabled ( hba ) && !(reg & (1 << tag ))) {
7599
+ if (!hba -> mcq_enabled && !(reg & (1 << tag ))) {
7600
7600
/* only execute this code in single doorbell mode */
7601
7601
dev_err (hba -> dev ,
7602
7602
"%s: cmd was completed, but without a notifying intr, tag = %d" ,
@@ -7623,7 +7623,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
7623
7623
goto release ;
7624
7624
}
7625
7625
7626
- if (is_mcq_enabled ( hba ) ) {
7626
+ if (hba -> mcq_enabled ) {
7627
7627
/* MCQ mode. Branch off to handle abort for mcq mode */
7628
7628
err = ufshcd_mcq_abort (cmd );
7629
7629
goto release ;
@@ -8732,7 +8732,7 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
8732
8732
ufshcd_set_link_active (hba );
8733
8733
8734
8734
/* Reconfigure MCQ upon reset */
8735
- if (is_mcq_enabled ( hba ) && !init_dev_params )
8735
+ if (hba -> mcq_enabled && !init_dev_params )
8736
8736
ufshcd_config_mcq (hba );
8737
8737
8738
8738
/* Verify device initialization by sending NOP OUT UPIU */
0 commit comments