diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2009-03-05 14:07:02 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-03-10 10:27:54 -0400 |
commit | ee546b6e048586381462ce7bb51c7ddc03819619 (patch) | |
tree | 8d45dca886722cc351f0245b35955eca451aaeac /drivers/scsi/qla2xxx | |
parent | 605aa2bcd5e9dddc4666f12e0c19822809186d6d (diff) |
[SCSI] qla2xxx: Correct vport delete bug.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 11 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 10 |
3 files changed, 15 insertions, 9 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 14325c027336..e54ab2f10795 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2614,6 +2614,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, | |||
2614 | port_id_t wrap, nxt_d_id; | 2614 | port_id_t wrap, nxt_d_id; |
2615 | struct qla_hw_data *ha = vha->hw; | 2615 | struct qla_hw_data *ha = vha->hw; |
2616 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); | 2616 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); |
2617 | struct scsi_qla_host *tvp; | ||
2617 | 2618 | ||
2618 | rval = QLA_SUCCESS; | 2619 | rval = QLA_SUCCESS; |
2619 | 2620 | ||
@@ -2713,7 +2714,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, | |||
2713 | /* Bypass virtual ports of the same host. */ | 2714 | /* Bypass virtual ports of the same host. */ |
2714 | found = 0; | 2715 | found = 0; |
2715 | if (ha->num_vhosts) { | 2716 | if (ha->num_vhosts) { |
2716 | list_for_each_entry(vp, &ha->vp_list, list) { | 2717 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
2717 | if (new_fcport->d_id.b24 == vp->d_id.b24) { | 2718 | if (new_fcport->d_id.b24 == vp->d_id.b24) { |
2718 | found = 1; | 2719 | found = 1; |
2719 | break; | 2720 | break; |
@@ -2836,6 +2837,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
2836 | uint16_t first_loop_id; | 2837 | uint16_t first_loop_id; |
2837 | struct qla_hw_data *ha = vha->hw; | 2838 | struct qla_hw_data *ha = vha->hw; |
2838 | struct scsi_qla_host *vp; | 2839 | struct scsi_qla_host *vp; |
2840 | struct scsi_qla_host *tvp; | ||
2839 | 2841 | ||
2840 | rval = QLA_SUCCESS; | 2842 | rval = QLA_SUCCESS; |
2841 | 2843 | ||
@@ -2860,7 +2862,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
2860 | /* Check for loop ID being already in use. */ | 2862 | /* Check for loop ID being already in use. */ |
2861 | found = 0; | 2863 | found = 0; |
2862 | fcport = NULL; | 2864 | fcport = NULL; |
2863 | list_for_each_entry(vp, &ha->vp_list, list) { | 2865 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
2864 | list_for_each_entry(fcport, &vp->vp_fcports, list) { | 2866 | list_for_each_entry(fcport, &vp->vp_fcports, list) { |
2865 | if (fcport->loop_id == dev->loop_id && | 2867 | if (fcport->loop_id == dev->loop_id && |
2866 | fcport != dev) { | 2868 | fcport != dev) { |
@@ -3295,6 +3297,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3295 | uint8_t status = 0; | 3297 | uint8_t status = 0; |
3296 | struct qla_hw_data *ha = vha->hw; | 3298 | struct qla_hw_data *ha = vha->hw; |
3297 | struct scsi_qla_host *vp; | 3299 | struct scsi_qla_host *vp; |
3300 | struct scsi_qla_host *tvp; | ||
3298 | struct req_que *req = ha->req_q_map[0]; | 3301 | struct req_que *req = ha->req_q_map[0]; |
3299 | 3302 | ||
3300 | if (vha->flags.online) { | 3303 | if (vha->flags.online) { |
@@ -3310,7 +3313,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3310 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { | 3313 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { |
3311 | atomic_set(&vha->loop_state, LOOP_DOWN); | 3314 | atomic_set(&vha->loop_state, LOOP_DOWN); |
3312 | qla2x00_mark_all_devices_lost(vha, 0); | 3315 | qla2x00_mark_all_devices_lost(vha, 0); |
3313 | list_for_each_entry(vp, &ha->vp_list, list) | 3316 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) |
3314 | qla2x00_mark_all_devices_lost(vp, 0); | 3317 | qla2x00_mark_all_devices_lost(vp, 0); |
3315 | } else { | 3318 | } else { |
3316 | if (!atomic_read(&vha->loop_down_timer)) | 3319 | if (!atomic_read(&vha->loop_down_timer)) |
@@ -3407,7 +3410,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
3407 | DEBUG(printk(KERN_INFO | 3410 | DEBUG(printk(KERN_INFO |
3408 | "qla2x00_abort_isp(%ld): succeeded.\n", | 3411 | "qla2x00_abort_isp(%ld): succeeded.\n", |
3409 | vha->host_no)); | 3412 | vha->host_no)); |
3410 | list_for_each_entry(vp, &ha->vp_list, list) { | 3413 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
3411 | if (vp->vp_idx) | 3414 | if (vp->vp_idx) |
3412 | qla2x00_vp_abort_isp(vp); | 3415 | qla2x00_vp_abort_isp(vp); |
3413 | } | 3416 | } |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 4c7504cb3990..4aab7acf7525 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2685,6 +2685,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
2685 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); | 2685 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); |
2686 | struct qla_hw_data *ha = vha->hw; | 2686 | struct qla_hw_data *ha = vha->hw; |
2687 | scsi_qla_host_t *vp; | 2687 | scsi_qla_host_t *vp; |
2688 | scsi_qla_host_t *tvp; | ||
2688 | 2689 | ||
2689 | if (rptid_entry->entry_status != 0) | 2690 | if (rptid_entry->entry_status != 0) |
2690 | return; | 2691 | return; |
@@ -2710,7 +2711,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
2710 | if (MSB(stat) == 1) | 2711 | if (MSB(stat) == 1) |
2711 | return; | 2712 | return; |
2712 | 2713 | ||
2713 | list_for_each_entry(vp, &ha->vp_list, list) | 2714 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) |
2714 | if (vp_idx == vp->vp_idx) | 2715 | if (vp_idx == vp->vp_idx) |
2715 | break; | 2716 | break; |
2716 | if (!vp) | 2717 | if (!vp) |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 3f23932210c4..785c61279e6e 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -69,9 +69,10 @@ static scsi_qla_host_t * | |||
69 | qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) | 69 | qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) |
70 | { | 70 | { |
71 | scsi_qla_host_t *vha; | 71 | scsi_qla_host_t *vha; |
72 | struct scsi_qla_host *tvha; | ||
72 | 73 | ||
73 | /* Locate matching device in database. */ | 74 | /* Locate matching device in database. */ |
74 | list_for_each_entry(vha, &ha->vp_list, list) { | 75 | list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { |
75 | if (!memcmp(port_name, vha->port_name, WWN_SIZE)) | 76 | if (!memcmp(port_name, vha->port_name, WWN_SIZE)) |
76 | return vha; | 77 | return vha; |
77 | } | 78 | } |
@@ -194,11 +195,11 @@ qla24xx_configure_vp(scsi_qla_host_t *vha) | |||
194 | void | 195 | void |
195 | qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) | 196 | qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) |
196 | { | 197 | { |
197 | scsi_qla_host_t *vha; | 198 | scsi_qla_host_t *vha, *tvha; |
198 | struct qla_hw_data *ha = rsp->hw; | 199 | struct qla_hw_data *ha = rsp->hw; |
199 | int i = 0; | 200 | int i = 0; |
200 | 201 | ||
201 | list_for_each_entry(vha, &ha->vp_list, list) { | 202 | list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { |
202 | if (vha->vp_idx) { | 203 | if (vha->vp_idx) { |
203 | switch (mb[0]) { | 204 | switch (mb[0]) { |
204 | case MBA_LIP_OCCURRED: | 205 | case MBA_LIP_OCCURRED: |
@@ -300,6 +301,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha) | |||
300 | int ret; | 301 | int ret; |
301 | struct qla_hw_data *ha = vha->hw; | 302 | struct qla_hw_data *ha = vha->hw; |
302 | scsi_qla_host_t *vp; | 303 | scsi_qla_host_t *vp; |
304 | struct scsi_qla_host *tvp; | ||
303 | 305 | ||
304 | if (vha->vp_idx) | 306 | if (vha->vp_idx) |
305 | return; | 307 | return; |
@@ -308,7 +310,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha) | |||
308 | 310 | ||
309 | clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); | 311 | clear_bit(VP_DPC_NEEDED, &vha->dpc_flags); |
310 | 312 | ||
311 | list_for_each_entry(vp, &ha->vp_list, list) { | 313 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
312 | if (vp->vp_idx) | 314 | if (vp->vp_idx) |
313 | ret = qla2x00_do_dpc_vp(vp); | 315 | ret = qla2x00_do_dpc_vp(vp); |
314 | } | 316 | } |