From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=211.75.126.72 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20745606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realsil.com.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realsil.com.cn Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=realsil.com.cn header.i=@realsil.com.cn header.a=rsa-sha256 header.s=dkim header.b=ITGfwXpF X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B334upP61577835, This message is accepted by code: ctloc85258 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== 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 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 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 From: Javen To: Andrew Lunn CC: "hkallweit1@gmail.com" , "linux@armlinux.org.uk" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "nb@tipi-net.de" , "maxime.chevallier@bootlin.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "daniel@makrotopia.org" , "vladimir.oltean@nxp.com" Subject: RE: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading firmware Thread-Topic: [PATCH net-next v5 2/4] r8169: hold MDIO bus lock while loading firmware Thread-Index: AQHdgXihFBjiA5JQPEmfm0L2ky3ffLdJNdiAgAFZ3RD//4XHAIAAitxw Date: Thu, 3 Dec 2026 03:04:56 +0000 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> <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch> In-Reply-To: <95978163-95dc-4958-a0b3-0885674daea5@lunn.ch> Accept-Language: zh-CN, en-US Content-Language: zh-CN Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 > >> 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 rep= laces 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 ou= t a >workaround. > >But step by step you need to move all PHY code out of the MAC driver and i= nto >the PHY driver. And i will not accept any new code which touches PHY regis= ters >from the MAC driver. > Understand. But for single chip, the firmware contains mixed configurations for both MA= C and PHY. It has strict timing requirements. During execution, it uses PHY= _MDIO_CHG to dynamically switch the access target. The sequence is interlea= ved and cannot be split to into two separated phases. How do you suggest we handle this issue? Any suggestion will be helpful. Thanks, Javen