Skip to content

Commit df29df9

Browse files
Carolyn Wybornydavem330
authored andcommitted
igb: Fix for issue where values could be too high for udelay function.
This patch changes the igb_phy_has_link function to check the value of the parameter before deciding to use udelay or mdelay in order to be sure that the value is not too high for udelay function. CC: stable kernel <stable@vger.kernel.org> # 3.9+ Signed-off-by: Sunil K Pandey <sunil.k.pandey@intel.com> Signed-off-by: Kevin B Smith <kevin.b.smith@intel.com> Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3c325ce commit df29df9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/igb/e1000_phy.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,10 @@ s32 igb_phy_has_link(struct e1000_hw *hw, u32 iterations,
17281728
* ownership of the resources, wait and try again to
17291729
* see if they have relinquished the resources yet.
17301730
*/
1731-
udelay(usec_interval);
1731+
if (usec_interval >= 1000)
1732+
mdelay(usec_interval/1000);
1733+
else
1734+
udelay(usec_interval);
17321735
}
17331736
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
17341737
if (ret_val)

0 commit comments

Comments
 (0)