scsi: qla2xxx: Use shadow register for ISP27XX
authorQuinn Tran <quinn.tran@cavium.com>
Thu, 28 Dec 2017 20:33:18 +0000 (12:33 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Jan 2018 04:41:05 +0000 (23:41 -0500)
For ISP27XX, use shadow register to read FW provided REQQ's consumer
index. The shadow register is dma'ed by firmware.

Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_iocb.c

index 2d523b71cc1fd67b33b3135aeee2dc3eb0a52d08..d1dfa784d89540ea14b413a3795e79d0b51a7681 100644 (file)
@@ -2158,7 +2158,9 @@ __qla2x00_alloc_iocbs(struct qla_qpair *qpair, srb_t *sp)
 skip_cmd_array:
        /* Check for room on request queue. */
        if (req->cnt < req_cnt + 2) {
-               if (ha->mqenable || IS_QLA83XX(ha) || IS_QLA27XX(ha))
+               if (qpair->use_shadow_reg)
+                       cnt = *req->out_ptr;
+               else if (ha->mqenable || IS_QLA83XX(ha) || IS_QLA27XX(ha))
                        cnt = RD_REG_DWORD(&reg->isp25mq.req_q_out);
                else if (IS_P3P_TYPE(ha))
                        cnt = RD_REG_DWORD(&reg->isp82.req_q_out);