ixgbevf: restore hw_addr on resume or error
authorEmil Tantilov <emil.s.tantilov@intel.com>
Wed, 23 Nov 2016 19:24:08 +0000 (11:24 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 3 Jan 2017 21:03:38 +0000 (13:03 -0800)
Restore adapter->hw.hw_addr after handling an error, or a resume
operation to make sure we can access the registers.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

index a78e4901118b410e2ce151d598f614ba178e1e1e..dc23f56d5c10b8dade69c55af27326a19636a30a 100644 (file)
@@ -3851,6 +3851,8 @@ static int ixgbevf_resume(struct pci_dev *pdev)
                dev_err(&pdev->dev, "Cannot enable PCI device from suspend\n");
                return err;
        }
+
+       adapter->hw.hw_addr = adapter->io_addr;
        smp_mb__before_atomic();
        clear_bit(__IXGBEVF_DISABLED, &adapter->state);
        pci_set_master(pdev);
@@ -4285,6 +4287,7 @@ static pci_ers_result_t ixgbevf_io_slot_reset(struct pci_dev *pdev)
                return PCI_ERS_RESULT_DISCONNECT;
        }
 
+       adapter->hw.hw_addr = adapter->io_addr;
        smp_mb__before_atomic();
        clear_bit(__IXGBEVF_DISABLED, &adapter->state);
        pci_set_master(pdev);