[PATCH net 0/3] bnxt_en: Phy related fixes.

STALE3855d

6 messages, 2 authors, 2016-02-20 · open the first message on its own page

[PATCH net 0/3] bnxt_en: Phy related fixes.

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-20 00:43:24

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(-)

-- 
1.8.3.1

[PATCH net 3/3] bnxt_en: Failure to update PHY is not fatal condition.

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-20 00:43:24

From: Michael Chan <mchan@broadcom.com>

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.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 78f6b5a..8ab000d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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) {
-- 
1.8.3.1

[PATCH net 2/3] bnxt_en: Remove unnecessary call to update PHY settings.

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-20 00:43:24

From: Michael Chan <mchan@broadcom.com>

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.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 9b56058..78f6b5a 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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)
-- 
1.8.3.1

[PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic().

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-20 00:43:24

From: Michael Chan <mchan@broadcom.com>

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 [off-list ref]
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 82f4e6d..9b56058 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -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;
 
-- 
1.8.3.1

Re: [PATCH net 0/3] bnxt_en: Phy related fixes.

From: David Miller <davem@davemloft.net>
Date: 2016-02-20 04:40:09

From: Michael Chan <michael.chan@broadcom.com>
Date: Fri, 19 Feb 2016 19:43:18 -0500
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.....

Re: [PATCH net 0/3] bnxt_en: Phy related fixes.

From: Michael Chan <michael.chan@broadcom.com>
Date: 2016-02-20 06:08:33

On Fri, Feb 19, 2016 at 8:40 PM, David Miller [off-list ref] wrote:
From: Michael Chan <michael.chan@broadcom.com>
Date: Fri, 19 Feb 2016 19:43:18 -0500
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help