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

[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
...@@ -2880,6 +2880,7 @@ static int ...@@ -2880,6 +2880,7 @@ static int
qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
{ {
#define MIN_MSIX_COUNT 2 #define MIN_MSIX_COUNT 2
#define ATIO_VECTOR 2
int i, ret; int i, ret;
struct msix_entry *entries; struct msix_entry *entries;
struct qla_msix_entry *qentry; struct qla_msix_entry *qentry;
...@@ -2936,34 +2937,47 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) ...@@ -2936,34 +2937,47 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
} }
/* Enable MSI-X vectors for the base queue */ /* 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]; qentry = &ha->msix_entries[i];
if (QLA_TGT_MODE_ENABLED() && IS_ATIO_MSIX_CAPABLE(ha)) { if (IS_P3P_TYPE(ha))
ret = request_irq(qentry->vector,
qla83xx_msix_entries[i].handler,
0, qla83xx_msix_entries[i].name, rsp);
} else if (IS_P3P_TYPE(ha)) {
ret = request_irq(qentry->vector, ret = request_irq(qentry->vector,
qla82xx_msix_entries[i].handler, qla82xx_msix_entries[i].handler,
0, qla82xx_msix_entries[i].name, rsp); 0, qla82xx_msix_entries[i].name, rsp);
} else { else
ret = request_irq(qentry->vector, ret = request_irq(qentry->vector,
msix_entries[i].handler, msix_entries[i].handler,
0, msix_entries[i].name, rsp); 0, msix_entries[i].name, rsp);
} if (ret)
if (ret) { goto msix_register_fail;
ql_log(ql_log_fatal, vha, 0x00cb,
"MSI-X: unable to register handler -- %x/%d.\n",
qentry->vector, ret);
qla24xx_disable_msix(ha);
ha->mqenable = 0;
goto msix_out;
}
qentry->have_irq = 1; qentry->have_irq = 1;
qentry->rsp = rsp; qentry->rsp = rsp;
rsp->msix = qentry; 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",
qentry->vector, ret);
qla24xx_disable_msix(ha);
ha->mqenable = 0;
goto msix_out;
}
/* Enable MSI-X vector for response queue update for queue 0 */ /* Enable MSI-X vector for response queue update for queue 0 */
if (IS_QLA83XX(ha)) { if (IS_QLA83XX(ha)) {
if (ha->msixbase && ha->mqiobase && if (ha->msixbase && ha->mqiobase &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment