]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
igb/igc: warn when fatal read failure happens
authorFeng Tang <feng.tang@intel.com>
Wed, 13 Feb 2019 02:41:54 +0000 (10:41 +0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 28 May 2019 22:42:32 +0000 (15:42 -0700)
Failed in read the HW register is very serious for igb/igc driver,
as its hw_addr will be set to NULL and cause the adapter be seen as
"REMOVED".

We saw the error only a few times in the MTBF test for suspend/resume,
but can hardly get any useful info to debug.

Adding WARN() so that we can get the necessary information about
where and how it happens, and use it for root causing and fixing
this "PCIe link lost issue"

This affects igb, igc.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Acked-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igc/igc_main.c

index 39f33afc479c1abffc9d4f1546c077d364bd26c4..e5b7e638df28b45ae88045b48337ec92b95a15aa 100644 (file)
@@ -753,6 +753,7 @@ u32 igb_rd32(struct e1000_hw *hw, u32 reg)
                struct net_device *netdev = igb->netdev;
                hw->hw_addr = NULL;
                netdev_err(netdev, "PCIe link lost\n");
+               WARN(1, "igb: Failed to read reg 0x%x!\n", reg);
        }
 
        return value;
index 34fa0e60a780af517c20b98dbc2b522de75b0192..28072b9aa932f2efcf06c954b0f84c38b4b064ae 100644 (file)
@@ -3934,6 +3934,7 @@ u32 igc_rd32(struct igc_hw *hw, u32 reg)
                hw->hw_addr = NULL;
                netif_device_detach(netdev);
                netdev_err(netdev, "PCIe link lost, device now detached\n");
+               WARN(1, "igc: Failed to read reg 0x%x!\n", reg);
        }
 
        return value;