Patch "bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status()." has been added to the 4.9-stable tree
This is a note to let you know that I've just added the patch titled
bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status().
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
bnxt_en-fix-rtnl-lock-usage-on-bnxt_get_port_module_status.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Thu Jun 15 16:23:30 CEST 2017
From: Michael Chan <[email protected]>
Date: Wed, 25 Jan 2017 02:55:09 -0500
Subject: bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status().
From: Michael Chan <[email protected]>
[ Upstream commit 90c694bb71819fb5bd3501ac397307d7e41ddeca ]
bnxt_get_port_module_status() calls bnxt_update_link() which expects RTNL to be held. In bnxt_sp_task() that does not hold RTNL, we need to call it with a prior call to bnxt_rtnl_lock_sp() and the call needs to be moved to the end of bnxt_sp_task().
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +6 -3
@@ -6158,9 +6158,6 @@ static void bnxt_sp_task(struct work_strbnxt_hwrm_tunnel_dst_port_free ( bp,TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE ); } -if (test_and_clear_bit (BNXT_HWRM_PORT_MODULE_SP_EVENT , &bp->sp_event)) -bnxt_get_port_module_status (bp); -if (test_and_clear_bit (BNXT_PERIODIC_STATS_SP_EVENT , &bp->sp_event))bnxt_hwrm_port_qstats (bp);
@@ -6182,6 +6179,12 @@ static void bnxt_sp_task(struct work_strnetdev_err (bp->dev,"SP task can't update link (rc: %x)\n" , rc); } +if (test_and_clear_bit (BNXT_HWRM_PORT_MODULE_SP_EVENT , &bp->sp_event)) { +bnxt_rtnl_lock_sp (bp); +if (test_bit (BNXT_STATE_OPEN , &bp->state)) +bnxt_get_port_module_status (bp); +bnxt_rtnl_unlock_sp (bp); + }if (test_and_clear_bit (BNXT_RESET_TASK_SP_EVENT , &bp->sp_event))bnxt_reset (bp, false);
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/bnxt_en-fix-bnxt_reset-in-the-slow-path-task.patch queue-4.9/bnxt_en-enhance-autoneg-support.patch queue-4.9/bnxt_en-fix-rtnl-lock-usage-on-bnxt_update_link.patch queue-4.9/bnxt_en-fix-rtnl-lock-usage-on-bnxt_get_port_module_status.patch