Netdev List
 help / color / mirror / Atom feed
From: Romain Gantois <romain.gantois@bootlin.com>
To: 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>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	netdev@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Romain Gantois <romain.gantois@bootlin.com>
Subject: [PATCH net-next v2 1/3] net: phy: dp83869: Restart PHY when configuring mode
Date: Mon, 10 Nov 2025 10:24:53 +0100	[thread overview]
Message-ID: <20251110-sfp-1000basex-v2-1-dd5e8c1f5652@bootlin.com> (raw)
In-Reply-To: <20251110-sfp-1000basex-v2-0-dd5e8c1f5652@bootlin.com>

The DP83869 PHY requires a software restart when the OP_MODE is changed.

Add this restart in dp83869_configure_mode().

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
---
 drivers/net/phy/dp83869.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c
index 1f381d7b13ff..309bf608d630 100644
--- a/drivers/net/phy/dp83869.c
+++ b/drivers/net/phy/dp83869.c
@@ -792,11 +792,17 @@ static int dp83869_configure_mode(struct phy_device *phydev,
 	case DP83869_RGMII_1000_BASE:
 	case DP83869_RGMII_100_BASE:
 		ret = dp83869_configure_fiber(phydev, dp83869);
+		if (ret)
+			return ret;
 		break;
 	default:
 		return -EINVAL;
 	}
 
+	ret = phy_write(phydev, DP83869_CTRL, DP83869_SW_RESTART);
+
+	usleep_range(10, 20);
+
 	return ret;
 }
 

-- 
2.51.2


  reply	other threads:[~2025-11-10  9:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10  9:24 [PATCH net-next v2 0/3] net: phy: dp83869: Support 1000Base-X SFP Romain Gantois
2025-11-10  9:24 ` Romain Gantois [this message]
2025-11-11  1:02   ` [PATCH net-next v2 1/3] net: phy: dp83869: Restart PHY when configuring mode Andrew Lunn
2025-11-10  9:24 ` [PATCH net-next v2 2/3] net: phy: dp83869: ensure FORCE_LINK_GOOD is cleared Romain Gantois
2025-11-11  1:03   ` Andrew Lunn
2025-11-10  9:24 ` [PATCH net-next v2 3/3] net: phy: dp83869: Support 1000Base-X SFP Romain Gantois
2025-11-11  1:08   ` Andrew Lunn
2025-11-13  9:27     ` Romain Gantois
2026-02-13 12:31 ` [PATCH net-next v2 0/3] " Álvaro G. M.

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=20251110-sfp-1000basex-v2-1-dd5e8c1f5652@bootlin.com \
    --to=romain.gantois@bootlin.com \
    --cc=andrew@lunn.ch \
    --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=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox