@@ -453,7 +453,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
453453
454454 intr = ufshcd_readl (hba , REG_INTERRUPT_STATUS );
455455
456- if (is_mcq_enabled ( hba ) ) {
456+ if (hba -> mcq_enabled ) {
457457 struct ufs_hw_queue * hwq = ufshcd_mcq_req_to_hwq (hba , rq );
458458
459459 hwq_id = hwq -> id ;
@@ -2301,7 +2301,7 @@ void ufshcd_send_command(struct ufs_hba *hba, unsigned int task_tag,
23012301 if (unlikely (ufshcd_should_inform_monitor (hba , lrbp )))
23022302 ufshcd_start_monitor (hba , lrbp );
23032303
2304- if (is_mcq_enabled ( hba ) ) {
2304+ if (hba -> mcq_enabled ) {
23052305 int utrd_size = sizeof (struct utp_transfer_req_desc );
23062306 struct utp_transfer_req_desc * src = lrbp -> utr_descriptor_ptr ;
23072307 struct utp_transfer_req_desc * dest ;
@@ -3000,7 +3000,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
30003000 goto out ;
30013001 }
30023002
3003- if (is_mcq_enabled ( hba ) )
3003+ if (hba -> mcq_enabled )
30043004 hwq = ufshcd_mcq_req_to_hwq (hba , scsi_cmd_to_rq (cmd ));
30053005
30063006 ufshcd_send_command (hba , tag , hwq );
@@ -3059,7 +3059,7 @@ static int ufshcd_clear_cmd(struct ufs_hba *hba, u32 task_tag)
30593059 unsigned long flags ;
30603060 int err ;
30613061
3062- if (is_mcq_enabled ( hba ) ) {
3062+ if (hba -> mcq_enabled ) {
30633063 /*
30643064 * MCQ mode. Clean up the MCQ resources similar to
30653065 * what the ufshcd_utrl_clear() does for SDB mode.
@@ -3169,7 +3169,7 @@ static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
31693169 __func__ , lrbp -> task_tag );
31703170
31713171 /* MCQ mode */
3172- if (is_mcq_enabled ( hba ) ) {
3172+ if (hba -> mcq_enabled ) {
31733173 /* successfully cleared the command, retry if needed */
31743174 if (ufshcd_clear_cmd (hba , lrbp -> task_tag ) == 0 )
31753175 err = - EAGAIN ;
@@ -5560,7 +5560,7 @@ static int ufshcd_poll(struct Scsi_Host *shost, unsigned int queue_num)
55605560 u32 tr_doorbell ;
55615561 struct ufs_hw_queue * hwq ;
55625562
5563- if (is_mcq_enabled ( hba ) ) {
5563+ if (hba -> mcq_enabled ) {
55645564 hwq = & hba -> uhq [queue_num ];
55655565
55665566 return ufshcd_mcq_poll_cqe_lock (hba , hwq );
@@ -6201,7 +6201,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work)
62016201/* Complete requests that have door-bell cleared */
62026202static void ufshcd_complete_requests (struct ufs_hba * hba , bool force_compl )
62036203{
6204- if (is_mcq_enabled ( hba ) )
6204+ if (hba -> mcq_enabled )
62056205 ufshcd_mcq_compl_pending_transfer (hba , force_compl );
62066206 else
62076207 ufshcd_transfer_req_compl (hba );
@@ -6458,7 +6458,7 @@ static bool ufshcd_abort_one(struct request *rq, void *priv)
64586458 * ret ? "failed" : "succeeded" );
64596459
64606460 /* Release cmd in MCQ mode if abort succeeds */
6461- if (is_mcq_enabled ( hba ) && (* ret == 0 )) {
6461+ if (hba -> mcq_enabled && (* ret == 0 )) {
64626462 hwq = ufshcd_mcq_req_to_hwq (hba , scsi_cmd_to_rq (lrbp -> cmd ));
64636463 spin_lock_irqsave (& hwq -> cq_lock , flags );
64646464 if (ufshcd_cmd_inflight (lrbp -> cmd ))
@@ -7389,7 +7389,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
73897389 goto out ;
73907390 }
73917391
7392- if (is_mcq_enabled ( hba ) ) {
7392+ if (hba -> mcq_enabled ) {
73937393 for (pos = 0 ; pos < hba -> nutrs ; pos ++ ) {
73947394 lrbp = & hba -> lrb [pos ];
73957395 if (ufshcd_cmd_inflight (lrbp -> cmd ) &&
@@ -7485,7 +7485,7 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
74857485 */
74867486 dev_err (hba -> dev , "%s: cmd at tag %d not pending in the device.\n" ,
74877487 __func__ , tag );
7488- if (is_mcq_enabled ( hba ) ) {
7488+ if (hba -> mcq_enabled ) {
74897489 /* MCQ mode */
74907490 if (ufshcd_cmd_inflight (lrbp -> cmd )) {
74917491 /* sleep for max. 200us same delay as in SDB mode */
@@ -7563,7 +7563,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
75637563
75647564 ufshcd_hold (hba );
75657565
7566- if (!is_mcq_enabled ( hba ) ) {
7566+ if (!hba -> mcq_enabled ) {
75677567 reg = ufshcd_readl (hba , REG_UTP_TRANSFER_REQ_DOOR_BELL );
75687568 if (!test_bit (tag , & hba -> outstanding_reqs )) {
75697569 /* If command is already aborted/completed, return FAILED. */
@@ -7596,7 +7596,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
75967596 }
75977597 hba -> req_abort_count ++ ;
75987598
7599- if (!is_mcq_enabled ( hba ) && !(reg & (1 << tag ))) {
7599+ if (!hba -> mcq_enabled && !(reg & (1 << tag ))) {
76007600 /* only execute this code in single doorbell mode */
76017601 dev_err (hba -> dev ,
76027602 "%s: cmd was completed, but without a notifying intr, tag = %d" ,
@@ -7623,7 +7623,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
76237623 goto release ;
76247624 }
76257625
7626- if (is_mcq_enabled ( hba ) ) {
7626+ if (hba -> mcq_enabled ) {
76277627 /* MCQ mode. Branch off to handle abort for mcq mode */
76287628 err = ufshcd_mcq_abort (cmd );
76297629 goto release ;
@@ -8732,7 +8732,7 @@ static int ufshcd_device_init(struct ufs_hba *hba, bool init_dev_params)
87328732 ufshcd_set_link_active (hba );
87338733
87348734 /* Reconfigure MCQ upon reset */
8735- if (is_mcq_enabled ( hba ) && !init_dev_params )
8735+ if (hba -> mcq_enabled && !init_dev_params )
87368736 ufshcd_config_mcq (hba );
87378737
87388738 /* Verify device initialization by sending NOP OUT UPIU */
0 commit comments