diff options
-rw-r--r-- | drivers/net/ethernet/broadcom/bnxt/bnxt.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 30d7d643bdbe..69b0fce4f5b3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c | |||
@@ -5314,17 +5314,12 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state) | |||
5314 | if ((link_info->support_auto_speeds | diff) != | 5314 | if ((link_info->support_auto_speeds | diff) != |
5315 | link_info->support_auto_speeds) { | 5315 | link_info->support_auto_speeds) { |
5316 | /* An advertised speed is no longer supported, so we need to | 5316 | /* An advertised speed is no longer supported, so we need to |
5317 | * update the advertisement settings. See bnxt_reset() for | 5317 | * update the advertisement settings. Caller holds RTNL |
5318 | * comments about the rtnl_lock() sequence below. | 5318 | * so we can modify link settings. |
5319 | */ | 5319 | */ |
5320 | clear_bit(BNXT_STATE_IN_SP_TASK, &bp->state); | ||
5321 | rtnl_lock(); | ||
5322 | link_info->advertising = link_info->support_auto_speeds; | 5320 | link_info->advertising = link_info->support_auto_speeds; |
5323 | if (test_bit(BNXT_STATE_OPEN, &bp->state) && | 5321 | if (link_info->autoneg & BNXT_AUTONEG_SPEED) |
5324 | (link_info->autoneg & BNXT_AUTONEG_SPEED)) | ||
5325 | bnxt_hwrm_set_link_setting(bp, true, false); | 5322 | bnxt_hwrm_set_link_setting(bp, true, false); |
5326 | set_bit(BNXT_STATE_IN_SP_TASK, &bp->state); | ||
5327 | rtnl_unlock(); | ||
5328 | } | 5323 | } |
5329 | return 0; | 5324 | return 0; |
5330 | } | 5325 | } |
@@ -6231,7 +6226,6 @@ static void bnxt_cfg_ntp_filters(struct bnxt *); | |||
6231 | static void bnxt_sp_task(struct work_struct *work) | 6226 | static void bnxt_sp_task(struct work_struct *work) |
6232 | { | 6227 | { |
6233 | struct bnxt *bp = container_of(work, struct bnxt, sp_task); | 6228 | struct bnxt *bp = container_of(work, struct bnxt, sp_task); |
6234 | int rc; | ||
6235 | 6229 | ||
6236 | set_bit(BNXT_STATE_IN_SP_TASK, &bp->state); | 6230 | set_bit(BNXT_STATE_IN_SP_TASK, &bp->state); |
6237 | smp_mb__after_atomic(); | 6231 | smp_mb__after_atomic(); |
@@ -6245,16 +6239,6 @@ static void bnxt_sp_task(struct work_struct *work) | |||
6245 | 6239 | ||
6246 | if (test_and_clear_bit(BNXT_RX_NTP_FLTR_SP_EVENT, &bp->sp_event)) | 6240 | if (test_and_clear_bit(BNXT_RX_NTP_FLTR_SP_EVENT, &bp->sp_event)) |
6247 | bnxt_cfg_ntp_filters(bp); | 6241 | bnxt_cfg_ntp_filters(bp); |
6248 | if (test_and_clear_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event)) { | ||
6249 | if (test_and_clear_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, | ||
6250 | &bp->sp_event)) | ||
6251 | bnxt_hwrm_phy_qcaps(bp); | ||
6252 | |||
6253 | rc = bnxt_update_link(bp, true); | ||
6254 | if (rc) | ||
6255 | netdev_err(bp->dev, "SP task can't update link (rc: %x)\n", | ||
6256 | rc); | ||
6257 | } | ||
6258 | if (test_and_clear_bit(BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT, &bp->sp_event)) | 6242 | if (test_and_clear_bit(BNXT_HWRM_EXEC_FWD_REQ_SP_EVENT, &bp->sp_event)) |
6259 | bnxt_hwrm_exec_fwd_req(bp); | 6243 | bnxt_hwrm_exec_fwd_req(bp); |
6260 | if (test_and_clear_bit(BNXT_VXLAN_ADD_PORT_SP_EVENT, &bp->sp_event)) { | 6244 | if (test_and_clear_bit(BNXT_VXLAN_ADD_PORT_SP_EVENT, &bp->sp_event)) { |
@@ -6284,6 +6268,21 @@ static void bnxt_sp_task(struct work_struct *work) | |||
6284 | /* These functions below will clear BNXT_STATE_IN_SP_TASK. They | 6268 | /* These functions below will clear BNXT_STATE_IN_SP_TASK. They |
6285 | * must be the last functions to be called before exiting. | 6269 | * must be the last functions to be called before exiting. |
6286 | */ | 6270 | */ |
6271 | if (test_and_clear_bit(BNXT_LINK_CHNG_SP_EVENT, &bp->sp_event)) { | ||
6272 | int rc = 0; | ||
6273 | |||
6274 | if (test_and_clear_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, | ||
6275 | &bp->sp_event)) | ||
6276 | bnxt_hwrm_phy_qcaps(bp); | ||
6277 | |||
6278 | bnxt_rtnl_lock_sp(bp); | ||
6279 | if (test_bit(BNXT_STATE_OPEN, &bp->state)) | ||
6280 | rc = bnxt_update_link(bp, true); | ||
6281 | bnxt_rtnl_unlock_sp(bp); | ||
6282 | if (rc) | ||
6283 | netdev_err(bp->dev, "SP task can't update link (rc: %x)\n", | ||
6284 | rc); | ||
6285 | } | ||
6287 | if (test_and_clear_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event)) | 6286 | if (test_and_clear_bit(BNXT_RESET_TASK_SP_EVENT, &bp->sp_event)) |
6288 | bnxt_reset(bp, false); | 6287 | bnxt_reset(bp, false); |
6289 | 6288 | ||