diff options
author | James Smart <james.smart@emulex.com> | 2014-04-04 13:52:12 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-06-02 12:28:52 -0400 |
commit | 0293635ef6234ae813df95d6b3b93a666c69f33d (patch) | |
tree | 4b030cf4e4cdbfc6e0dac0df79dc722a817ed6d6 | |
parent | db55fba8dc26535d34c00a3b3256da0b48608071 (diff) |
lpfc: Fix FW dump using sysfs
Fix FW dump using sysfs
Signed-off-by: James Smart <james.smart@emulex.com>
Reviewed-By: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 7 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 13 |
3 files changed, 17 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 94a3cafe7197..f71375872007 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -640,6 +640,7 @@ struct lpfc_hba { | |||
640 | #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ | 640 | #define HBA_DEVLOSS_TMO 0x2000 /* HBA in devloss timeout */ |
641 | #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ | 641 | #define HBA_RRQ_ACTIVE 0x4000 /* process the rrq active list */ |
642 | #define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */ | 642 | #define HBA_FCP_IOQ_FLUSH 0x8000 /* FCP I/O queues being flushed */ |
643 | #define HBA_FW_DUMP_OP 0x10000 /* Skips fn reset before FW dump */ | ||
643 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ | 644 | uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/ |
644 | struct lpfc_dmabuf slim2p; | 645 | struct lpfc_dmabuf slim2p; |
645 | 646 | ||
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 8d5b6ceec9c9..3d6a77e21540 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -919,10 +919,15 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode) | |||
919 | phba->cfg_sriov_nr_virtfn = 0; | 919 | phba->cfg_sriov_nr_virtfn = 0; |
920 | } | 920 | } |
921 | 921 | ||
922 | if (opcode == LPFC_FW_DUMP) | ||
923 | phba->hba_flag |= HBA_FW_DUMP_OP; | ||
924 | |||
922 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); | 925 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); |
923 | 926 | ||
924 | if (status != 0) | 927 | if (status != 0) { |
928 | phba->hba_flag &= ~HBA_FW_DUMP_OP; | ||
925 | return status; | 929 | return status; |
930 | } | ||
926 | 931 | ||
927 | /* wait for the device to be quiesced before firmware reset */ | 932 | /* wait for the device to be quiesced before firmware reset */ |
928 | msleep(100); | 933 | msleep(100); |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 91e3c51f8265..b5336a693974 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -4057,12 +4057,13 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) | |||
4057 | { | 4057 | { |
4058 | struct lpfc_sli *psli = &phba->sli; | 4058 | struct lpfc_sli *psli = &phba->sli; |
4059 | uint16_t cfg_value; | 4059 | uint16_t cfg_value; |
4060 | int rc; | 4060 | int rc = 0; |
4061 | 4061 | ||
4062 | /* Reset HBA */ | 4062 | /* Reset HBA */ |
4063 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 4063 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
4064 | "0295 Reset HBA Data: x%x x%x\n", | 4064 | "0295 Reset HBA Data: x%x x%x x%x\n", |
4065 | phba->pport->port_state, psli->sli_flag); | 4065 | phba->pport->port_state, psli->sli_flag, |
4066 | phba->hba_flag); | ||
4066 | 4067 | ||
4067 | /* perform board reset */ | 4068 | /* perform board reset */ |
4068 | phba->fc_eventTag = 0; | 4069 | phba->fc_eventTag = 0; |
@@ -4075,6 +4076,12 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) | |||
4075 | phba->fcf.fcf_flag = 0; | 4076 | phba->fcf.fcf_flag = 0; |
4076 | spin_unlock_irq(&phba->hbalock); | 4077 | spin_unlock_irq(&phba->hbalock); |
4077 | 4078 | ||
4079 | /* SLI4 INTF 2: if FW dump is being taken skip INIT_PORT */ | ||
4080 | if (phba->hba_flag & HBA_FW_DUMP_OP) { | ||
4081 | phba->hba_flag &= ~HBA_FW_DUMP_OP; | ||
4082 | return rc; | ||
4083 | } | ||
4084 | |||
4078 | /* Now physically reset the device */ | 4085 | /* Now physically reset the device */ |
4079 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 4086 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
4080 | "0389 Performing PCI function reset!\n"); | 4087 | "0389 Performing PCI function reset!\n"); |