diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-07-06 15:50:36 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-07-09 11:48:11 -0400 |
commit | ce8b3ce55bb0bd9318954efab0f714b088178978 (patch) | |
tree | 3a330ebbf376d97e55a4720671775e916c83d743 /drivers/scsi/lpfc | |
parent | 5e0b43385559bfe78c1f80d71ec203effe244d9a (diff) |
[SCSI] lpfc 8.1.7: Correct the wait in attachment that delays for topology discovery
Correct the wait in attachment that delays for topology discovery
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 2944eda1e907..2a81df054022 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -405,19 +405,26 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
405 | } | 405 | } |
406 | /* MBOX buffer will be freed in mbox compl */ | 406 | /* MBOX buffer will be freed in mbox compl */ |
407 | 407 | ||
408 | i = 0; | 408 | return (0); |
409 | } | ||
410 | |||
411 | static int | ||
412 | lpfc_discovery_wait(struct lpfc_hba *phba) | ||
413 | { | ||
414 | int i = 0; | ||
415 | |||
409 | while ((phba->hba_state != LPFC_HBA_READY) || | 416 | while ((phba->hba_state != LPFC_HBA_READY) || |
410 | (phba->num_disc_nodes) || (phba->fc_prli_sent) || | 417 | (phba->num_disc_nodes) || (phba->fc_prli_sent) || |
411 | ((phba->fc_map_cnt == 0) && (i<2)) || | 418 | ((phba->fc_map_cnt == 0) && (i<2)) || |
412 | (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE)) { | 419 | (phba->sli.sli_flag & LPFC_SLI_MBOX_ACTIVE)) { |
413 | /* Check every second for 30 retries. */ | 420 | /* Check every second for 30 retries. */ |
414 | i++; | 421 | i++; |
415 | if (i > 30) { | 422 | if (i > 30) { |
416 | break; | 423 | return -ETIMEDOUT; |
417 | } | 424 | } |
418 | if ((i >= 15) && (phba->hba_state <= LPFC_LINK_DOWN)) { | 425 | if ((i >= 15) && (phba->hba_state <= LPFC_LINK_DOWN)) { |
419 | /* The link is down. Set linkdown timeout */ | 426 | /* The link is down. Set linkdown timeout */ |
420 | break; | 427 | return -ETIMEDOUT; |
421 | } | 428 | } |
422 | 429 | ||
423 | /* Delay for 1 second to give discovery time to complete. */ | 430 | /* Delay for 1 second to give discovery time to complete. */ |
@@ -425,12 +432,7 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
425 | 432 | ||
426 | } | 433 | } |
427 | 434 | ||
428 | /* Since num_disc_nodes keys off of PLOGI, delay a bit to let | 435 | return 0; |
429 | * any potential PRLIs to flush thru the SLI sub-system. | ||
430 | */ | ||
431 | msleep(50); | ||
432 | |||
433 | return (0); | ||
434 | } | 436 | } |
435 | 437 | ||
436 | /************************************************************************/ | 438 | /************************************************************************/ |
@@ -1649,6 +1651,8 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1649 | goto out_free_irq; | 1651 | goto out_free_irq; |
1650 | } | 1652 | } |
1651 | 1653 | ||
1654 | lpfc_discovery_wait(phba); | ||
1655 | |||
1652 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { | 1656 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { |
1653 | spin_lock_irq(phba->host->host_lock); | 1657 | spin_lock_irq(phba->host->host_lock); |
1654 | lpfc_poll_start_timer(phba); | 1658 | lpfc_poll_start_timer(phba); |