Răsfoiți Sursa

e1000e: do not write SmartSpeed register bits on parts without support

The driver was accessing register bits for features on parts that do
not support that feature.  This could cause problems in the hardware.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan 16 ani în urmă
părinte
comite
60f1292fcb
1 a modificat fișierele cu 15 adăugiri și 4 ștergeri
  1. 15 4
      drivers/net/e1000e/ich8lan.c

+ 15 - 4
drivers/net/e1000e/ich8lan.c

@@ -977,12 +977,14 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
 		phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU;
 		phy_ctrl |= E1000_PHY_CTRL_D0A_LPLU;
 		ew32(PHY_CTRL, phy_ctrl);
 		ew32(PHY_CTRL, phy_ctrl);
 
 
+		if (phy->type != e1000_phy_igp_3)
+			return 0;
+
 		/*
 		/*
 		 * Call gig speed drop workaround on LPLU before accessing
 		 * Call gig speed drop workaround on LPLU before accessing
 		 * any PHY registers
 		 * any PHY registers
 		 */
 		 */
-		if ((hw->mac.type == e1000_ich8lan) &&
-		    (hw->phy.type == e1000_phy_igp_3))
+		if (hw->mac.type == e1000_ich8lan)
 			e1000e_gig_downshift_workaround_ich8lan(hw);
 			e1000e_gig_downshift_workaround_ich8lan(hw);
 
 
 		/* When LPLU is enabled, we should disable SmartSpeed */
 		/* When LPLU is enabled, we should disable SmartSpeed */
@@ -995,6 +997,9 @@ static s32 e1000_set_d0_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
 		phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU;
 		phy_ctrl &= ~E1000_PHY_CTRL_D0A_LPLU;
 		ew32(PHY_CTRL, phy_ctrl);
 		ew32(PHY_CTRL, phy_ctrl);
 
 
+		if (phy->type != e1000_phy_igp_3)
+			return 0;
+
 		/*
 		/*
 		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
 		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
 		 * during Dx states where the power conservation is most
 		 * during Dx states where the power conservation is most
@@ -1054,6 +1059,10 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
 	if (!active) {
 	if (!active) {
 		phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU;
 		phy_ctrl &= ~E1000_PHY_CTRL_NOND0A_LPLU;
 		ew32(PHY_CTRL, phy_ctrl);
 		ew32(PHY_CTRL, phy_ctrl);
+
+		if (phy->type != e1000_phy_igp_3)
+			return 0;
+
 		/*
 		/*
 		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
 		 * LPLU and SmartSpeed are mutually exclusive.  LPLU is used
 		 * during Dx states where the power conservation is most
 		 * during Dx states where the power conservation is most
@@ -1089,12 +1098,14 @@ static s32 e1000_set_d3_lplu_state_ich8lan(struct e1000_hw *hw, bool active)
 		phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU;
 		phy_ctrl |= E1000_PHY_CTRL_NOND0A_LPLU;
 		ew32(PHY_CTRL, phy_ctrl);
 		ew32(PHY_CTRL, phy_ctrl);
 
 
+		if (phy->type != e1000_phy_igp_3)
+			return 0;
+
 		/*
 		/*
 		 * Call gig speed drop workaround on LPLU before accessing
 		 * Call gig speed drop workaround on LPLU before accessing
 		 * any PHY registers
 		 * any PHY registers
 		 */
 		 */
-		if ((hw->mac.type == e1000_ich8lan) &&
-		    (hw->phy.type == e1000_phy_igp_3))
+		if (hw->mac.type == e1000_ich8lan)
 			e1000e_gig_downshift_workaround_ich8lan(hw);
 			e1000e_gig_downshift_workaround_ich8lan(hw);
 
 
 		/* When LPLU is enabled, we should disable SmartSpeed */
 		/* When LPLU is enabled, we should disable SmartSpeed */