]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Improve link up detection.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 27 Jan 2020 09:56:13 +0000 (04:56 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jan 2020 10:33:28 +0000 (11:33 +0100)
commit4b0f4372159a8c2b8f294d3a364a232eab17cf2f
treec7c4929c6abec8d5fdd877d77e862eea41783ef5
parent90940bab951c5e8c8bf1e901ce5c2c0f8f9dbc16
bnxt_en: Improve link up detection.

In bnxt_update_phy_setting(), ethtool_get_link_ksettings() and
bnxt_disable_an_for_lpbk(), we inconsistently use netif_carrier_ok()
to determine link.  Instead, we should use bp->link_info.link_up
which has the true link state.  The netif_carrier state may be off
during self-test and while the device is being reset and may not always
reflect the true link state.

By always using bp->link_info.link_up, the code is now more
consistent and more correct.  Some unnecessary link toggles are
now prevented with this patch.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c