]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnxt_en: Fix RTNL lock usage on bnxt_update_link().
authorMichael Chan <michael.chan@broadcom.com>
Wed, 25 Jan 2017 07:55:08 +0000 (02:55 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 21:35:28 +0000 (13:35 -0800)
commit83ffcb9be6abb5bd866e1206c180efdbde6f75c2
tree510652a51c076633bdef001a13e20251a81a2b7e
parent6de81c9b12770c8a03933bf6e673ed86fab8d373
bnxt_en: Fix RTNL lock usage on bnxt_update_link().

Orabug: 25645429

bnxt_update_link() is called from multiple code paths.  Most callers,
such as open, ethtool, already hold RTNL.  Only the caller bnxt_sp_task()
does not.  So it is a bug to take RTNL inside bnxt_update_link().

Fix it by removing the RTNL inside bnxt_update_link().  The function
now expects the caller to always hold RTNL.

In bnxt_sp_task(), call bnxt_rtnl_lock_sp() before calling
bnxt_update_link().  We also need to move the call to the end of
bnxt_sp_task() since it will be clearing the BNXT_STATE_IN_SP_TASK bit.

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