Commit aacc20e3 authored by James Smart's avatar James Smart Committed by James Bottomley

[SCSI] lpfc 8.3.7: Fix SCSI protocol related errors.

Fix SCSI protocol related errors:
- Avoid I/O failures during EEH and HBA/CNA reset by correcting when
  we block the targets on the adapter.
Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent def9c7a9
...@@ -747,6 +747,10 @@ lpfc_linkdown(struct lpfc_hba *phba) ...@@ -747,6 +747,10 @@ lpfc_linkdown(struct lpfc_hba *phba)
if (phba->link_state == LPFC_LINK_DOWN) if (phba->link_state == LPFC_LINK_DOWN)
return 0; return 0;
/* Block all SCSI stack I/Os */
lpfc_scsi_dev_block(phba);
spin_lock_irq(&phba->hbalock); spin_lock_irq(&phba->hbalock);
phba->fcf.fcf_flag &= ~(FCF_AVAILABLE | FCF_DISCOVERED); phba->fcf.fcf_flag &= ~(FCF_AVAILABLE | FCF_DISCOVERED);
if (phba->link_state > LPFC_LINK_DOWN) { if (phba->link_state > LPFC_LINK_DOWN) {
......
...@@ -7226,8 +7226,6 @@ lpfc_prep_dev_for_perm_failure(struct lpfc_hba *phba) ...@@ -7226,8 +7226,6 @@ lpfc_prep_dev_for_perm_failure(struct lpfc_hba *phba)
{ {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT, lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"2711 PCI channel permanent disable for failure\n"); "2711 PCI channel permanent disable for failure\n");
/* Block all SCSI devices' I/Os on the host */
lpfc_scsi_dev_block(phba);
/* Clean up all driver's outstanding SCSI I/Os */ /* Clean up all driver's outstanding SCSI I/Os */
lpfc_sli_flush_fcp_rings(phba); lpfc_sli_flush_fcp_rings(phba);
} }
...@@ -7256,6 +7254,9 @@ lpfc_io_error_detected_s3(struct pci_dev *pdev, pci_channel_state_t state) ...@@ -7256,6 +7254,9 @@ lpfc_io_error_detected_s3(struct pci_dev *pdev, pci_channel_state_t state)
struct Scsi_Host *shost = pci_get_drvdata(pdev); struct Scsi_Host *shost = pci_get_drvdata(pdev);
struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
/* Block all SCSI devices' I/Os on the host */
lpfc_scsi_dev_block(phba);
switch (state) { switch (state) {
case pci_channel_io_normal: case pci_channel_io_normal:
/* Non-fatal error, prepare for recovery */ /* Non-fatal error, prepare for recovery */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment