aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2009-07-19 10:01:10 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:51:57 -0400
commita0c87cbdb52467a16343b31251f2722643db603c (patch)
tree0242b3b51f1984ca3f8d59390487f39a865812aa /drivers/scsi/lpfc/lpfc_init.c
parent8fa38513ddc1076f3e26c651f3567b084c273ba2 (diff)
[SCSI] lpfc 8.3.4: Consistently Implement persistent port disable
Consistently implement persistent port disable. Ability was to be managed in the adapter via firmware via flash settings. However, not all firmware images supported it. Uniformly support it everywhere. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c59
1 files changed, 42 insertions, 17 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index f8271a587aab..900b5628ceb9 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -211,7 +211,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba)
211 goto out_free_mbox; 211 goto out_free_mbox;
212 212
213 do { 213 do {
214 lpfc_dump_mem(phba, pmb, offset); 214 lpfc_dump_mem(phba, pmb, offset, DMP_REGION_VPD);
215 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL); 215 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
216 216
217 if (rc != MBX_SUCCESS) { 217 if (rc != MBX_SUCCESS) {
@@ -425,6 +425,9 @@ lpfc_config_port_post(struct lpfc_hba *phba)
425 return -EIO; 425 return -EIO;
426 } 426 }
427 427
428 /* Check if the port is disabled */
429 lpfc_sli_read_link_ste(phba);
430
428 /* Reset the DFT_HBA_Q_DEPTH to the max xri */ 431 /* Reset the DFT_HBA_Q_DEPTH to the max xri */
429 if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1)) 432 if (phba->cfg_hba_queue_depth > (mb->un.varRdConfig.max_xri+1))
430 phba->cfg_hba_queue_depth = 433 phba->cfg_hba_queue_depth =
@@ -524,27 +527,49 @@ lpfc_config_port_post(struct lpfc_hba *phba)
524 /* Set up error attention (ERATT) polling timer */ 527 /* Set up error attention (ERATT) polling timer */
525 mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL); 528 mod_timer(&phba->eratt_poll, jiffies + HZ * LPFC_ERATT_POLL_INTERVAL);
526 529
527 lpfc_init_link(phba, pmb, phba->cfg_topology, phba->cfg_link_speed); 530 /* Check if the port is disabled */
528 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; 531 lpfc_sli_read_serdes_param(phba);
529 lpfc_set_loopback_flag(phba); 532
530 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); 533 if (phba->hba_flag & LINK_DISABLED) {
531 if (rc != MBX_SUCCESS) { 534 lpfc_printf_log(phba,
532 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 535 KERN_ERR, LOG_INIT,
536 "2598 Adapter Link is disabled.\n");
537 lpfc_down_link(phba, pmb);
538 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
539 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
540 if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) {
541 lpfc_printf_log(phba,
542 KERN_ERR, LOG_INIT,
543 "2599 Adapter failed to issue DOWN_LINK"
544 " mbox command rc 0x%x\n", rc);
545
546 mempool_free(pmb, phba->mbox_mem_pool);
547 return -EIO;
548 }
549 } else {
550 lpfc_init_link(phba, pmb, phba->cfg_topology,
551 phba->cfg_link_speed);
552 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
553 lpfc_set_loopback_flag(phba);
554 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
555 if (rc != MBX_SUCCESS) {
556 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
533 "0454 Adapter failed to init, mbxCmd x%x " 557 "0454 Adapter failed to init, mbxCmd x%x "
534 "INIT_LINK, mbxStatus x%x\n", 558 "INIT_LINK, mbxStatus x%x\n",
535 mb->mbxCommand, mb->mbxStatus); 559 mb->mbxCommand, mb->mbxStatus);
536 560
537 /* Clear all interrupt enable conditions */ 561 /* Clear all interrupt enable conditions */
538 writel(0, phba->HCregaddr); 562 writel(0, phba->HCregaddr);
539 readl(phba->HCregaddr); /* flush */ 563 readl(phba->HCregaddr); /* flush */
540 /* Clear all pending interrupts */ 564 /* Clear all pending interrupts */
541 writel(0xffffffff, phba->HAregaddr); 565 writel(0xffffffff, phba->HAregaddr);
542 readl(phba->HAregaddr); /* flush */ 566 readl(phba->HAregaddr); /* flush */
543 567
544 phba->link_state = LPFC_HBA_ERROR; 568 phba->link_state = LPFC_HBA_ERROR;
545 if (rc != MBX_BUSY) 569 if (rc != MBX_BUSY)
546 mempool_free(pmb, phba->mbox_mem_pool); 570 mempool_free(pmb, phba->mbox_mem_pool);
547 return -EIO; 571 return -EIO;
572 }
548 } 573 }
549 /* MBOX buffer will be freed in mbox compl */ 574 /* MBOX buffer will be freed in mbox compl */
550 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); 575 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);