Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[platform/kernel/linux-starfive.git] / drivers / scsi / qla2xxx / qla_iocb.c
index c71863f..024c662 100644 (file)
@@ -308,7 +308,7 @@ qla2x00_start_scsi(srb_t *sp)
                handle++;
                if (handle == MAX_OUTSTANDING_COMMANDS)
                        handle = 1;
-               if (ha->outstanding_cmds[handle] == 0)
+               if (!ha->outstanding_cmds[handle])
                        break;
        }
        if (index == MAX_OUTSTANDING_COMMANDS)
@@ -326,7 +326,7 @@ qla2x00_start_scsi(srb_t *sp)
        tot_dsds = nseg;
 
        /* Calculate the number of request entries needed. */
-       req_cnt = ha->isp_ops.calc_req_entries(tot_dsds);
+       req_cnt = ha->isp_ops->calc_req_entries(tot_dsds);
        if (ha->req_q_cnt < (req_cnt + 2)) {
                cnt = RD_REG_WORD_RELAXED(ISP_REQ_Q_OUT(ha, reg));
                if (ha->req_ring_index < cnt)
@@ -364,7 +364,7 @@ qla2x00_start_scsi(srb_t *sp)
        cmd_pkt->byte_count = cpu_to_le32((uint32_t)scsi_bufflen(cmd));
 
        /* Build IOCB segments */
-       ha->isp_ops.build_iocbs(sp, cmd_pkt, tot_dsds);
+       ha->isp_ops->build_iocbs(sp, cmd_pkt, tot_dsds);
 
        /* Set total data segment count. */
        cmd_pkt->entry_count = (uint8_t)req_cnt;
@@ -432,7 +432,7 @@ __qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
        mrk->entry_type = MARKER_TYPE;
        mrk->modifier = type;
        if (type != MK_SYNC_ALL) {
-               if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+               if (IS_FWI2_CAPABLE(ha)) {
                        mrk24 = (struct mrk_entry_24xx *) mrk;
                        mrk24->nport_handle = cpu_to_le16(loop_id);
                        mrk24->lun[1] = LSB(lun);
@@ -487,7 +487,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha)
        for (timer = HZ; timer; timer--) {
                if ((req_cnt + 2) >= ha->req_q_cnt) {
                        /* Calculate number of free request entries. */
-                       if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
+                       if (IS_FWI2_CAPABLE(ha))
                                cnt = (uint16_t)RD_REG_DWORD(
                                    &reg->isp24.req_q_out);
                        else
@@ -525,7 +525,7 @@ qla2x00_req_pkt(scsi_qla_host_t *ha)
 
                /* Check for pending interrupts. */
                /* During init we issue marker directly */
-               if (!ha->marker_needed)
+               if (!ha->marker_needed && !ha->flags.init_done)
                        qla2x00_poll(ha);
 
                spin_lock_irq(&ha->hardware_lock);
@@ -561,7 +561,7 @@ qla2x00_isp_cmd(scsi_qla_host_t *ha)
                ha->request_ring_ptr++;
 
        /* Set chip new ring index. */
-       if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) {
+       if (IS_FWI2_CAPABLE(ha)) {
                WRT_REG_DWORD(&reg->isp24.req_q_in, ha->req_ring_index);
                RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in);
        } else {
@@ -711,7 +711,7 @@ qla24xx_start_scsi(srb_t *sp)
                handle++;
                if (handle == MAX_OUTSTANDING_COMMANDS)
                        handle = 1;
-               if (ha->outstanding_cmds[handle] == 0)
+               if (!ha->outstanding_cmds[handle])
                        break;
        }
        if (index == MAX_OUTSTANDING_COMMANDS)