aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <michael.chan@broadcom.com>2017-01-25 02:55:09 -0500
committerDavid S. Miller <davem@davemloft.net>2017-01-25 13:27:13 -0500
commit90c694bb71819fb5bd3501ac397307d7e41ddeca (patch)
treeda40ede4905d270f6a577197bd4c02ce932c5251
parent0eaa24b971ae251ae9d3be23f77662a655532063 (diff)
bnxt_en: Fix RTNL lock usage on bnxt_get_port_module_status().
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(). Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnxt/bnxt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 69b0fce4f5b3..4fcc6a84a087 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6259,9 +6259,6 @@ static void bnxt_sp_task(struct work_struct *work)
6259 bnxt_hwrm_tunnel_dst_port_free( 6259 bnxt_hwrm_tunnel_dst_port_free(
6260 bp, TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE); 6260 bp, TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_GENEVE);
6261 } 6261 }
6262 if (test_and_clear_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event))
6263 bnxt_get_port_module_status(bp);
6264
6265 if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event)) 6262 if (test_and_clear_bit(BNXT_PERIODIC_STATS_SP_EVENT, &bp->sp_event))
6266 bnxt_hwrm_port_qstats(bp); 6263 bnxt_hwrm_port_qstats(bp);
6267 6264
@@ -6283,6 +6280,12 @@ static void bnxt_sp_task(struct work_struct *work)
6283 netdev_err(bp->dev, "SP task can't update link (rc: %x)\n", 6280 netdev_err(bp->dev, "SP task can't update link (rc: %x)\n",
6284 rc); 6281 rc);
6285 } 6282 }
6283 if (test_and_clear_bit(BNXT_HWRM_PORT_MODULE_SP_EVENT, &bp->sp_event)) {
6284 bnxt_rtnl_lock_sp(bp);
6285 if (test_bit(BNXT_STATE_OPEN, &bp->state))
6286 bnxt_get_port_module_status(bp);
6287 bnxt_rtnl_unlock_sp(bp);
6288 }
6286 if (test_and_clear_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event)) 6289 if (test_and_clear_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event))
6287 bnxt_reset(bp, false); 6290 bnxt_reset(bp, false);
6288 6291