diff options
author | James Smart <jsmart2021@gmail.com> | 2019-03-13 00:30:13 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-19 17:57:02 +0100 |
commit | 32a9310076e4f00ac6d8a5a2d39b953d199bef0d (patch) | |
tree | f671c5bd01d909ff7d14ad84b18e9c5a4d3d2bbb /drivers/scsi/lpfc/lpfc_sli.c | |
parent | scsi: lpfc: Fix deadlock due to nested hbalock call (diff) | |
download | linux-32a9310076e4f00ac6d8a5a2d39b953d199bef0d.tar.xz linux-32a9310076e4f00ac6d8a5a2d39b953d199bef0d.zip |
scsi: lpfc: Stop adapter if pci errors detected
In a couple of cases, the driver detected a pci error (via pci device state
or via failed register reads) but didn't take any action to disable the
device. Additionally, the driver is ignoring the status of pci
configuration space reads.
Having the driver take the adapter offline whenever the pci error is
detected. Pay attention to pci_config_space_read status and return failure
if an error is seen.
Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <jsmart2021@gmail.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c82304c11ef2..32ded3e9b32e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -4487,7 +4487,9 @@ lpfc_sli_brdreset(struct lpfc_hba *phba) } /* Turn off parity checking and serr during the physical reset */ - pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); + if (pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value)) + return -EIO; + pci_write_config_word(phba->pcidev, PCI_COMMAND, (cfg_value & ~(PCI_COMMAND_PARITY | PCI_COMMAND_SERR))); @@ -4564,7 +4566,12 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) "0389 Performing PCI function reset!\n"); /* Turn off parity checking and serr during the physical reset */ - pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); + if (pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value)) { + lpfc_printf_log(phba, KERN_INFO, LOG_INIT, + "3205 PCI read Config failed\n"); + return -EIO; + } + pci_write_config_word(phba->pcidev, PCI_COMMAND, (cfg_value & ~(PCI_COMMAND_PARITY | PCI_COMMAND_SERR))); |