]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.39/patches.drivers/bnx2x-Protecting-the-link-change-indication.patch
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / bnx2x-Protecting-the-link-change-indication.patch
1 From a5e9a7cfad5fd301ce2b7869bbf386b70aa39e7c Mon Sep 17 00:00:00 2001
2 From: Eilon Greenstein <eilong@broadcom.com>
3 Date: Wed, 14 Jan 2009 21:26:01 -0800
4 Subject: bnx2x: Protecting the link change indication
5 Acked-by: Karsten Keil <kkeil@novell.com>
6 Reference: bnc#472500
7
8 Without this lock, in some race conditions the driver missed link
9 change indication
10
11 Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
12 Signed-off-by: David S. Miller <davem@davemloft.net>
13 ---
14 drivers/net/bnx2x_main.c | 8 +++++---
15 1 files changed, 5 insertions(+), 3 deletions(-)
16
17 Index: linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
18 ===================================================================
19 --- linux-2.6.27-bnx2x_2.orig/drivers/net/bnx2x_main.c
20 +++ linux-2.6.27-bnx2x_2/drivers/net/bnx2x_main.c
21 @@ -2237,9 +2237,7 @@ static void bnx2x_link_attn(struct bnx2x
22 /* Make sure that we are synced with the current statistics */
23 bnx2x_stats_handle(bp, STATS_EVENT_STOP);
24
25 - bnx2x_acquire_phy_lock(bp);
26 bnx2x_link_update(&bp->link_params, &bp->link_vars);
27 - bnx2x_release_phy_lock(bp);
28
29 if (bp->link_vars.link_up) {
30
31 @@ -2488,6 +2486,8 @@ static void bnx2x_attn_int_asserted(stru
32 if (asserted & ATTN_HARD_WIRED_MASK) {
33 if (asserted & ATTN_NIG_FOR_FUNC) {
34
35 + bnx2x_acquire_phy_lock(bp);
36 +
37 /* save nig interrupt mask */
38 bp->nig_mask = REG_RD(bp, nig_int_mask_addr);
39 REG_WR(bp, nig_int_mask_addr, 0);
40 @@ -2543,8 +2543,10 @@ static void bnx2x_attn_int_asserted(stru
41 REG_WR(bp, hc_addr, asserted);
42
43 /* now set back the mask */
44 - if (asserted & ATTN_NIG_FOR_FUNC)
45 + if (asserted & ATTN_NIG_FOR_FUNC) {
46 REG_WR(bp, nig_int_mask_addr, bp->nig_mask);
47 + bnx2x_release_phy_lock(bp);
48 + }
49 }
50
51 static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn)