๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26958

Re: [PATCH net-next v6] net: sfp: probe RollBall bridge with one MDIO read before the PHY probe

#26958
From: Andrew Lunn
Date: Fri, 04 Dec 2026 13:39
44 lines
10885 bytes
On Fri, Dec 04, 2026 at 10:34:08AM +0100, Daniel Pawlik wrote:
> Modules without a RollBall I2C-to-MDIO bridge time out on every RollBall
> command, but the quirks for such modules force MDIO_I2C_ROLLBALL. The
> PHY probe then retries 25 times at ~21 seconds per attempt, i.e. for
> over nine minutes, before the module links up without a PHY. Each
> attempt runs from sfp_timeout() with rtnl_lock held, so for the whole
> window every rtnl user on the system stalls in ~21 second chunks,
> including the state machines of other SFP cages: in one test, pulling a
> module from another cage was only processed after the current attempt
> ended, triggering a WARN from phy_error_precise().
> 
> mdio-i2c reports a RollBall command timeout as 0xffff, both for a
> bridge that is still booting and for a module without a bridge. Do one
> cheap MDIO read of the PHY ID before the full PHY probe and return
> -ENODEV on 0xffff: the existing 25 x 1 s retry loop still protects
> slow-booting genuine bridges, but a failed attempt costs one read
> instead of a full probe timing out on every register.
> 
> The ID register is used because phylib ignores a C45 MMD whose ID reads
> all-ones when matching drivers, so a PHY failing this check could not
> bind a driver through that MMD anyway. This relies on the PMA/PMD
> identifier, which Clause 45 makes mandatory, being readable once the
> bridge is up, as it is on the RollBall PHYs seen so far, such as the
> AQR113C and RTL8221B.
> 
> The trade-off is a shorter window for a bridge that stays completely
> silent: the retry loop now gives up after about 45 seconds instead of
> the ~9 minutes the slow probe accidentally provided. The RollBall
> fixup allows modules to block PHY access for up to 25 seconds after
> insertion, so this should be sufficient.
> 
> Tested on a Banana Pi BPI-R4 with a bridge-less "OEM SFP-10G-T" rev A
> module and a genuine rev 02 module with an AQR113C: the rev A module
> links up at 10G 57 s after boot instead of over nine minutes, and the
> rev 02 module attaches its PHY as before.
> 
> Suggested-by: Marek Behรบn <kabel@kernel.org>
> Signed-off-by: Daniel Pawlik <pawlik.dan@gmail.com>
> Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Technical Details
Message-ID: <df8aa5d2-055b-4fb7-a525-7579cc210a7f@lunn.ch>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377390-linux-kernel-netdev=dewy.ru
References: <20261204093408.1391147-1-pawlik.dan@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377390-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v6] net: sfp: probe RollBall bridge with one
 MDIO read before the PHY probe
Date: Fri, 4 Dec 2026 14:39:54 +0100
Organization: Usenet Network
Message-ID: <df8aa5d2-055b-4fb7-a525-7579cc210a7f@lunn.ch>
References: <20261204093408.1391147-1-pawlik.dan@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2774442"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5COTyNCy0EhQ0bF06UHwciqREJQ= sha256:GP/HKsVujagzSmvYp9Wd0PifXvEmUB0/nw8MYiQLxkQ=
	sha1:VaAA6yWDGssAx+TNA1B3HANNyM4= sha256:Q+/d+MQ2MzA2akhcmOWHzY0w+OwPGp106JufRl6aaLE=
