Commit d94d8158 authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen
Browse files

scsi: qla2xxx: Add heartbeat check

Use "no-op" mailbox command to check if the adapter firmware is still
responsive.

Link: https://lore.kernel.org/r/20210619052427.6440-1-njavali@marvell.com


Reviewed-by: default avatarHimanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: default avatarQuinn Tran <qutran@marvell.com>
Signed-off-by: default avatarNilesh Javali <njavali@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c43ddbf9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -3660,6 +3660,8 @@ struct qla_qpair {
	struct qla_tgt_counters tgt_counters;
	uint16_t cpuid;
	struct qla_fw_resources fwres ____cacheline_aligned;
	u32	cmd_cnt;
	u32	cmd_completion_cnt;
};

/* Place holder for FW buffer parameters */
@@ -4616,6 +4618,7 @@ struct qla_hw_data {

	struct qla_hw_data_stat stat;
	pci_error_state_t pci_error_state;
	u64 prev_cmd_cnt;
};

struct active_regions {
@@ -4743,6 +4746,7 @@ typedef struct scsi_qla_host {
#define SET_ZIO_THRESHOLD_NEEDED 32
#define ISP_ABORT_TO_ROM	33
#define VPORT_DELETE		34
#define HEARTBEAT_CHK		38

#define PROCESS_PUREX_IOCB	63

+1 −0
Original line number Diff line number Diff line
@@ -549,6 +549,7 @@ extern int qla2xxx_read_remote_register(scsi_qla_host_t *, uint32_t,
    uint32_t *);
extern int qla2xxx_write_remote_register(scsi_qla_host_t *, uint32_t,
    uint32_t);
void qla_no_op_mb(struct scsi_qla_host *vha);

/*
 * Global Function Prototypes in qla_isr.c source file.
+5 −1
Original line number Diff line number Diff line
@@ -6870,10 +6870,14 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
	ha->flags.fw_init_done = 0;
	ha->chip_reset++;
	ha->base_qpair->chip_reset = ha->chip_reset;
	ha->base_qpair->cmd_cnt = ha->base_qpair->cmd_completion_cnt = 0;
	for (i = 0; i < ha->max_qpairs; i++) {
		if (ha->queue_pair_map[i])
		if (ha->queue_pair_map[i]) {
			ha->queue_pair_map[i]->chip_reset =
				ha->base_qpair->chip_reset;
			ha->queue_pair_map[i]->cmd_cnt =
			    ha->queue_pair_map[i]->cmd_completion_cnt = 0;
		}
	}

	/* purge MBox commands */
+4 −0
Original line number Diff line number Diff line
@@ -1710,6 +1710,7 @@ qla24xx_start_scsi(srb_t *sp)
	} else
		req->ring_ptr++;

	sp->qpair->cmd_cnt++;
	sp->flags |= SRB_DMA_VALID;

	/* Set chip new ring index. */
@@ -1912,6 +1913,7 @@ qla24xx_dif_start_scsi(srb_t *sp)
	} else
		req->ring_ptr++;

	sp->qpair->cmd_cnt++;
	/* Set chip new ring index. */
	wrt_reg_dword(req->req_q_in, req->ring_index);

@@ -2068,6 +2070,7 @@ qla2xxx_start_scsi_mq(srb_t *sp)
	} else
		req->ring_ptr++;

	sp->qpair->cmd_cnt++;
	sp->flags |= SRB_DMA_VALID;

	/* Set chip new ring index. */
@@ -2284,6 +2287,7 @@ qla2xxx_dif_start_scsi_mq(srb_t *sp)
	} else
		req->ring_ptr++;

	sp->qpair->cmd_cnt++;
	/* Set chip new ring index. */
	wrt_reg_dword(req->req_q_in, req->ring_index);

+4 −0
Original line number Diff line number Diff line
@@ -2322,6 +2322,8 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req,

	if (unlikely(iocb->u.nvme.aen_op))
		atomic_dec(&sp->vha->hw->nvme_active_aen_cnt);
	else
		sp->qpair->cmd_completion_cnt++;

	if (unlikely(comp_status != CS_COMPLETE))
		logit = 1;
@@ -2967,6 +2969,8 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
		return;
	}

	sp->qpair->cmd_completion_cnt++;

	/* Fast path completion. */
	if (comp_status == CS_COMPLETE && scsi_status == 0) {
		qla2x00_process_completed_request(vha, req, handle);
Loading