]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnxt_en: Fix bnxt_reset() in the slow path task.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 25 Jan 2017 07:55:07 +0000 (02:55 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:35:28 +0000 (13:35 -0800)
commit6de81c9b12770c8a03933bf6e673ed86fab8d373
tree35c96a5291147f3c333a022e80b753bc631c9416
parentac3a42e262b35fdebc056e0f9b97bd73b9c95200
bnxt_en: Fix bnxt_reset() in the slow path task.

Orabug: 25645429

In bnxt_sp_task(), we set a bit BNXT_STATE_IN_SP_TASK so that bnxt_close()
will synchronize and wait for bnxt_sp_task() to finish.  Some functions
in bnxt_sp_task() require us to clear BNXT_STATE_IN_SP_TASK and then
acquire rtnl_lock() to prevent race conditions.

There are some bugs related to this logic. This patch refactors the code
to have common bnxt_rtnl_lock_sp() and bnxt_rtnl_unlock_sp() to handle
the RTNL and the clearing/setting of the bit.  Multiple functions will
need the same logic.  We also need to move bnxt_reset() to the end of
bnxt_sp_task().  Functions that clear BNXT_STATE_IN_SP_TASK must be the
last functions to be called in bnxt_sp_task().  The common scheme will
handle the condition properly.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a551ee94ea723b4af9b827c7460f108bc13425ee)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c