🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26105

Re: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading firmware

#26105
From: Andrew Lunn
Date: Thu, 03 Dec 2026 02:37
27 lines
9898 bytes
> I agree. But most of Realtek nics are single chip, mac and phy are
> highly integrated. Some of the chips share the same PHY ID, but they
> have different mac version which should be applied different
> firmware. In this case, I think firmware here can not be moved into
> PHY driver for the bad design.

We have dealt with bad vendor design before, where ID 2 and 3 are not
sufficient, or not even filled in.

Look at the Marvell mv88e6xxx switch driver. Some generations of its
integrated PHYs have the OUI part, but the model is 0. The data sheet
even says this was intentional!?!?. So the MDIO driver, which knows
the switch ID, traps reads to ID2, and if it finds the ID value is not
reasonable, it replaces it with the ID of the switch. The Marvell PHY
driver then knows what sort of PHY it is dealing with.

Please don't use bad design as an excuse for layering violations.

If there are other design issues, just describe them, and we can
figure out a workaround.

But step by step you need to move all PHY code out of the MAC driver
and into the PHY driver. And i will not accept any new code which
touches PHY registers from the MAC driver.

	Andrew
Technical Details
Message-ID: <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376237-linux-kernel-netdev=dewy.ru
References: <20261201094454.1150-1-javen_xu@realsil.com.cn> <20261201094454.1150-3-javen_xu@realsil.com.cn> <7cbb093d-bfd7-4efb-899d-f888ee20feee@lunn.ch> <a3d73fd9133144f28e716ca6f034c5c0@realsil.com.cn>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376237-linux-kernel-netdev=dewy.ru
From: andrew@lunn.ch (Andrew Lunn)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading
 firmware
