bnx2x: Move statistics implementation into semaphores
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Mon, 1 Jun 2015 12:08:18 +0000 (15:08 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Jun 2015 19:04:31 +0000 (12:04 -0700)
commitc6e36d8c1a76be7a7afa2669483857dadec1e99c
tree6ba06f3353eaff41b0a9ccc01d9418033a3e4ed5
parent31a418986a5852034d520a5bab546821ff1ccf3d
bnx2x: Move statistics implementation into semaphores

Commit dff173de84958 ("bnx2x: Fix statistics locking scheme") changed the
bnx2x locking around statistics state into using a mutex - but the lock
is being accessed via a timer which is forbidden.

[If compiled with CONFIG_DEBUG_MUTEXES, logs show a warning about
accessing the mutex in interrupt context]

This moves the implementation into using a semaphore [with size '1']
instead.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c