mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
tg3: Add PHY reset for 5717/5719/5720 in change ring and flow control paths
[ Upstream commit 59663e4219 ]
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c7051eb3ac
commit
8e201ff714
@@ -12395,6 +12395,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) ||
|
||||
@@ -12426,7 +12427,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);
|
||||
}
|
||||
@@ -12460,6 +12467,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);
|
||||
@@ -12550,7 +12558,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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user