From: Raju Rangoju <Raju.Rangoju@amd.com>
To: <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <Thomas.Lendacky@amd.com>,
<Shyam-sundar.S-k@amd.com>, Raju Rangoju <Raju.Rangoju@amd.com>
Subject: [PATCH net 3/3] amd-xgbe: propagate the correct speed and duplex status
Date: Wed, 22 Nov 2023 00:44:35 +0530 [thread overview]
Message-ID: <20231121191435.4049995-4-Raju.Rangoju@amd.com> (raw)
In-Reply-To: <20231121191435.4049995-1-Raju.Rangoju@amd.com>
xgbe_get_link_ksettings() does not propagate correct speed and duplex
information to ethtool during cable unplug. Due to which ethtool reports
incorrect values for speed and duplex.
Address this by propagating correct information.
Fixes: 7c12aa08779c ("amd-xgbe: Move the PHY support into amd-xgbe")
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
index 6e83ff59172a..32fab5e77246 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
@@ -314,10 +314,15 @@ static int xgbe_get_link_ksettings(struct net_device *netdev,
cmd->base.phy_address = pdata->phy.address;
- cmd->base.autoneg = pdata->phy.autoneg;
- cmd->base.speed = pdata->phy.speed;
- cmd->base.duplex = pdata->phy.duplex;
+ if (netif_carrier_ok(netdev)) {
+ cmd->base.speed = pdata->phy.speed;
+ cmd->base.duplex = pdata->phy.duplex;
+ } else {
+ cmd->base.speed = SPEED_UNKNOWN;
+ cmd->base.duplex = DUPLEX_UNKNOWN;
+ }
+ cmd->base.autoneg = pdata->phy.autoneg;
cmd->base.port = PORT_NONE;
XGBE_LM_COPY(cmd, supported, lks, supported);
--
2.25.1
next prev parent reply other threads:[~2023-11-21 19:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 19:14 [PATCH net 0/3] amd-xgbe: fixes to handle corner-cases Raju Rangoju
2023-11-21 19:14 ` [PATCH net 1/3] amd-xgbe: handle corner-case during sfp hotplug Raju Rangoju
2023-11-22 10:31 ` Wojciech Drewek
2023-11-21 19:14 ` [PATCH net 2/3] amd-xgbe: handle the corner-case during tx completion Raju Rangoju
2023-11-22 10:50 ` Wojciech Drewek
2023-11-25 14:53 ` Tom Lendacky
2023-11-21 19:14 ` Raju Rangoju [this message]
2023-11-22 10:53 ` [PATCH net 3/3] amd-xgbe: propagate the correct speed and duplex status Wojciech Drewek
2023-11-23 13:00 ` [PATCH net 0/3] amd-xgbe: fixes to handle corner-cases patchwork-bot+netdevbpf
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=20231121191435.4049995-4-Raju.Rangoju@amd.com \
--to=raju.rangoju@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Thomas.Lendacky@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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.