aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index ceb185fa3216..db96f7504a14 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1339,6 +1339,7 @@ lpfc_cleanup(struct lpfc_vport *vport)
1339{ 1339{
1340 struct lpfc_hba *phba = vport->phba; 1340 struct lpfc_hba *phba = vport->phba;
1341 struct lpfc_nodelist *ndlp, *next_ndlp; 1341 struct lpfc_nodelist *ndlp, *next_ndlp;
1342 int i = 0;
1342 1343
1343 if (phba->link_state > LPFC_LINK_DOWN) 1344 if (phba->link_state > LPFC_LINK_DOWN)
1344 lpfc_port_link_failure(vport); 1345 lpfc_port_link_failure(vport);
@@ -1351,17 +1352,20 @@ lpfc_cleanup(struct lpfc_vport *vport)
1351 NLP_EVT_DEVICE_RM); 1352 NLP_EVT_DEVICE_RM);
1352 } 1353 }
1353 1354
1354 /* At this point, ALL ndlp's should be gone */ 1355 /* At this point, ALL ndlp's should be gone
1356 * because of the previous NLP_EVT_DEVICE_RM.
1357 * Lets wait for this to happen, if needed.
1358 */
1355 while (!list_empty(&vport->fc_nodes)) { 1359 while (!list_empty(&vport->fc_nodes)) {
1356 1360
1357 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, 1361 if (i++ > 3000) {
1358 nlp_listp) {
1359 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, 1362 lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1360 "0233 Nodelist x%x not free: %d\n", 1363 "0233 Nodelist not empty\n");
1361 ndlp->nlp_DID, 1364 break;
1362 atomic_read(&ndlp->kref.refcount));
1363 lpfc_drop_node(vport, ndlp);
1364 } 1365 }
1366
1367 /* Wait for any activity on ndlps to settle */
1368 msleep(10);
1365 } 1369 }
1366 return; 1370 return;
1367} 1371}
@@ -1499,6 +1503,8 @@ lpfc_offline_prep(struct lpfc_hba * phba)
1499 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) { 1503 for(i = 0; i < LPFC_MAX_VPORTS && vports[i] != NULL; i++) {
1500 struct Scsi_Host *shost; 1504 struct Scsi_Host *shost;
1501 1505
1506 if (vports[i]->load_flag & FC_UNLOADING)
1507 continue;
1502 shost = lpfc_shost_from_vport(vports[i]); 1508 shost = lpfc_shost_from_vport(vports[i]);
1503 list_for_each_entry_safe(ndlp, next_ndlp, 1509 list_for_each_entry_safe(ndlp, next_ndlp,
1504 &vports[i]->fc_nodes, 1510 &vports[i]->fc_nodes,
@@ -1771,6 +1777,8 @@ void lpfc_host_attrib_init(struct Scsi_Host *shost)
1771 fc_host_supported_speeds(shost) = 0; 1777 fc_host_supported_speeds(shost) = 0;
1772 if (phba->lmt & LMT_10Gb) 1778 if (phba->lmt & LMT_10Gb)
1773 fc_host_supported_speeds(shost) |= FC_PORTSPEED_10GBIT; 1779 fc_host_supported_speeds(shost) |= FC_PORTSPEED_10GBIT;
1780 if (phba->lmt & LMT_8Gb)
1781 fc_host_supported_speeds(shost) |= FC_PORTSPEED_8GBIT;
1774 if (phba->lmt & LMT_4Gb) 1782 if (phba->lmt & LMT_4Gb)
1775 fc_host_supported_speeds(shost) |= FC_PORTSPEED_4GBIT; 1783 fc_host_supported_speeds(shost) |= FC_PORTSPEED_4GBIT;
1776 if (phba->lmt & LMT_2Gb) 1784 if (phba->lmt & LMT_2Gb)