diff options
author | Michael Chan | 2006-11-19 14:08:56 -0800 |
---|---|---|
committer | David S. Miller | 2006-12-02 21:24:21 -0800 |
commit | a16dda0e67cea666fb7eb708ab1199892c4a1a13 (patch) | |
tree | 527897ab67c49755ae9a6f166e1b852abf8dd503 /drivers/net | |
parent | f8dd064ee1bd62ef2cdb398cb9cdc8a8f112cb28 (diff) |
[BNX2]: Remove udelay() in copper PHY code.
Change a long udelay() in bnx2_setup_copper_phy() to msleep().
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index ea5daf6efa09..0a46b45f21dd 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -1159,7 +1159,6 @@ bnx2_setup_copper_phy(struct bnx2 *bp) } if (new_bmcr != bmcr) { u32 bmsr; - int i = 0; bnx2_read_phy(bp, MII_BMSR, &bmsr); bnx2_read_phy(bp, MII_BMSR, &bmsr); @@ -1167,12 +1166,12 @@ bnx2_setup_copper_phy(struct bnx2 *bp) if (bmsr & BMSR_LSTATUS) { /* Force link down */ bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK); - do { - udelay(100); - bnx2_read_phy(bp, MII_BMSR, &bmsr); - bnx2_read_phy(bp, MII_BMSR, &bmsr); - i++; - } while ((bmsr & BMSR_LSTATUS) && (i < 620)); + spin_unlock_bh(&bp->phy_lock); + msleep(50); + spin_lock_bh(&bp->phy_lock); + + bnx2_read_phy(bp, MII_BMSR, &bmsr); + bnx2_read_phy(bp, MII_BMSR, &bmsr); } bnx2_write_phy(bp, MII_BMCR, new_bmcr); |