aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-04-17 20:16:51 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 15:56:30 -0400
commit229adb0ece8f06091252b06200c176e6cb5b4271 (patch)
treec71e006d8026e7de96468c2503ee9c707a00dc1d /drivers/scsi/lpfc
parenta22e7db38b8a582701faaa608cc65bc2fb517cde (diff)
[SCSI] lpfc 8.3.39: Fix driver issues with SCSI Host reset
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c7
-rw-r--r--drivers/scsi/lpfc/lpfc_hw4.h2
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c7
3 files changed, 13 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 3b10aa5745b5..28e213b9dbba 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -674,6 +674,9 @@ lpfc_do_offline(struct lpfc_hba *phba, uint32_t type)
674 int i; 674 int i;
675 int rc; 675 int rc;
676 676
677 if (phba->pport->fc_flag & FC_OFFLINE_MODE)
678 return 0;
679
677 init_completion(&online_compl); 680 init_completion(&online_compl);
678 rc = lpfc_workq_post_event(phba, &status, &online_compl, 681 rc = lpfc_workq_post_event(phba, &status, &online_compl,
679 LPFC_EVT_OFFLINE_PREP); 682 LPFC_EVT_OFFLINE_PREP);
@@ -741,7 +744,8 @@ lpfc_selective_reset(struct lpfc_hba *phba)
741 int status = 0; 744 int status = 0;
742 int rc; 745 int rc;
743 746
744 if (!phba->cfg_enable_hba_reset) 747 if ((!phba->cfg_enable_hba_reset) ||
748 (phba->pport->fc_flag & FC_OFFLINE_MODE))
745 return -EACCES; 749 return -EACCES;
746 750
747 status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); 751 status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
@@ -895,6 +899,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
895 pci_disable_sriov(pdev); 899 pci_disable_sriov(pdev);
896 phba->cfg_sriov_nr_virtfn = 0; 900 phba->cfg_sriov_nr_virtfn = 0;
897 } 901 }
902
898 status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); 903 status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE);
899 904
900 if (status != 0) 905 if (status != 0)
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index 1dd2f6f0a127..42660c97119e 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -621,7 +621,7 @@ struct lpfc_register {
621#define lpfc_sliport_status_rdy_SHIFT 23 621#define lpfc_sliport_status_rdy_SHIFT 23
622#define lpfc_sliport_status_rdy_MASK 0x1 622#define lpfc_sliport_status_rdy_MASK 0x1
623#define lpfc_sliport_status_rdy_WORD word0 623#define lpfc_sliport_status_rdy_WORD word0
624#define MAX_IF_TYPE_2_RESETS 1000 624#define MAX_IF_TYPE_2_RESETS 6
625 625
626#define LPFC_CTL_PORT_CTL_OFFSET 0x408 626#define LPFC_CTL_PORT_CTL_OFFSET 0x408
627#define lpfc_sliport_ctrl_end_SHIFT 30 627#define lpfc_sliport_ctrl_end_SHIFT 30
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 1874b327494e..7bb89f49df9b 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7817,8 +7817,13 @@ lpfc_pci_function_reset(struct lpfc_hba *phba)
7817 7817
7818out: 7818out:
7819 /* Catch the not-ready port failure after a port reset. */ 7819 /* Catch the not-ready port failure after a port reset. */
7820 if (num_resets >= MAX_IF_TYPE_2_RESETS) 7820 if (num_resets >= MAX_IF_TYPE_2_RESETS) {
7821 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7822 "3317 HBA not functional: IP Reset Failed "
7823 "after (%d) retries, try: "
7824 "echo fw_reset > board_mode\n", num_resets);
7821 rc = -ENODEV; 7825 rc = -ENODEV;
7826 }
7822 7827
7823 return rc; 7828 return rc;
7824} 7829}