๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #15372

Re: [EXTERNAL] [PATCH net] net: marvell: prestera: disable port before changing its MAC mode

#15372
From: "Imre Kaloz"
Date: Thu, 12 Nov 2026 18:50
42 lines
11792 bytes
Hi Elad,

On Thu, Nov 12, 2026, at 09:22, Elad Nachman wrote:

>> > From my experience, if you take the port down, it takes time for the firmware
>> > state machine to act accordingly, so you need some significant delay here
>> > (1-3 seconds) before you write the new configuration.
>> 
>> Thanks Elad. I found this bringing up the SFP+ ports on a Delta TN48M
>> (98DX3265) with firmware 4.1.0. With an S-RJ01 module in sfp-52,
>> the port came up in 30 of 30 boots with this patch, about 2.1 s after
>> link up, and in 21 of 30 without it. The disable write waits for the
>> firmwareโ€™s acknowledgement, and I saw no failures without a delay.
>> 
>> Is the delay needed on particular firmware versions or devices? This
>> path runs under rtnl when an SFP module changes the mode, so I would
>> rather not sleep for seconds there. If the firmware reports when the
>> port is really down, I can wait for that instead, with a bounded
>> timeout.
> 
> Your best shot is monitoring what *prestera_hw_port_phy_mode_get* 
> <https://elixir.bootlin.com/linux/v7.3.1/C/ident/prestera_hw_port_phy_mode_get>() 
> returns as mdix status.

Thanks. I looked at prestera_hw_port_phy_mode_get(): it only maps the
firmware's mdix byte to ETH_TP_MDI/MDI_X/AUTO, anything else becoming
ETH_TP_MDI_INVALID, and the driver never calls it for SFP ports (the
sfp-52 port goes through phylink and the MAC mode attribute only).

Two things the code cannot tell me: which mdix value does the firmware
report while the port is admin down (INVALID?), and does that attribute
carry anything for an SFP port in SGMII mode with a copper module, where
the PHY sits in the module?


Thanks,
Imre
Technical Details
Message-ID: <a09fdc30-cd05-416a-8ca4-9787340fb6c3@app.fastmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362137-linux-kernel-netdev=dewy.ru
References: <20261111101521.9878-1-kaloz@kernel.org> <BL1PPFB0715B38BE2E57548F95CCBDFCAF7DB712@BL1PPFB0715B38B.namprd18.prod.outlook.com> <02e94b70-d446-4518-8f7a-c0f710e3b572@app.fastmail.com> <PH3PPFA2D0C836CFB7D296376875E16ECC8DB702@PH3PPFA2D0C836C.namprd18.prod.outlook.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362137-linux-kernel-netdev=dewy.ru
From: kaloz@kernel.org ("Imre Kaloz")
Newsgroups: linux.kernel.netdev
Subject: Re: [EXTERNAL] [PATCH net] net: marvell: prestera: disable port before
 changing its MAC mode
