/* If the pci channel is offline, ignore possible errors, since
         * we cannot communicate with the pci card anyway.
         */
-       if (pci_channel_offline(phba->pcidev))
+       if (pci_channel_offline(phba->pcidev)) {
+               lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
+                               "3166 pci channel is offline\n");
+               lpfc_sli4_offline_eratt(phba);
                return;
+       }
 
        memset(&portsmphr_reg, 0, sizeof(portsmphr_reg));
        if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
                        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
                                "3151 PCI bus read access failure: x%x\n",
                                readl(phba->sli4_hba.u.if_type2.STATUSregaddr));
+                       lpfc_sli4_offline_eratt(phba);
                        return;
                }
                reg_err1 = readl(phba->sli4_hba.u.if_type2.ERR1regaddr);
 
        }
 
        /* 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)));
                        "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)));