public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 12/15] lpfc 8.1.7 : Correct the wait in attachment that delays for topology discovery
@ 2006-07-06 19:50 James Smart
  0 siblings, 0 replies; only message in thread
From: James Smart @ 2006-07-06 19:50 UTC (permalink / raw)
  To: linux-scsi

Correct the wait in attachment that delays for topology discovery

Signed-off-by: James Smart <James.Smart@emulex.com>


diff -upNr a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
--- a/drivers/scsi/lpfc/lpfc_init.c	2006-07-06 14:50:59.000000000 -0400
+++ b/drivers/scsi/lpfc/lpfc_init.c	2006-07-06 15:01:03.000000000 -0400
@@ -405,19 +405,26 @@ lpfc_config_port_post(struct lpfc_hba * 
 	}
 	/* MBOX buffer will be freed in mbox compl */
 
-	i = 0;
+	return (0);
+}
+
+static int
+lpfc_discovery_wait(struct lpfc_hba *phba)
+{
+	int i = 0;
+
 	while ((phba->hba_state != LPFC_HBA_READY) ||
 	       (phba->num_disc_nodes) || (phba->fc_prli_sent) ||
 	       ((phba->fc_map_cnt == 0) && (i<2)) ||
-	       (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE)) {
+	       (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE)) {
 		/* Check every second for 30 retries. */
 		i++;
 		if (i > 30) {
-			break;
+			return -ETIMEDOUT;
 		}
 		if ((i >= 15) && (phba->hba_state <= LPFC_LINK_DOWN)) {
 			/* The link is down.  Set linkdown timeout */
-			break;
+			return -ETIMEDOUT;
 		}
 
 		/* Delay for 1 second to give discovery time to complete. */
@@ -425,12 +432,7 @@ lpfc_config_port_post(struct lpfc_hba * 
 
 	}
 
-	/* Since num_disc_nodes keys off of PLOGI, delay a bit to let
-	 * any potential PRLIs to flush thru the SLI sub-system.
-	 */
-	msleep(50);
-
-	return (0);
+	return 0;
 }
 
 /************************************************************************/
@@ -1649,6 +1651,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev,
 		goto out_free_irq;
 	}
 
+	lpfc_discovery_wait(phba);
+
 	if (phba->cfg_poll & DISABLE_FCP_RING_INT) {
 		spin_lock_irq(phba->host->host_lock);
 		lpfc_poll_start_timer(phba);



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-06 19:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-06 19:50 [PATCH 12/15] lpfc 8.1.7 : Correct the wait in attachment that delays for topology discovery James Smart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox