🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26115

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

#26115
From: Javen
Date: Thu, 03 Dec 2026 03:04
45 lines
11542 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.
>

Understand.

But for single chip, the firmware contains mixed configurations for both MAC and PHY. It has strict timing requirements. During execution, it uses PHY_MDIO_CHG to dynamically switch the access target. The sequence is interleaved and cannot be split to into two separated phases.

How do you suggest we handle this issue? Any suggestion will be helpful.

Thanks,
Javen
Technical Details
Message-ID: <442df8997b3e455894e44c59418822b6@realsil.com.cn>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!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-376248-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> <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu.MISMATCH!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-376248-linux-kernel-netdev=dewy.ru
From: javen_xu@realsil.com.cn (Javen)
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:04:56 +0000
Organization: Usenet Network
Message-ID: <442df8997b3e455894e44c59418822b6@realsil.com.cn>
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>
 <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2128620"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:9rh/4cGzgMUlImFuLwDeKOh7X/4= sha256:XiAuyMqRvTy+j5FwSnCaHE94GlD9lgXP2DjTp/s9yfw=
	sha1:E8Kz3NJXofe0DQDQiGg3o4HSYrg= sha256:1lQ5/MFTRt9dpimno6qR8a6pr94GxH5g1lFzpUY5/Wc=
