e1000/base: prevent ULP flow if cable connected
authorWenzhuo Lu <wenzhuo.lu@intel.com>
Fri, 16 Oct 2015 02:51:03 +0000 (10:51 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Tue, 27 Oct 2015 15:12:57 +0000 (16:12 +0100)
Enabling ulp on link down when cable is connect caused an infinite
loop of linkup/down indications in the NDIS driver.
After discussed, correct flow is to enable ULP only when cable is
disconnected.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
drivers/net/e1000/base/e1000_ich8lan.c

index 56a5e33..7b7c631 100644 (file)
@@ -1090,6 +1090,9 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx)
                          (E1000_READ_REG(hw, E1000_FEXT) &
                           E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not",
                          i * 50);
+               if (!(E1000_READ_REG(hw, E1000_FEXT) &
+                   E1000_FEXT_PHY_CABLE_DISCONNECTED))
+                       return 0;
        }
 
        if (E1000_READ_REG(hw, E1000_FWSM) & E1000_ICH_FWSM_FW_VALID) {