aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-08-02 11:09:51 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-01 13:18:23 -0400
commit549e55cd2a1b83ea45ac17fb6c309654a3d371a4 (patch)
tree0abf10a28b177e129932c62b3b94994ce4f3aadb /drivers/scsi/lpfc/lpfc_attr.c
parenta58cbd5212fff2d4bba0bf58e778f02069597294 (diff)
[SCSI] lpfc 8.2.2 : Fix locking around HBA's port_list
Cleans up a lot of bad behaviors that have been in this area a while Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 860a52c090f4..dbced066a361 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -1060,19 +1060,24 @@ lpfc_nodev_tmo_init(struct lpfc_hba *phba, int val)
1060static void 1060static void
1061lpfc_update_rport_devloss_tmo(struct lpfc_hba *phba) 1061lpfc_update_rport_devloss_tmo(struct lpfc_hba *phba)
1062{ 1062{
1063 struct lpfc_vport *vport; 1063 struct lpfc_vport **vports;
1064 struct Scsi_Host *shost; 1064 struct Scsi_Host *shost;
1065 struct lpfc_nodelist *ndlp; 1065 struct lpfc_nodelist *ndlp;
1066 int i;
1066 1067
1067 list_for_each_entry(vport, &phba->port_list, listentry) { 1068 vports = lpfc_create_vport_work_array(phba);
1068 shost = lpfc_shost_from_vport(vport); 1069 if (vports != NULL)
1069 spin_lock_irq(shost->host_lock); 1070 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
1070 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) 1071 shost = lpfc_shost_from_vport(vports[i]);
1072 spin_lock_irq(shost->host_lock);
1073 list_for_each_entry(ndlp, &vports[i]->fc_nodes,
1074 nlp_listp)
1071 if (ndlp->rport) 1075 if (ndlp->rport)
1072 ndlp->rport->dev_loss_tmo = 1076 ndlp->rport->dev_loss_tmo =
1073 phba->cfg_devloss_tmo; 1077 phba->cfg_devloss_tmo;
1074 spin_unlock_irq(shost->host_lock); 1078 spin_unlock_irq(shost->host_lock);
1075 } 1079 }
1080 lpfc_destroy_vport_work_array(vports);
1076} 1081}
1077 1082
1078static int 1083static int