aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 6932657d74ad..93679f30a5af 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7142,6 +7142,28 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev)
7142} 7142}
7143 7143
7144/** 7144/**
7145 * lpfc_sli_prep_dev_for_recover - Prepare SLI3 device for pci slot recover
7146 * @phba: pointer to lpfc hba data structure.
7147 *
7148 * This routine is called to prepare the SLI3 device for PCI slot recover. It
7149 * aborts and stops all the on-going I/Os on the pci device.
7150 **/
7151static void
7152lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba)
7153{
7154 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7155 "2723 PCI channel I/O abort preparing for recovery\n");
7156 /* Prepare for bringing HBA offline */
7157 lpfc_offline_prep(phba);
7158 /* Clear sli active flag to prevent sysfs access to HBA */
7159 spin_lock_irq(&phba->hbalock);
7160 phba->sli.sli_flag &= ~LPFC_SLI_ACTIVE;
7161 spin_unlock_irq(&phba->hbalock);
7162 /* Stop and flush all I/Os and bring HBA offline */
7163 lpfc_offline(phba);
7164}
7165
7166/**
7145 * lpfc_sli_prep_dev_for_reset - Prepare SLI3 device for pci slot reset 7167 * lpfc_sli_prep_dev_for_reset - Prepare SLI3 device for pci slot reset
7146 * @phba: pointer to lpfc hba data structure. 7168 * @phba: pointer to lpfc hba data structure.
7147 * 7169 *
@@ -7156,7 +7178,7 @@ lpfc_sli_prep_dev_for_reset(struct lpfc_hba *phba)
7156 struct lpfc_sli_ring *pring; 7178 struct lpfc_sli_ring *pring;
7157 7179
7158 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 7180 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7159 "2710 PCI channel I/O frozen\n"); 7181 "2710 PCI channel disable preparing for reset\n");
7160 /* Disable interrupt and pci device */ 7182 /* Disable interrupt and pci device */
7161 lpfc_sli_disable_intr(phba); 7183 lpfc_sli_disable_intr(phba);
7162 pci_disable_device(phba->pcidev); 7184 pci_disable_device(phba->pcidev);
@@ -7181,7 +7203,7 @@ static void
7181lpfc_prep_dev_for_perm_failure(struct lpfc_hba *phba) 7203lpfc_prep_dev_for_perm_failure(struct lpfc_hba *phba)
7182{ 7204{
7183 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 7205 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7184 "2711 PCI channel I/O permanent failure\n"); 7206 "2711 PCI channel permanent disable for failure\n");
7185 /* Block all SCSI devices' I/Os on the host */ 7207 /* Block all SCSI devices' I/Os on the host */
7186 lpfc_scsi_dev_block(phba); 7208 lpfc_scsi_dev_block(phba);
7187 /* Clean up all driver's outstanding SCSI I/Os */ 7209 /* Clean up all driver's outstanding SCSI I/Os */
@@ -7214,7 +7236,8 @@ lpfc_io_error_detected_s3(struct pci_dev *pdev, pci_channel_state_t state)
7214 7236
7215 switch (state) { 7237 switch (state) {
7216 case pci_channel_io_normal: 7238 case pci_channel_io_normal:
7217 /* Non-fatal error, do nothing */ 7239 /* Non-fatal error, prepare for recovery */
7240 lpfc_sli_prep_dev_for_recover(phba);
7218 return PCI_ERS_RESULT_CAN_RECOVER; 7241 return PCI_ERS_RESULT_CAN_RECOVER;
7219 case pci_channel_io_frozen: 7242 case pci_channel_io_frozen:
7220 /* Fatal error, prepare for slot reset */ 7243 /* Fatal error, prepare for slot reset */