Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f324777e authored by Chad Dupuis's avatar Chad Dupuis Committed by James Bottomley
Browse files

[SCSI] qla2xxx: Fix multiqueue MSI-X registration.



This fixes requesting of the MSI-X vectors for the base response queue.
The iteration in the for loop in qla24xx_enable_msix() was incorrect.
We should only iterate of the first two MSI-X vectors and not the total
number of MSI-X vectors that have given to the driver for this device
from pci_enable_msix() in this function.

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 960dfc4e
Loading
Loading
Loading
Loading
+30 −16
Original line number Diff line number Diff line
@@ -2880,6 +2880,7 @@ static int
qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
{
#define MIN_MSIX_COUNT	2
#define ATIO_VECTOR	2
	int i, ret;
	struct msix_entry *entries;
	struct qla_msix_entry *qentry;
@@ -2936,21 +2937,38 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
	}

	/* Enable MSI-X vectors for the base queue */
	for (i = 0; i < ha->msix_count; i++) {
	for (i = 0; i < 2; i++) {
		qentry = &ha->msix_entries[i];
		if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) {
			ret = request_irq(qentry->vector,
				qla83xx_msix_entries[i].handler,
				0, qla83xx_msix_entries[i].name, rsp);
		} else if (IS_P3P_TYPE(ha)) {
		if (IS_P3P_TYPE(ha))
			ret = request_irq(qentry->vector,
				qla82xx_msix_entries[i].handler,
				0, qla82xx_msix_entries[i].name, rsp);
		} else {
		else
			ret = request_irq(qentry->vector,
				msix_entries[i].handler,
				0, msix_entries[i].name, rsp);
		if (ret)
			goto msix_register_fail;
		qentry->have_irq = 1;
		qentry->rsp = rsp;
		rsp->msix = qentry;
	}

	/*
	 * If target mode is enable, also request the vector for the ATIO
	 * queue.
	 */
	if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) {
		qentry = &ha->msix_entries[ATIO_VECTOR];
		ret = request_irq(qentry->vector,
			qla83xx_msix_entries[ATIO_VECTOR].handler,
			0, qla83xx_msix_entries[ATIO_VECTOR].name, rsp);
		qentry->have_irq = 1;
		qentry->rsp = rsp;
		rsp->msix = qentry;
	}

msix_register_fail:
	if (ret) {
		ql_log(ql_log_fatal, vha, 0x00cb,
		    "MSI-X: unable to register handler -- %x/%d.\n",
@@ -2959,10 +2977,6 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
		ha->mqenable = 0;
		goto msix_out;
	}
		qentry->have_irq = 1;
		qentry->rsp = rsp;
		rsp->msix = qentry;
	}

	/* Enable MSI-X vector for response queue update for queue 0 */
	if (IS_QLA83XX(ha)) {