netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
@ 2018-11-20  4:34 Siva Reddy Kallam
  2018-11-20 18:18 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Siva Reddy Kallam @ 2018-11-20  4:34 UTC (permalink / raw)
  To: davem; +Cc: netdev, michael.chan, prashant, Siva Reddy Kallam

From: Siva Reddy Kallam <siva.kallam@broadcom.com>

This patch has the fix to avoid PHY lockup with 5717/5719/5720 in change
ring and flow control paths. This patch solves the RX hang while doing
continuous ring or flow control parameters with heavy traffic from peer.

Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
Acked-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 8929530..432c3b8 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -12422,6 +12422,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
 {
 	struct tg3 *tp = netdev_priv(dev);
 	int i, irq_sync = 0, err = 0;
+	bool reset_phy = false;
 
 	if ((ering->rx_pending > tp->rx_std_ring_mask) ||
 	    (ering->rx_jumbo_pending > tp->rx_jmb_ring_mask) ||
@@ -12453,7 +12454,13 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
 
 	if (netif_running(dev)) {
 		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-		err = tg3_restart_hw(tp, false);
+		/* Reset PHY to avoid PHY lock up */
+		if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
+		    tg3_asic_rev(tp) == ASIC_REV_5719 ||
+		    tg3_asic_rev(tp) == ASIC_REV_5720)
+			reset_phy = true;
+
+		err = tg3_restart_hw(tp, reset_phy);
 		if (!err)
 			tg3_netif_start(tp);
 	}
@@ -12487,6 +12494,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
 {
 	struct tg3 *tp = netdev_priv(dev);
 	int err = 0;
+	bool reset_phy = false;
 
 	if (tp->link_config.autoneg == AUTONEG_ENABLE)
 		tg3_warn_mgmt_link_flap(tp);
@@ -12556,7 +12564,13 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
 
 		if (netif_running(dev)) {
 			tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-			err = tg3_restart_hw(tp, false);
+			/* Reset PHY to avoid PHY lock up */
+			if (tg3_asic_rev(tp) == ASIC_REV_5717 ||
+			    tg3_asic_rev(tp) == ASIC_REV_5719 ||
+			    tg3_asic_rev(tp) == ASIC_REV_5720)
+				reset_phy = true;
+
+			err = tg3_restart_hw(tp, reset_phy);
 			if (!err)
 				tg3_netif_start(tp);
 		}
-- 
1.8.3.1

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

* Re: [PATCH net] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
  2018-11-20  4:34 [PATCH net] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths Siva Reddy Kallam
@ 2018-11-20 18:18 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-11-20 18:18 UTC (permalink / raw)
  To: siva.kallam; +Cc: netdev, michael.chan, prashant, siva.kallam

From: Siva Reddy Kallam <siva.kallam@broadom.com>
Date: Tue, 20 Nov 2018 10:04:04 +0530

> From: Siva Reddy Kallam <siva.kallam@broadcom.com>
> 
> This patch has the fix to avoid PHY lockup with 5717/5719/5720 in change
> ring and flow control paths. This patch solves the RX hang while doing
> continuous ring or flow control parameters with heavy traffic from peer.
> 
> Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
> Acked-by: Michael Chan <michael.chan@broadcom.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2018-11-21  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-20  4:34 [PATCH net] tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths Siva Reddy Kallam
2018-11-20 18:18 ` David Miller

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