]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From 3910c8ae44c59cebed721e33aa496f0a385b4e03 Mon Sep 17 00:00:00 2001 |
2 | From: Eilon Greenstein <eilong@broadcom.com> | |
3 | Date: Thu, 22 Jan 2009 06:01:32 +0000 | |
4 | Subject: bnx2x: loopback test failure | |
5 | Acked-by: Karsten Keil <kkeil@novell.com> | |
6 | Reference: bnc#472500 | |
7 | ||
8 | A link change interrupt might be queued and activated after the loopback was set | |
9 | and it will cause the loopback to fail. The PHY lock should be kept until the | |
10 | loopback test is over. | |
11 | ||
12 | That implies that the bnx2x_test_link should used within the loopback function | |
13 | and not bnx2x_wait_for_link since that function also takes the PHY link | |
14 | ||
15 | Signed-off-by: Eilon Greenstein <eilong@broadcom.com> | |
16 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
17 | --- | |
18 | drivers/net/bnx2x_main.c | 13 +++++++------ | |
19 | 1 files changed, 7 insertions(+), 6 deletions(-) | |
20 | ||
21 | Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
22 | =================================================================== | |
23 | --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c | |
24 | +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c | |
25 | @@ -8753,18 +8753,17 @@ static int bnx2x_run_loopback(struct bnx | |
26 | ||
27 | if (loopback_mode == BNX2X_MAC_LOOPBACK) { | |
28 | bp->link_params.loopback_mode = LOOPBACK_BMAC; | |
29 | - bnx2x_acquire_phy_lock(bp); | |
30 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | |
31 | - bnx2x_release_phy_lock(bp); | |
32 | ||
33 | } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { | |
34 | + u16 cnt = 1000; | |
35 | bp->link_params.loopback_mode = LOOPBACK_XGXS_10; | |
36 | - bnx2x_acquire_phy_lock(bp); | |
37 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | |
38 | - bnx2x_release_phy_lock(bp); | |
39 | /* wait until link state is restored */ | |
40 | - bnx2x_wait_for_link(bp, link_up); | |
41 | - | |
42 | + if (link_up) | |
43 | + while (cnt-- && bnx2x_test_link(&bp->link_params, | |
44 | + &bp->link_vars)) | |
45 | + msleep(10); | |
46 | } else | |
47 | return -EINVAL; | |
48 | ||
49 | @@ -8871,6 +8870,7 @@ static int bnx2x_test_loopback(struct bn | |
50 | return BNX2X_LOOPBACK_FAILED; | |
51 | ||
52 | bnx2x_netif_stop(bp, 1); | |
53 | + bnx2x_acquire_phy_lock(bp); | |
54 | ||
55 | if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { | |
56 | DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); | |
57 | @@ -8882,6 +8882,7 @@ static int bnx2x_test_loopback(struct bn | |
58 | rc |= BNX2X_PHY_LOOPBACK_FAILED; | |
59 | } | |
60 | ||
61 | + bnx2x_release_phy_lock(bp); | |
62 | bnx2x_netif_start(bp); | |
63 | ||
64 | return rc; |