diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 58 |
1 files changed, 36 insertions, 22 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2d4f32b4df5..9ad4d0968e5 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; |