]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2x: Prevent restarting Tx during bnx2x_nic_unload
authorVladislav Zolotarov <vladz@broadcom.com>
Tue, 2 Aug 2011 08:35:43 +0000 (01:35 -0700)
committerJoe Jin <joe.jin@oracle.com>
Wed, 16 May 2012 08:31:36 +0000 (16:31 +0800)
commit35ade1975453100babed321b98e6e791589a2adf
tree4006de44032613b5d7ee0c93ad93609f53c77e8a
parent3448c9f70c328c673bb4cfc130e217deaebb3d12
bnx2x: Prevent restarting Tx during bnx2x_nic_unload

Tx queues were stopped before  bp->state was changed to a value different
from BNX2X_STATE_OPEN, which allowed the bnx2x_tx_int() called from the
NAPI context to re-enable it. This then allowed the netdev->ndo_start_xmit()
to be called in the middle of the function reset and rings freeing.

This patch changes bp->state to a value different
from BNX2X_STATE_OPEN BEFORE disabling the Tx queues in order to restore the
broken protection against the above race in the bnx2x_tx_int().

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 87b7ba3d24a25cf18aece447de27d7804fa9668c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_cmn.c