lkml.org 
[lkml]   [2020]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH net-nex 2/2] net: mvneta: Don't speed down the PHY when changing mtu
We found a case where the phy link speed is changed to 10Mbps
then back to 1000Mbps when changing the mtu:

ethtool -s eth0 wol g
ip link set eth0 mtu 1400

Add a simple check to avoid unnecessary phylink_speed_down() when
changing the mtu.

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
drivers/net/ethernet/marvell/mvneta.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c9b6b0f85bb0..9cdbb05277eb 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3651,7 +3651,8 @@ static void mvneta_stop_dev(struct mvneta_port *pp)

set_bit(__MVNETA_DOWN, &pp->state);

- if (device_may_wakeup(&pp->dev->dev))
+ if (device_may_wakeup(&pp->dev->dev) &&
+ pp->pkt_size == MVNETA_RX_PKT_SIZE(pp->dev->mtu))
phylink_speed_down(pp->phylink, false);

phylink_stop(pp->phylink);
--
2.28.0.rc0
\
 
 \ /
  Last update: 2020-07-27 13:55    [W:0.059 / U:1.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site