summaryrefslogtreecommitdiff
path: root/drivers/net/bnx2x.h
diff options
context:
space:
mode:
authorVladislav Zolotarov <vladz@broadcom.com>2010-07-21 05:59:01 +0000
committerDavid S. Miller <davem@davemloft.net>2010-07-21 11:11:54 -0700
commita13773a53faa28cf79982601b6fc9ddb0ca45f36 (patch)
tree1eb2a88545d8ffe742648886b9da48446b6f0eb0 /drivers/net/bnx2x.h
parent573201f36fd9c7c6d5218cdcd9948cee700b277d (diff)
bnx2x: Protect a SM state change
Bug fix: Protect the statistics state machine state update with a spinlock. Otherwise there was a race condition that would cause the statistics to stay enabled despite the fact that they were disabled in the LINK_DOWN event handler. Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r--drivers/net/bnx2x.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
index 8bd23687c530..bb0872a63315 100644
--- a/drivers/net/bnx2x.h
+++ b/drivers/net/bnx2x.h
@@ -1062,6 +1062,10 @@ struct bnx2x {
/* used to synchronize stats collecting */
int stats_state;
+
+ /* used for synchronization of concurrent threads statistics handling */
+ spinlock_t stats_lock;
+
/* used by dmae command loader */
struct dmae_command stats_dmae;
int executer_idx;