diff options
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 58 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 7 |
3 files changed, 40 insertions, 26 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2d4f32b4df5c..9ad4d0968e5c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1258,35 +1258,48 @@ qla2x00_init_rings(scsi_qla_host_t *vha) | |||
1258 | { | 1258 | { |
1259 | int rval; | 1259 | int rval; |
1260 | unsigned long flags = 0; | 1260 | unsigned long flags = 0; |
1261 | int cnt; | 1261 | int cnt, que; |
1262 | struct qla_hw_data *ha = vha->hw; | 1262 | struct qla_hw_data *ha = vha->hw; |
1263 | struct req_que *req = ha->req_q_map[0]; | 1263 | struct req_que *req; |
1264 | struct rsp_que *rsp = ha->rsp_q_map[0]; | 1264 | struct rsp_que *rsp; |
1265 | struct scsi_qla_host *vp; | ||
1265 | struct mid_init_cb_24xx *mid_init_cb = | 1266 | struct mid_init_cb_24xx *mid_init_cb = |
1266 | (struct mid_init_cb_24xx *) ha->init_cb; | 1267 | (struct mid_init_cb_24xx *) ha->init_cb; |
1267 | 1268 | ||
1268 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1269 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1269 | 1270 | ||
1270 | /* Clear outstanding commands array. */ | 1271 | /* Clear outstanding commands array. */ |
1271 | for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) | 1272 | for (que = 0; que < ha->max_queues; que++) { |
1272 | req->outstanding_cmds[cnt] = NULL; | 1273 | req = ha->req_q_map[que]; |
1274 | if (!req) | ||
1275 | continue; | ||
1276 | for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) | ||
1277 | req->outstanding_cmds[cnt] = NULL; | ||
1273 | 1278 | ||
1274 | req->current_outstanding_cmd = 0; | 1279 | req->current_outstanding_cmd = 0; |
1275 | 1280 | ||
1276 | /* Clear RSCN queue. */ | 1281 | /* Initialize firmware. */ |
1277 | vha->rscn_in_ptr = 0; | 1282 | req->ring_ptr = req->ring; |
1278 | vha->rscn_out_ptr = 0; | 1283 | req->ring_index = 0; |
1284 | req->cnt = req->length; | ||
1285 | } | ||
1279 | 1286 | ||
1280 | /* Initialize firmware. */ | 1287 | for (que = 0; que < ha->max_queues; que++) { |
1281 | req->ring_ptr = req->ring; | 1288 | rsp = ha->rsp_q_map[que]; |
1282 | req->ring_index = 0; | 1289 | if (!rsp) |
1283 | req->cnt = req->length; | 1290 | continue; |
1284 | rsp->ring_ptr = rsp->ring; | 1291 | rsp->ring_ptr = rsp->ring; |
1285 | rsp->ring_index = 0; | 1292 | rsp->ring_index = 0; |
1286 | 1293 | ||
1287 | /* Initialize response queue entries */ | 1294 | /* Initialize response queue entries */ |
1288 | qla2x00_init_response_q_entries(rsp); | 1295 | qla2x00_init_response_q_entries(rsp); |
1296 | } | ||
1289 | 1297 | ||
1298 | /* Clear RSCN queue. */ | ||
1299 | list_for_each_entry(vp, &ha->vp_list, list) { | ||
1300 | vp->rscn_in_ptr = 0; | ||
1301 | vp->rscn_out_ptr = 0; | ||
1302 | } | ||
1290 | ha->isp_ops->config_rings(vha); | 1303 | ha->isp_ops->config_rings(vha); |
1291 | 1304 | ||
1292 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1305 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
@@ -3212,8 +3225,8 @@ qla2x00_loop_resync(scsi_qla_host_t *vha) | |||
3212 | int rval = QLA_SUCCESS; | 3225 | int rval = QLA_SUCCESS; |
3213 | uint32_t wait_time; | 3226 | uint32_t wait_time; |
3214 | struct qla_hw_data *ha = vha->hw; | 3227 | struct qla_hw_data *ha = vha->hw; |
3215 | struct req_que *req = ha->req_q_map[0]; | 3228 | struct req_que *req = ha->req_q_map[vha->req_ques[0]]; |
3216 | struct rsp_que *rsp = ha->rsp_q_map[0]; | 3229 | struct rsp_que *rsp = req->rsp; |
3217 | 3230 | ||
3218 | atomic_set(&vha->loop_state, LOOP_UPDATE); | 3231 | atomic_set(&vha->loop_state, LOOP_UPDATE); |
3219 | clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); | 3232 | clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); |
@@ -3492,6 +3505,7 @@ qla25xx_init_queues(struct qla_hw_data *ha) | |||
3492 | } | 3505 | } |
3493 | req = ha->req_q_map[i]; | 3506 | req = ha->req_q_map[i]; |
3494 | if (req) { | 3507 | if (req) { |
3508 | /* Clear outstanding commands array. */ | ||
3495 | req->options &= ~BIT_0; | 3509 | req->options &= ~BIT_0; |
3496 | ret = qla25xx_init_req_que(base_vha, req, req->options); | 3510 | ret = qla25xx_init_req_que(base_vha, req, req->options); |
3497 | if (ret != QLA_SUCCESS) | 3511 | if (ret != QLA_SUCCESS) |
@@ -3500,7 +3514,7 @@ qla25xx_init_queues(struct qla_hw_data *ha) | |||
3500 | req->id)); | 3514 | req->id)); |
3501 | else | 3515 | else |
3502 | DEBUG2_17(printk(KERN_WARNING | 3516 | DEBUG2_17(printk(KERN_WARNING |
3503 | "%s Rsp que:%d inited\n", __func__, | 3517 | "%s Req que:%d inited\n", __func__, |
3504 | req->id)); | 3518 | req->id)); |
3505 | } | 3519 | } |
3506 | } | 3520 | } |
@@ -4151,8 +4165,8 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha) | |||
4151 | uint16_t mb[MAILBOX_REGISTER_COUNT]; | 4165 | uint16_t mb[MAILBOX_REGISTER_COUNT]; |
4152 | struct qla_hw_data *ha = vha->hw; | 4166 | struct qla_hw_data *ha = vha->hw; |
4153 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); | 4167 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); |
4154 | struct req_que *req = ha->req_q_map[0]; | 4168 | struct req_que *req = ha->req_q_map[vha->req_ques[0]]; |
4155 | struct rsp_que *rsp = ha->rsp_q_map[0]; | 4169 | struct rsp_que *rsp = req->rsp; |
4156 | 4170 | ||
4157 | if (!vha->vp_idx) | 4171 | if (!vha->vp_idx) |
4158 | return -EINVAL; | 4172 | return -EINVAL; |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 886323130fcc..f53179c46423 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -629,6 +629,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options, | |||
629 | req->ring_index = 0; | 629 | req->ring_index = 0; |
630 | req->cnt = req->length; | 630 | req->cnt = req->length; |
631 | req->id = que_id; | 631 | req->id = que_id; |
632 | req->max_q_depth = ha->req_q_map[0]->max_q_depth; | ||
632 | mutex_unlock(&ha->vport_lock); | 633 | mutex_unlock(&ha->vport_lock); |
633 | 634 | ||
634 | ret = qla25xx_init_req_que(base_vha, req, options); | 635 | ret = qla25xx_init_req_que(base_vha, req, options); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 4a71f522f925..cf32653fe01a 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1158,8 +1158,8 @@ qla2x00_abort_all_cmds(scsi_qla_host_t *vha, int res) | |||
1158 | struct req_que *req; | 1158 | struct req_que *req; |
1159 | 1159 | ||
1160 | spin_lock_irqsave(&ha->hardware_lock, flags); | 1160 | spin_lock_irqsave(&ha->hardware_lock, flags); |
1161 | for (que = 0; que < QLA_MAX_HOST_QUES; que++) { | 1161 | for (que = 0; que < ha->max_queues; que++) { |
1162 | req = ha->req_q_map[vha->req_ques[que]]; | 1162 | req = ha->req_q_map[que]; |
1163 | if (!req) | 1163 | if (!req) |
1164 | continue; | 1164 | continue; |
1165 | for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { | 1165 | for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) { |
@@ -1193,7 +1193,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev) | |||
1193 | scsi_qla_host_t *vha = shost_priv(sdev->host); | 1193 | scsi_qla_host_t *vha = shost_priv(sdev->host); |
1194 | struct qla_hw_data *ha = vha->hw; | 1194 | struct qla_hw_data *ha = vha->hw; |
1195 | struct fc_rport *rport = starget_to_rport(sdev->sdev_target); | 1195 | struct fc_rport *rport = starget_to_rport(sdev->sdev_target); |
1196 | struct req_que *req = ha->req_q_map[0]; | 1196 | struct req_que *req = ha->req_q_map[vha->req_ques[0]]; |
1197 | 1197 | ||
1198 | if (sdev->tagged_supported) | 1198 | if (sdev->tagged_supported) |
1199 | scsi_activate_tcq(sdev, req->max_q_depth); | 1199 | scsi_activate_tcq(sdev, req->max_q_depth); |
@@ -1998,7 +1998,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1998 | return 0; | 1998 | return 0; |
1999 | 1999 | ||
2000 | probe_failed: | 2000 | probe_failed: |
2001 | qla2x00_free_que(ha, req, rsp); | ||
2002 | qla2x00_free_device(base_vha); | 2001 | qla2x00_free_device(base_vha); |
2003 | 2002 | ||
2004 | scsi_host_put(base_vha->host); | 2003 | scsi_host_put(base_vha->host); |