Date: Thu, 12 Nov 2026 19:50:20 +0100
Organization: Usenet Network
Message-ID: <a09fdc30-cd05-416a-8ca4-9787340fb6c3@app.fastmail.com>
References: <20261111101521.9878-1-kaloz@kernel.org>
 <BL1PPFB0715B38BE2E57548F95CCBDFCAF7DB712@BL1PPFB0715B38B.namprd18.prod.outlook.com>
 <02e94b70-d446-4518-8f7a-c0f710e3b572@app.fastmail.com>
 <PH3PPFA2D0C836CFB7D296376875E16ECC8DB702@PH3PPFA2D0C836C.namprd18.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1165609"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:URY0lAxLSaU6ZFkwQgXYDMn/3pA= sha256:iP8T5alBuRSLByndlPqlKi/S8oyZ78PLvC+dPHD26qg=
	sha1:1l1j6tFoPewHGDj6uGxCfN4SwdY= sha256:XUEnlCCLfs8Gkh/XkI207NHd7EY2L5tu3oosBR4v8oA=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 6077511405D; Thu, 12 Nov 2026 23:02:07 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id lBQj9qquK2RP;
	Thu, 12 Nov 2026 23:01:58 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-362137-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 13776114374; Thu, 12 Nov 2026 23:01:47 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 8D4A9120D62; Thu, 12 Nov 2026 18:52:05 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794509447;
	b=cxqqZIv4a8WKOuPmdy9yQysEGOCial/hK+aY2V5JQBsPVU+OYyhgs2n4N+B2rZfWddUh
	 G/RYamLbvF7gZ6bbufoeC++L4zSQMmx4OJuREvJQe/DnBDzY+RWED9dv+sNn0hnwGoxFv
	 DzFRjwlP8R4TyI7CV6iVCLa5dI3rPJg7C6OqMt9SKSL9iv7XxbXEZzvJti47MSCrF5+s0
	 OMN/jKKf7vcqPGSwUq4WEAdDN3V1sWAVTC9DHYSDn1Raa26ycX3K+uylk4T7lAkw08QhR
	 zvLbbsVXCAlxwCCPLLD3KIo80hzae141XpSQN4gJNnptz+dtMx0n7nd2ZbzexBJiFJQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794509447;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:Received:
	 X-ME-Sender:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:X-ThreadId:Date:
	 From:To:Cc:Message-Id:In-Reply-To:References:Subject:Content-Type:
	 Content-Transfer-Encoding;
	bh=/9hfYc8mGLWS0EBbgfoGxwJddGxq7EOCiuGNd9NQygA=;
	b=eqkHkwWpaXmNMxsHKvkXvnQxIqTFOrI9c/MsQkDSNQLGjWOaVUT4Z1zeEMFvIypB3GQo
	 UQxl9E5Q+TCVY1DDj+PaEGxtuWWQ+MQlVBpGzfWaNzNv6HPmz6BVP69DxU7p7VeOnkLKK
	 LT02r9eqzkDj7P+3b60uE4/mQupc8OJAd8N+Hozp3CrGD5TY9wY6c3F69NaCCAFCX6zKb
	 NuLCFEmvXDH7qi5qQCHZwfm/AbIbwG53YPXZ1a6EmPOnYH6aqyqL7C8rmTpCvxkMab2Hg
	 TDnlkvQip0r+mBfpir4gv4zv4Zb6AgbZN7axMwyu6fW8ZdGZRJsaPjwj6YHninwJ5lA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AiFLb6Hi;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E164606A891;
	Thu, 12 Nov 2026 18:50:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AiFLb6Hi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794509446;
	b=b5zvlnLfhVmRVbiwBgGKyO1VeL4WxeTkFePt8XPJW6oHklrFUKMaR9xo0onKNf1p73Go
	 nlpLgQwYdtEU05IItrnnfOBKeqocl4gjsHtZT4ypsVvXm+ohxZToRT0r+qXRf7aohW4WS
	 mbtqWCPErLTe8MJA8avRCZqnAf8tevle9zFfTicE4grN0JSNP/0xqiPPXp/Tk4Rr5DWXF
	 F3IOLDj1LsrWzvxPOQpqDW+mefqD/P7Wx9rEDlP6mfDXbCOApssSS92/Pcw4+F90RIW1T
	 eRjOAELpYka0aqn0L6GzSxawrOJZZowZClK51WpHKn3pu7WyBpRgbNB+BLeqBwe2/mg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794509446;
	h=Received:DKIM-Signature:Received:Received:X-ME-Sender:
	 X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:X-Mailer:
	 MIME-Version:X-ThreadId:Date:From:To:Cc:Message-Id:In-Reply-To:
	 References:Subject:Content-Type:Content-Transfer-Encoding;
	bh=/9hfYc8mGLWS0EBbgfoGxwJddGxq7EOCiuGNd9NQygA=;
	b=SZL2RWQmAlfYCz/slOAdRtfkNhKt2y1/Yuyp6VYqA/wVl58wzmz7I/CsbUN3wlbAeMdg
	 4VarGoONfcvSAYIq4v93NQ3kOtwrxyh4N69sKMn1kckDJ5d47895nmtYh4rRB5fa0N+et
	 INUu/Q+6jzdKsZS55mJJLOXDBCmhM7zNfw6h8SY2t0gPBEacnPvJ6pHQ+4F+KvPFjvM0E
	 1kNDotENYxHQg0j0kEL4aZsK4ku+LfgzQIpSs9c4x8U/MdnpLhw+txz/GI4fyoqDsCjnh
	 TFy9kQhNu5BUSkjWZ4dkOoQ0NSOMM6LzTPgt771AE48LP/vvIBl29pKZVvcyJrtiMCg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=AiFLb6Hi;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A168606A32A
	for <netdev@vger.kernel.org>; Thu, 12 Nov 2026 18:50:45 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26AE71F000C6;
	Thu, 12 Nov 2026 18:50:44 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794509445;
	bh=/9hfYc8mGLWS0EBbgfoGxwJddGxq7EOCiuGNd9NQygA=;
	h=Date:From:To:Cc:In-Reply-To:References:Subject;
	b=AiFLb6HiOeVM9TiK2CqMbEehe6eqjE7MPYFPcbl+Ty36JAnIDzrNHa2RC3MXUi2XP
	 tCN3WFYLddPMZUDrkoc1st/5jm2uJHnlNTbSulatcj+GuwZLH2p6mJuC+Wvr+jGJIL
	 zgkMB73hr+RfQwabUqpKaJR/UMYv7AbrovCUn3HBn2fuvC4HMwQsSxybaMVvK+4W4q
	 ri7wo/NUpiG+1OK60op8pyXNJxWQKQvUprMUVpvdHWCEIZpy7hEYPOPbZdf8yREGFg
	 mJCl0t8jXud2zvrZPaM3CimZZLjBz6aznpAIKoXz82hpHgByfL8ILafblBbiCwxIrL
	 RqKOfOZzp+EUw==
