From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 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== 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== 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 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 ; Fri, 4 Dec 2026 13:39:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B7B8D606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch 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 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=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1xZTVy-003F2c-4d; Fri, 04 Dec 2026 14:39:54 +0100 Date: Fri, 4 Dec 2026 14:39:54 +0100 From: Andrew Lunn To: Daniel Pawlik 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 Subject: Re: [PATCH net-next v6] net: sfp: probe RollBall bridge with one MDIO read before the PHY probe Message-ID: References: <20261204093408.1391147-1-pawlik.dan@gmail.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261204093408.1391147-1-pawlik.dan@gmail.com> 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 > Signed-off-by: Daniel Pawlik > Link: https://lore.kernel.org/netdev/20260624084814.20972-1-petr.wozniak@gmail.com/ Reviewed-by: Andrew Lunn Andrew