netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] bnxt_en: Phy related fixes.
@ 2016-02-20  0:43 Michael Chan
  2016-02-20  0:43 ` [PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic() Michael Chan
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Michael Chan @ 2016-02-20  0:43 UTC (permalink / raw)
  To: davem; +Cc: netdev

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic().
  2016-02-20  0:43 [PATCH net 0/3] bnxt_en: Phy related fixes Michael Chan
@ 2016-02-20  0:43 ` Michael Chan
  2016-02-20  0:43 ` [PATCH net 2/3] bnxt_en: Remove unnecessary call to update PHY settings Michael Chan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2016-02-20  0:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan

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 <michael.chan@broadcom.com>
---
 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net 2/3] bnxt_en: Remove unnecessary call to update PHY settings.
  2016-02-20  0:43 [PATCH net 0/3] bnxt_en: Phy related fixes Michael Chan
  2016-02-20  0:43 ` [PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic() Michael Chan
@ 2016-02-20  0:43 ` Michael Chan
  2016-02-20  0:43 ` [PATCH net 3/3] bnxt_en: Failure to update PHY is not fatal condition Michael Chan
  2016-02-20  4:40 ` [PATCH net 0/3] bnxt_en: Phy related fixes David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2016-02-20  0:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net 3/3] bnxt_en: Failure to update PHY is not fatal condition.
  2016-02-20  0:43 [PATCH net 0/3] bnxt_en: Phy related fixes Michael Chan
  2016-02-20  0:43 ` [PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic() Michael Chan
  2016-02-20  0:43 ` [PATCH net 2/3] bnxt_en: Remove unnecessary call to update PHY settings Michael Chan
@ 2016-02-20  0:43 ` Michael Chan
  2016-02-20  4:40 ` [PATCH net 0/3] bnxt_en: Phy related fixes David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2016-02-20  0:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/3] bnxt_en: Phy related fixes.
  2016-02-20  0:43 [PATCH net 0/3] bnxt_en: Phy related fixes Michael Chan
                   ` (2 preceding siblings ...)
  2016-02-20  0:43 ` [PATCH net 3/3] bnxt_en: Failure to update PHY is not fatal condition Michael Chan
@ 2016-02-20  4:40 ` David Miller
  2016-02-20  6:08   ` Michael Chan
  3 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2016-02-20  4:40 UTC (permalink / raw)
  To: michael.chan; +Cc: netdev

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.....

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net 0/3] bnxt_en: Phy related fixes.
  2016-02-20  4:40 ` [PATCH net 0/3] bnxt_en: Phy related fixes David Miller
@ 2016-02-20  6:08   ` Michael Chan
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Chan @ 2016-02-20  6:08 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Fri, Feb 19, 2016 at 8:40 PM, David Miller <davem@davemloft.net> wrote:
> 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.....

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-20  6:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-20  0:43 [PATCH net 0/3] bnxt_en: Phy related fixes Michael Chan
2016-02-20  0:43 ` [PATCH net 1/3] bnxt_en: Poll link at the end of __bnxt_open_nic() Michael Chan
2016-02-20  0:43 ` [PATCH net 2/3] bnxt_en: Remove unnecessary call to update PHY settings Michael Chan
2016-02-20  0:43 ` [PATCH net 3/3] bnxt_en: Failure to update PHY is not fatal condition Michael Chan
2016-02-20  4:40 ` [PATCH net 0/3] bnxt_en: Phy related fixes David Miller
2016-02-20  6:08   ` Michael Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).