diff options
author | Matt Carlson <mcarlson@broadcom.com> | 2011-01-25 15:58:54 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-25 19:38:19 -0800 |
commit | ab78904608bd6e421b81420e4d2f7d5bae9d4660 (patch) | |
tree | a0a6029c86b8c5a37b50afea5eff95f78f7902c9 /drivers/net/tg3.c | |
parent | aba49f2421d5287692aee961ab4ce2981fdf4939 (diff) |
tg3: Disable EEE during loopback tests
EEE interferes with the hardware's ability to loop a packet back to the
host. This patch disables the feature for the duration of the test.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index f52466d2ece..c333481deb1 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -11013,14 +11013,19 @@ out: static int tg3_test_loopback(struct tg3 *tp) { int err = 0; - u32 cpmuctrl = 0; + u32 eee_cap, cpmuctrl = 0; if (!netif_running(tp->dev)) return TG3_LOOPBACK_FAILED; + eee_cap = tp->phy_flags & TG3_PHYFLG_EEE_CAP; + tp->phy_flags &= ~TG3_PHYFLG_EEE_CAP; + err = tg3_reset_hw(tp, 1); - if (err) - return TG3_LOOPBACK_FAILED; + if (err) { + err = TG3_LOOPBACK_FAILED; + goto done; + } /* Turn off gphy autopowerdown. */ if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD) @@ -11040,8 +11045,10 @@ static int tg3_test_loopback(struct tg3 *tp) udelay(10); } - if (status != CPMU_MUTEX_GNT_DRIVER) - return TG3_LOOPBACK_FAILED; + if (status != CPMU_MUTEX_GNT_DRIVER) { + err = TG3_LOOPBACK_FAILED; + goto done; + } /* Turn off link-based power management. */ cpmuctrl = tr32(TG3_CPMU_CTRL); @@ -11070,6 +11077,9 @@ static int tg3_test_loopback(struct tg3 *tp) if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD) tg3_phy_toggle_apd(tp, true); +done: + tp->phy_flags |= eee_cap; + return err; } |