• Michael Chan's avatar
    bnxt_en: Fix RTNL lock usage on bnxt_update_link(). · 0eaa24b9
    Michael Chan authored
    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: default avatarMichael Chan <michael.chan@broadcom.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0eaa24b9
bnxt.c 184 KB