Content-Language: zh-CN
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 F33911177F9; Thu,  3 Dec 2026 06:06:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[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 (2048-bit key)
	header.d=realsil.com.cn
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 85Tuc6dcWbCR;
	Thu,  3 Dec 2026 06:06:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-376248-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=realsil.com.cn
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 7BC2311777A; Thu,  3 Dec 2026 06:06:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id DBE7B60307F; Thu,  3 Dec 2026 03:06:03 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail;
	t=1796267160;
	b=FzfG3Y8vtd5fmXwrhzD8iCWRfLXuXrrjotgpkWnEYA7cGLIf4xUf+MgAsKdeweRwNoQJ
	 CpaX9yViNBUt5nJr+vLyEZLqGaCe9u8x28oK8iwPtZsC0eXXwU2mGXGvCg8iPUPTJHwsX
	 cuDlDn+RXKG6AIGbF7AcRiGLBoALsDx89YdD3XQ70VZzGZN5yo0wph35dunK5nsdFIbWy
	 tle+uuRQf/YFqRcLVISHKDY1jbdT694tftNUWond1hLi07ndbIm86ViNVqgcKSVJJZ5B/
	 otRJOcOjMVg3ECcoqTORpjjX0yZCZJh5uOhcxNJ0qTjOrMa4T/zdWV3hRRRKNVhQHOg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796267160;
	h=X-Original-To:Received:DMARC-Filter:X-SpamFilter-By:DKIM-Signature:
	 Received:Received:Received:From:To:CC:Subject:Thread-Topic:
	 Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:
	 Content-Language:Content-Type:Content-Transfer-Encoding:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version;
	bh=qv3o5lsw0SRtTfb70Bv0QgPMcr6stTL3nEuFOuY+6M0=;
	b=dQr3EPl4wIqV1QH+CvvcH/pT+ADSbxvvcM1BNkl1V4iDTYvOe+BiRAQR3V/unkj6k3yN
	 g7JFs26BErmQaZ1OVjUnUx+ghGrPPwmjzauqtjsud8988mAzB1PMvdESMX3RSlTvxQcHC
	 Wd2AW/N70b5Ptz4iU9itDlBbL4VuZpCt+XGuHi4W0h6jh8C58r/8aOmwa85Zf7L2MHsOg
	 4Ag+vATlxmx9AeHws+PZN9OwvMgDyUE/pkNOe/pH2KgtLsqqqwaIZfF47Sp45zRF24Oo0
	 hyUbv1yh/QlhQzKkRY3smM21lDMpF6oDoZRJrWeLnQE6U0cTxTJyO442mg/SCk3yveA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=realsil.com.cn header.i=@realsil.com.cn header.a=rsa-sha256 header.s=dkim header.b=ITGfwXpF;
	dmarc=pass header.from=realsil.com.cn;
	spf=pass smtp.mailfrom=realsil.com.cn;
	arc=fail 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 D0F8B606A687;
	Thu,  3 Dec 2026 03:06:00 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=realsil.com.cn header.i=@realsil.com.cn header.a=rsa-sha256 header.s=dkim header.b=ITGfwXpF
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=211.75.126.72
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796267155;
	b=hfAW643h5EzxexaYtrQdNaOrsp1MR/wiEUUPT8IZvJ7aw3tQZXiIXIr2WVBgWxluB3Ok
	 bLZt8IxeNLl6E5IenVRJgXwQzAfGVHf4ZFe6xawumhH3ldfobP6pCs5Z7ay1fGIo7MDr2
	 ZGOtfimAEf7YEGXaiZ9L1a1KPeHCXeCz+Zatobm9cxSOBs+EKQwQoA0ZpngUUwpIDn7sb
	 b5pSKZbjqf8Ww2CDfi3n4TSEb0QntbJ1SKbJd6qnY0Omu3Lj4iuuD3rDQVSqz2E26hUKJ
	 AKtJ4zCSurJGEnSaftydauDvG0BRLuvE0Iaga1ozmBraqH4XBPMTEunyA2mf1nyHufw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796267155;
	h=DMARC-Filter:X-SpamFilter-By:DKIM-Signature:Received:Received:
	 Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:
	 References:In-Reply-To:Accept-Language:Content-Language:
	 x-originating-ip:Content-Type:Content-Transfer-Encoding:MIME-Version;
	bh=qv3o5lsw0SRtTfb70Bv0QgPMcr6stTL3nEuFOuY+6M0=;
	b=rWV0AVZdQmGYbeKnO/ypZnvrwVhWDwoXtuiZCT/jK8t2d2Fu1OSl3L1P70bPwr0p1/fh
	 zjMWf2Ps2Vq6nbu52Db+cHb59TGGlWGXOkGywF5tNr/E3X/2vy/QK5ZYUgKZQg6ZVtufY
	 m4Pa0rLr8gqRgqVgNuCOSuENvFJqAr+pL809WaID1G8A74g2VhpJMvM8G1KD1yMRbLvsQ
	 YzKO/Nm7yhmDrctfaU7youLVVAcyB8pridPGjmn0Qu80d39jqN00EHFAyVjJqbviOuZkO
	 5YIhpLJzmOCOod7xbypO5BG74yCpe0AsfxXPWBaLT//H4sc9ScJE1WX2FF+F8/1AvDA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=realsil.com.cn;
	spf=pass smtp.mailfrom=realsil.com.cn;
	dkim=pass header.d=realsil.com.cn header.i=@realsil.com.cn header.a=rsa-sha256 header.s=dkim header.b=ITGfwXpF;
	arc=none smtp.remote-ip=211.75.126.72
X-Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20745606A335;
	Thu,  3 Dec 2026 03:05:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20745606A335
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realsil.com.cn
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realsil.com.cn
X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B334upP61577835, This message is accepted by code: ctloc85258
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realsil.com.cn;
	s=dkim; t=1796267097;
	bh=qv3o5lsw0SRtTfb70Bv0QgPMcr6stTL3nEuFOuY+6M0=;
	h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding:MIME-Version;
	b=ITGfwXpFzQONZYPmdjjksU2Kct5P7l1h7WAzLqiB7sPcL5ZaCZ4I34nzaRI/Qq0mT
	 9AcHsbCIKRLmMteyWTl+aZFhlncisYCp+jgtiLJz+o3gdrSVTfKvInV1yu8v7BxTMg
	 8yCMQj0blgdAi3voiURb9y/cPm3q6QgrPUPEH3rrPKQX8dl5PStRm8bu99tyvL1zqP
	 wtzAT8bjbtxG3kQx/CtwENyDbCscCUlZhye8IqjL8jIdCrAFwxKUQ+yBRmwZTbkyI2
	 GX0UUjf5AOrK699IcN/og883K1GKbD2GK9NbLbGOMVleQ882PX46AvtIpj9dH8OScN
	 IAP2MdMSUbcOg==
X-Received: from RS-EX-MBS1.realsil.com.cn ([172.29.17.101])
	by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B334upP61577835
	(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL);
	Thu, 3 Dec 2026 11:04:57 +0800
X-Received: from RS-EX-MBS3.realsil.com.cn (172.29.17.103) by
 RS-EX-MBS1.realsil.com.cn (172.29.17.101) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.2.2562.56; Thu, 3 Dec 2026 11:04:56 +0800
X-Received: from RS-EX-MBS3.realsil.com.cn ([172.29.17.103]) by
 RS-EX-MBS3.realsil.com.cn ([172.29.17.103]) with mapi id 15.02.2562.056; Thu,
 3 Dec 2026 11:04:56 +0800
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-Thread-Topic: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading
 firmware
X-Thread-Index: AQHdgXihFBjiA5JQPEmfm0L2ky3ffLdJNdiAgAFZ3RD//4XHAIAAitxw
X-In-Reply-To: <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch>
X-Accept-Language: zh-CN, en-US
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