From: Michael Chan Date: Fri, 11 Nov 2016 05:11:43 +0000 (-0500) Subject: bnxt_en: Fix VF virtual link state. X-Git-Tag: v4.1.12-92~10^2~27 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f2d4dd2735893828c05421431baa1d5da05cabc4;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Fix VF virtual link state. Orabug: 24567991 If the physical link is down and the VF virtual link is set to "enable", the current code does not always work. If the link is down but the cable is attached, the firmware returns LINK_SIGNAL instead of NO_LINK. The current code is treating LINK_SIGNAL as link up. The fix is to treat link as down when the link_status != LINK. Signed-off-by: Michael Chan Signed-off-by: David S. Miller (cherry picked from commit 73b9bad63ae3c902ce64221d10a0d371d059748d) Signed-off-by: Brian Maly Signed-off-by: Dhaval Giani --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c index 8be718508600b..1dbb762eeaff9 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c @@ -770,8 +770,8 @@ static int bnxt_vf_set_link(struct bnxt *bp, struct bnxt_vf_info *vf) if (vf->flags & BNXT_VF_LINK_UP) { /* if physical link is down, force link up on VF */ - if (phy_qcfg_resp.link == - PORT_PHY_QCFG_RESP_LINK_NO_LINK) { + if (phy_qcfg_resp.link != + PORT_PHY_QCFG_RESP_LINK_LINK) { phy_qcfg_resp.link = PORT_PHY_QCFG_RESP_LINK_LINK; phy_qcfg_resp.link_speed = cpu_to_le16(