X-Received: from ams-compute-01.internal (ams-compute-01.internal [10.64.2.61])
	by mailfauth.ams.internal (Postfix) with ESMTP id 621E5198004A;
	Thu, 12 Nov 2026 13:50:43 -0500 (EST)
X-Received: from ams-imap-19 ([10.64.2.39])
  by ams-compute-01.internal (MEProxy); Thu, 12 Nov 2026 13:50:43 -0500
X-ME-Sender: <xms:gQr2apWpz7dWPYl91gVHictcciFMF6cbugT1ZlCydoMBs9DyclNfJg>
    <xme:gQr2akbmsTywyrgDHyYhz1K1zw89i8Tl_ojr-iOjx9J3_MNMn5U2CvqF7ieWSaf7r
    llfKa7-7ghrGiJdddMRsGxkSnOiRrQaAxowgpxPpdTra03-WOoCCuU>
X-ME-Proxy-Cause: dmFkZTEhKabvwGh6bQrC9XnvAw4ca375oIQt/YLxDq3lPzwt5Es3newiIf9z2bR2VSSMNc
    WAw95UfL/Okc0qrE+rG24RmDmeAJ8nekd0Us4XypIFheGq5I2XabLzKB0OqvC+x/Nqg0eV
    XnGY/oMrilfKAVmhbnl5RrQGf7tuMZvsXNuQEC6K9Od6t6V4YKMzsjWzE4dqOdxwcBrI+S
    62ED3BYaanA557Mgf90iP8tPMkvP/eXq1nbjprF8UHgJTHsY+JykAUamwIa2hW1AWmHgLE
    66BVy5dsxpGbIU2admUju9jWckn7AWiCTU5HqWnzUoxFx6H5MdvXJe1zgbMlG4L3t5AiN9
    8coPZUjEQd19zfgMmYFVV886ALKaNHthMo6C9TMfMq19WppEqIVcFtrwdQUTcChCaErvnn
    XMe6yfQ/47V8DoTcjMPCrxxIhJqWMSWKTTibEIzed3z40fUZkEsqG0inRohk4L9q8+R19+
    Q29klFtWdV+WYQhmpvUcKoFUJ3irq+WboETjQov1Zr5x8xVhWILss1oGcNf+7pJffH99oz
    79gibwYm+9ZIuMdmgvgwi/fqGgOca4lye+WwLc3f2nGS+ATs0tq9HURtqZ4W1hSdZbzAfY
    UZG9N5Ec5R2mYZrOjSGq4UPvlRb9DEUfXxvcUFJZJgWrMEqUzjRspkvPe/tg
X-ME-Proxy: <xmx:gwr2aso53GuqUgMZuvncI51HYpUJnhVl2d71Rpthi8d4vp_UsaUngQ>
    <xmx:gwr2aso00a-b4J0Uit9mb_tuHMmvbJn2kjyoGZ1cR8vxtYstAERR0Q>
    <xmx:gwr2an2E989e4__TCzXxuGEGxicEg6keLr1Z5vHfKnlVX5wWyTM8IQ>
    <xmx:gwr2aiG1X1cSzbN3VJIlHpPCd1dS-5hSPEeNHrnBRSXXWRST9a_GHA>
    <xmx:gwr2aqEVq0vcYdD6vo8I21X_TDLq_rf4eX3aVLj6vSdk63CZXwP8b8sV>
X-Feedback-ID: ia3204a8f:Fastmail
X-Received: by mailuser.ams.internal (Postfix, from userid 501)
	id E49BD2F8005A; Thu, 12 Nov 2026 13:50:40 -0500 (EST)
X-Mailer: MessagingEngine.com Webmail Interface
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-ThreadId: APqG7cBtEf9F
X-Cc: "David S . Miller" <davem@davemloft.net>,
 "Eric Dumazet" <edumazet@kernel.org>, "Jakub Kicinski" <kuba@kernel.org>,
 "Paolo Abeni" <pabeni@redhat.com>, "Andrew Lunn" <andrew+netdev@lunn.ch>,
 "Oleksandr Mazur" <oleksandr.mazur@plvision.eu>
X-In-Reply-To:  <PH3PPFA2D0C836CFB7D296376875E16ECC8DB702@PH3PPFA2D0C836C.namprd18.prod.outlook.com>