Content-Disposition: inline
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 CB015117C12; Fri,  4 Dec 2026 16:40:13 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.298
X-Spam-Status: No, score=-3.298 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=lunn.ch
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 3NYtjoCxol-1;
	Fri,  4 Dec 2026 16:40:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377390-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id D523A117C03; Fri,  4 Dec 2026 16:40:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 1325966FCA; Fri,  4 Dec 2026 13:39:59 +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=1796391599;
	b=aKB+pXuvFyfvvEFNbY5sPxUm+dyB1ZpypGAUMDFgoHnDMbHqBDPCh+j2rq3X0eIantqo
	 MP3AxK9qZTzAYiK6ERfI+2Mr9Owlp8UecJrT4YvH+eerPhmX4NCJthZv51w0U8t96Jy45
	 ZGi2yJ4dLi0ya9yzovpt8LgMu39lwT8C7e09TEpQ9bnvT7RagVIC5gaxHgVHVAd/xSW0l
	 5HOPku4ASg0HH/aOoq4RGO4FIlmv5CmnYVo89mgsLglCjEByCssJjY/zTLHxjlN54Zgzy
	 DaxVkro2NWC+gU21X73FgIPrpWxtoNKY0uPpZwh09XnzvaA/X0oA3aVSJZxkJvjkjdw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796391599;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date:
	 From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=yePPa7Znbwjyqd8fWcFYUu05eRPAharfB3OuBPPQI/w=;
	b=2yTtauyGr4CEVJPWQBHHEtsbtd5TSITO7UtCIQLPRWi4UST0b7HpiN521r09D2vl5Eh8
	 UGj6yor1ap/hzLLlELkNhYYIRZ5ZQrpkSERBlZmMXvtfgY7DUVriCCg4bzCmfKKeG87/z
	 5EQiLuHIkUFFwgPMgbixExX4KxwQ2Vrw7fx56SsYh9i1NRwWJcREOEevKivoLu8toQw6f
	 j/FBPcBCI9R/u5T3dZHoo/pbOuDwAmiXMP0nSkFsRU2ezUkeq/KNrpkpQpIQVfOtGorKa
	 wtWzKoPQZ0wr7gUjugsvOM2WF4txbRF6+gidIk4g8iravnxFmiq/iSWcsq4jy5HRxqQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="T/857FU4";
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	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 E0114606A333;
	Fri,  4 Dec 2026 13:39:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=T/857FU4
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796391598;
	b=jmqqUKm7R1X36uJaqVpdkPw2+AYyLh6Zj07cixQXUC0EsLW2i9JC+e54vakcezGQFTWD
	 zwCg0dEYFDCziXRulLPsz1hsllIbBixiABDxhOBR6zSXDUog3V7sZThvjJt6NMXo0st3k
	 kyeZKchAmhkiy0Tb4UUiwu18UHgXMz9BykglAYf/XHOAw8SS/ao9DcNwbYoduJ2L9hu3O
	 N7SEkUQxDHNJj1uD//nVhzzUu+q1XJ3I9MyZdN+0Mrs2MfnNuZPchLRHcNPZzvGjefJQx
	 3CGL9XbtvWGaG7Xg2y/YLwTkI5inBqSLxAm1B4LJipgW4g/85o1bKH8i1fGRl2IA3gg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796391598;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=yePPa7Znbwjyqd8fWcFYUu05eRPAharfB3OuBPPQI/w=;
	b=SWJuMEqzVtfpO/Qc7dJSLTND3HkVGivNduAvRaK5t4Pmclf+ii0d7Y/f50EBNdco6ZaS
	 mK3DFz2QIAFCFfMna2qn3+MG4ZtceEOyMtDoxz8TTyNgHmCnST5pz5EDzOad24n8goFVN
	 BtfOLRcmJtTwtaiz4rHTbtUfvknknjpq8523nB/sf2DW5f/OFnrgULV260I/5isrIgXC9
	 twFE8bmr9RF27TRpoVh2DGKxGWdO9RBc1Vf8eVBY7bMIQ08Q1whehfFKaDrktb/imtiCR
	 BG2b/KivP9mxV+Dzi59Z3QEUUtGUqXhrJqEtRtnEI52EDRmacKKWTGWg6i1RV2ozJoA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=lunn.ch;
	spf=pass smtp.mailfrom=lunn.ch;
	dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="T/857FU4";
	arc=none smtp.remote-ip=156.67.10.101
X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7B8D606A322
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 13:39:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B7B8D606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch;
	s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition:
	Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From:
	Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:
	Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition:
	In-Reply-To:References; bh=yePPa7Znbwjyqd8fWcFYUu05eRPAharfB3OuBPPQI/w=; b=T/
	857FU459YsheyyAOZqetZgTPluj9vCZfIJUxPs71eniu09sNXwXhbN20Jf3LLdYwKH3xcw41mO8hI
	Iazp4DK+2bNzCdffaabzdvhLtvqGQV6KzFqcQKBy8DDzLMC2Httsl1JrbrBrGICjfIEJvBOKtvzIH
	jNiD50WXZG+75Og=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xZTVy-003F2c-4d; Fri, 04 Dec 2026 14:39:54 +0100
X-Cc: kabel@kernel.org, hkallweit1@gmail.com, linux@armlinux.org.uk,
	netdev@vger.kernel.org, willemb@google.com, andrew+netdev@lunn.ch,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org, petr.wozniak@gmail.com,
	maxime.chevallier@bootlin.com, olek2@wp.pl, szymon.datko@gmail.com
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-In-Reply-To: <20261204093408.1391147-1-pawlik.dan@gmail.com>