mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josef Raschen <josef@raschen.org>
Cc: josef@raschen.org, Arun Ramadoss <arun.ramadoss@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] net: phy: microchip_t1: LAN887X: Fix device init issues.
Date: Thu, 25 Sep 2025 22:52:22 +0200	[thread overview]
Message-ID: <20250925205231.67764-1-josef@raschen.org> (raw)

Currently, for a LAN8870 phy, before link up, a call to ethtool to set
master-slave fails with 'operation not supported'. Reason: speed, duplex
and master/slave are not properly initialized.

This change sets proper initial states for speed and duplex and publishes
master-slave states. A default link up for speed 1000, full duplex and
slave mode then works without having to call ethtool.

Signed-off-by: Josef Raschen <josef@raschen.org>
---
 drivers/net/phy/microchip_t1.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c
index 62b36a318100..5fcbfa730910 100644
--- a/drivers/net/phy/microchip_t1.c
+++ b/drivers/net/phy/microchip_t1.c
@@ -1319,7 +1319,12 @@ static int lan887x_phy_init(struct phy_device *phydev)
 		return ret;
 
 	/* PHY interface setup */
-	return lan887x_config_phy_interface(phydev);
+	ret = lan887x_config_phy_interface(phydev);
+	if (ret < 0)
+		return ret;
+
+	/* Make configuration visible for ethtool. */
+	return genphy_c45_pma_baset1_read_master_slave(phydev);
 }
 
 static int lan887x_phy_config(struct phy_device *phydev,
@@ -1489,7 +1494,12 @@ static int lan887x_config_aneg(struct phy_device *phydev)
 	if (ret < 0)
 		return ret;
 
-	return lan887x_phy_reconfig(phydev);
+	ret = lan887x_phy_reconfig(phydev);
+	if (ret < 0)
+		return ret;
+
+	/* Make configuration changes visible for ethtool. */
+	return genphy_c45_pma_baset1_read_master_slave(phydev);
 }
 
 static int lan887x_probe(struct phy_device *phydev)
@@ -1503,6 +1513,10 @@ static int lan887x_probe(struct phy_device *phydev)
 	priv->init_done = false;
 	phydev->priv = priv;
 
+	/* Set default link parameters. */
+	phydev->duplex = DUPLEX_FULL;
+	phydev->speed = SPEED_1000;
+
 	return lan887x_phy_setup(phydev);
 }
 
-- 
2.43.0


             reply	other threads:[~2025-09-25 21:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-25 20:52 Josef Raschen [this message]
2025-09-25 22:00 ` Andrew Lunn
2025-09-26 21:24   ` Josef Raschen
2025-09-26 21:46     ` Andrew Lunn
2025-09-29 19:30       ` Josef Raschen
2025-10-03 12:59         ` Divya.Koppera
2025-10-06 18:44           ` Andrew Lunn
2025-10-07  6:01             ` Divya.Koppera

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=20250925205231.67764-1-josef@raschen.org \
    --to=josef@raschen.org \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®