From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Russell King <linux@armlinux.org.uk>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-nex 2/2] net: mvneta: Don't speed down the PHY when changing mtu
Date: Mon, 27 Jul 2020 19:53:14 +0800 [thread overview]
Message-ID: <20200727195314.704dfaed@xhacker.debian> (raw)
In-Reply-To: <20200727195012.4bcd069d@xhacker.debian>
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
next prev parent reply other threads:[~2020-07-27 11:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-27 11:50 [PATCH net-nex 0/2] net: mvneta: improve phylink_speed_up/down usage Jisheng Zhang
2020-07-27 11:51 ` [PATCH net-nex 1/2] net: mvneta: fix comment about phylink_speed_down Jisheng Zhang
2020-07-27 11:53 ` Jisheng Zhang [this message]
2020-07-29 0:52 ` [PATCH net-nex 2/2] net: mvneta: Don't speed down the PHY when changing mtu David Miller
2020-07-29 9:53 ` Jisheng Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200727195314.704dfaed@xhacker.debian \
--to=jisheng.zhang@synaptics.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.