Date: Thu, 3 Dec 2026 03:37:42 +0100
Organization: Usenet Network
Message-ID: <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch>
References: <20261201094454.1150-1-javen_xu@realsil.com.cn>
 <20261201094454.1150-3-javen_xu@realsil.com.cn>
 <7cbb093d-bfd7-4efb-899d-f888ee20feee@lunn.ch>
 <a3d73fd9133144f28e716ca6f034c5c0@realsil.com.cn>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2124060"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:n7CVAW0mMnSS3/mrzyP1VNGaa4I= sha256:ziR6+nAlrOrx0ktW4KMtUR5PQ0FWsKgsiS+0OPWRnGU=
	sha1:ZQJqtq0qgQMr8nQc4cwKIlBGBPg= sha256:uIKFyaW458KGNGiucNXL8nNphr9Xqi1P/QI3a1pZcwc=
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 86E671177F0; Thu,  3 Dec 2026 05:38:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 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.249,
	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 (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 mfbtUVEILJ2w;
	Thu,  3 Dec 2026 05:38:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-376237-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 E098F1177EB; Thu,  3 Dec 2026 05:38:32 +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 7E1022D0C2; Thu,  3 Dec 2026 02:38:14 +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=1796265493;
	b=xPbUALidIhRkVZzDjgrGm3KFcr/GJJjowW/iOlI1Gek8mBbCx4XeJxro9Iyn7etYmCEP
	 ptyxK5tyBpMHpTkkyTv6OGopM0KzA0YSQe9AIpVhoIep5bV+jnw8Nnd48wT9qcONO82AJ
	 0kJxZq0SQ9ee+26IcVY7hWd9I/tf7iIgghRs0VTiQbI4mnGHjLno9nXgq1oHSB5AlxPSZ
	 I5mUfq8A+loIE8sPfL4xlTl8zbcx6kF0UX8CChnHByl0pN5cBHaPRbtlPlSqmMCJVD4bb
	 yZP677+YJKdWuD8fblky+B0ny1TxaR+EaB50wmFroZpHy8Zxs1Ku3EgPpOihNFXOyIg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796265493;
	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:In-Reply-To;
	bh=wv9fDZCuJIzN63lMzRYAf4yPs4/DvELkrq/Pf7UoQAU=;
	b=l4XKG+Wms1J/u/E6KjfLR83H0TMu1YeTuBWIDNJHGdbjtSMTwjEZ5I4g1GJTMLNKiqHz
	 +98VM19ywHbc+FZNBCOm1VG9gFVFmgUhBJs3BHtOamOccf6Vt/9Iaza8MewU2E8iDpyQW
	 7BKy9/S4zv1WikwsfFAsHFdhF2BoM5bK4oi6VeZ9VcG2FrFjk9BZ0eWlmyLGPq9L0w/lQ
	 3Tbg5jd3Uro9zoTcTMuvocF+cm4a/T+lrkl1jokfV+yG0lQK9ee/hSzhLpFlLgDvynJSG
	 JTi1TWMqJ0+VkuPUCbLHuZ6cNwkDLbsMiiJL2Gk/Iswp/11UbVB2CVh6IUqRv32wpaQ==
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=4LcsDrxO;
	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 EBDCB606A32C;
	Thu,  3 Dec 2026 02:38:12 +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=4LcsDrxO
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=1796265487;
	b=P0QPk4LsB7Fw7SOEVKaX1aftlVKOJ65nno7EsikwK8CMa8ajZfdBJYJJz5gRgDUmF87q
	 Glg8JIqQL5svARal/xz3mb2Xt+pd2Q2oDgf/x/8+zhM5NQboNJNF2DFXeO3ozfmuALZ2N
	 h82r3/FktUlwIXqq6Uun4i5s//kVyqf4IP7vwRaY7VvTQqGPSf+zPimhcw/p0QvNkyfRj
	 S6BAihbHLQeO2vRCDzEgMdaYOfUVDbWR2CJn58JHaZsa/bGZulcwf/UNK36Us+0q0XMa3
	 ct6uJzAr2WZ0zmmE6tgCsM50yIPg40J8CG8608QjVPcbwZ0L6El7U2zi0htzuCKgdhQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796265487;
	h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject:
	 Message-ID:References:MIME-Version:Content-Type:Content-Disposition:
	 In-Reply-To;
	bh=wv9fDZCuJIzN63lMzRYAf4yPs4/DvELkrq/Pf7UoQAU=;
	b=e2G+JVedRAspyUIeGf3T8w7ny6StJOMMRqBypXBh9CFuxf80ufg84MRbaJK3pSTcxO+6
	 1mLW11WygJvvqeP5ZAAuYC2M/JdCtoqCF80n616Ryct2Z6B9gd5HNcUpftFTDSnYyFiQ9
	 nFAL2CFHovUFH2UuYmCgCfcwpontsO61d2G+nJtdlUYWdLW4B8Tqi9+4geG2s/k/BID35
	 z1iViGsnr+0mNg6NrXFiMvRkTciMoWpkV8lbhdZN0pUROxVbKu3FDpes1OLJIoXyS8F2k
	 BDT98GDS/XUm93jLJv+ztrPQ2y01TmhdJYcl/zhspKMww0Rixta5eyExOtkGCaVpn7w==
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=4LcsDrxO;
	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 BC53B606A684;
	Thu,  3 Dec 2026 02:38:06 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BC53B606A684
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-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=wv9fDZCuJIzN63lMzRYAf4yPs4/DvELkrq/Pf7UoQAU=; b=4LcsDrxOd1VZeVx1Aa2GEqI7h/
	bG2VGh4WeM+v7R6g2g5WYC3nkwd3PD1+bZ1+0oeptUhPBhSdEQ5aKMc1PjJtdTNP/8TAwYicaR2HX
	G5dhhpgkovhnpvV5WRpg1UTWv9pfMiI6P1dDIjYwtW9iqGEp3uQG+i2cy4h49y0EApeo=;
X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2)
	(envelope-from <andrew@lunn.ch>)
	id 1xYwha-002wCy-KF; Thu, 03 Dec 2026 03:37:42 +0100
X-Cc: "hkallweit1@gmail.com" <hkallweit1@gmail.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"nb@tipi-net.de" <nb@tipi-net.de>,
	"maxime.chevallier@bootlin.com" <maxime.chevallier@bootlin.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"daniel@makrotopia.org" <daniel@makrotopia.org>,
	"vladimir.oltean@nxp.com" <vladimir.oltean@nxp.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: <a3d73fd9133144f28e716ca6f034c5c0@realsil.com.cn>