bnxt_en: Phy related fixes.
Michael Chan
maintainercover bnxt_en: Phy related fixes.
3 small patches to fix PHY related code.
Michael Chan (3):
bnxt_en: Poll link at the end of __bnxt_open_nic().
bnxt_en: Remove unnecessary call to update PHY settings.
bnxt_en: Failure to update PHY is not fatal condition.
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 1/3 bnxt_en: Poll link at the end of __bnxt_open_nic().
From: Michael Chan <[email protected]>
When shutting down the NIC, we shutdown async event processing before freeing all the rings. If there is a link change event during reset, the driver may miss it and the link state may be incorrect after the NIC is re-opened. Poll the link at the end of __bnxt_open_nic() to get the correct link status.
Signed-off-by Michael Chan <[email protected]>
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
@@ -4662,6 +4662,7 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)/* Enable TX queues */ bnxt_tx_enable (bp);mod_timer (&bp->timer, jiffies + bp->current_interval); +bnxt_update_link (bp, true);return 0 ;
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 2/3 bnxt_en: Remove unnecessary call to update PHY settings.
In reply to Michael ChanFrom: Michael Chan <[email protected]>
Fix bnxt_update_phy_setting() to check the correct parameters when determining whether to update the PHY. Requested line speed/duplex should only be checked for forced speed mode. This avoids unnecessary link interruptions when loading the driver.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -4
@@ -4554,20 +4554,18 @@ static int bnxt_update_phy_setting(struct bnxt *bp)if (!(link_info->autoneg &BNXT_AUTONEG_FLOW_CTRL ) && link_info->force_pause_setting != link_info->req_flow_ctrl) update_pause = true; -if (link_info->req_duplex != link_info->duplex_setting) - update_link = true;if (!(link_info->autoneg &BNXT_AUTONEG_SPEED )) {if (BNXT_AUTO_MODE (link_info->auto_mode)) update_link = true;if (link_info->req_link_speed != link_info->force_link_speed) update_link = true; +if (link_info->req_duplex != link_info->duplex_setting) + update_link = true; }else {if (link_info->auto_mode ==BNXT_LINK_AUTO_NONE ) update_link = true;if (link_info->advertising != link_info->auto_link_speeds) update_link = true; -if (link_info->req_link_speed != link_info->auto_link_speed) - update_link = true; }if (update_link)
Signature · 1 line
1.8.3.1
Michael Chan
maintainerPATCH 3/3 bnxt_en: Failure to update PHY is not fatal condition.
In reply to Michael ChanFrom: Michael Chan <[email protected]>
If we fail to update the PHY, we should print a warning and continue. The current code to exit is buggy as it has not freed up the NIC resources yet.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -1
@@ -4642,7 +4642,7 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)if (link_re_init) { rc =bnxt_update_phy_setting (bp);if (rc) - goto open_err; +netdev_warn (bp->dev,"failed to update phy settings\n" ); }if (irq_re_init) {
Signature · 1 line
1.8.3.1
David Miller
maintainerFrom: Michael Chan <[email protected]>
Date: Fri, 19 Feb 2016 19:43:18 -0500
Quoted 1 line
3 small patches to fix PHY related code.
Series applied, thanks Michael.
Although I'm not so sure how wise it is to not fail an ->open() if the PHY settings fail.....
Michael Chan
maintainerQuoted 9 lines · David Miller
From: Michael Chan <[email protected]>
Date: Fri, 19 Feb 2016 19:43:18 -0500Quoted 1 line
3 small patches to fix PHY related code.
Series applied, thanks Michael.
Although I'm not so sure how wise it is to not fail an ->open() if the PHY settings fail.....
The firmware will still have default settings for the PHY. More importantly, for the VF, the call doesn't do anything real and we should allow the VF to proceed if the call fails. Thanks.