Skip to contentSkip to conversation

e1000: limit udelay for phy changes to 10000us

PATCH In review Andi Kleen 2 participants 3 messages Apr 21, 2013

Subsystems (3)
lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

PATCH 1/1 e1000: limit udelay for phy changes to 10000us

From: Andi Kleen <[email protected]>

If you really want 100000us you should really use mdelay or so.

Found by the LTO kernel build

---
 drivers/net/ethernet/intel/igb/e1000_phy.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igb/e1000_phy.c +3 -3
index 2918c97..a12a1c7 100644
@@ -1169,7 +1169,7 @@ s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw)
 
 		ret_val = igb_phy_has_link(hw,
 						     PHY_FORCE_LIMIT,
-						     100000,
+						     10000,
 						     &link);
 		if (ret_val)
 			goto out;
@@ -1180,7 +1180,7 @@ s32 igb_phy_force_speed_duplex_igp(struct e1000_hw *hw)
 		/* Try once more */
 		ret_val = igb_phy_has_link(hw,
 						     PHY_FORCE_LIMIT,
-						     100000,
+						     10000,
 						     &link);
 		if (ret_val)
 			goto out;
@@ -1642,7 +1642,7 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
 		 * it across the board.
 		 */
 		ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
-		if (ret_val) {
+		if (ret_val && usec_interval > 0) {
 			/*
 			 * If the first read fails, another entity may have
 			 * ownership of the resources, wait and try again to
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 10 lines · Andi Kleen

From: Andi Kleen <[email protected]>

If you really want 100000us you should really use mdelay or so.

Found by the LTO kernel build

---
 drivers/net/ethernet/intel/igb/e1000_phy.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-) 

Thanks Andi, I will add the patch to my igb queue. Do you want me to fix up the patch title as well? :-) (s/e1000/igb/)

author
#2 lore raw
Quoted 7 lines · Jeff Kirsher
Quoted 6 lines · Andi Kleen

From: Andi Kleen <[email protected]>

If you really want 100000us you should really use mdelay or so.

Found by the LTO kernel build

Quoted 7 lines
Quoted 4 lines
---
 drivers/net/ethernet/intel/igb/e1000_phy.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-) 

Thanks Andi, I will add the patch to my igb queue. Do you want me to fix up the patch title as well? :-) (s/e1000/igb/)

Sure please fix.

BTW I'm not sure my fix/value is right. If you really need 100000us you need some other mechanism to wait.

-Andi

Signature · 1 line
[email protected] -- Speaking for myself only.