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=1796263705; b=Zy2PJExBnaqsBu6lyKWFHoOCTVUtn7WoviLlyXbT5uJn3sBBhwcH+3bCd3l0UxjqXVGu aYwTnwYa4cRnX2KwqR3Q/WqBp/ySmj/LxylTTIad2F2LLHVpdGs0nJceq4FhoPpKbD0Qh WeRoD49/pQeUemf8rmLKOU8r+2D8BwV1VnT2MVMFZxs6aHWLyRgJHLuID4lPNoayiOtsY FyguSlDVodeYtSqLkWkECjSEGrHy2PE/OIadOuGsEGrH6d8njqxHWVQInwwNRxtz5oPR3 RDUjF4KsV+TkIh06nI8vM2CFzratAs0MWW1rrDrlTkMWDvRe/KkrixNOVYk+rZCHBQQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796263705; 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=XHft0DRtlvjWQ+7KcSM0X7sl5byO9zOG1gizlv6bTEc=; b=q3YLfFr6E1fP4DVyUnYThrEqyMhJmIE20uNfwkqgH12LPFz0iJVtdy/7//vxWXR2IktY 1T3Nc+AKTVll6psNj0/kxfYMl9YwfYc9msHwCl0t6D6r9ESPRQxvGrtdC3oxqwdvk2Muw 7uav5EnJiZ+Cy1tcj6eQrTgcgYNxtGCGzdsdKxPGnPoXcGWMB2V5Z170V6JRjIE9HM47M /y/ffzKKiSzTE45ogj/hTY3t+Vwq33C0BzdUl8SYgbhvv+3B1lugFvZfJ4KIhR8gZjrth KHpDQFPjw+mnJo1KZ79hmvLJrooIDjv0Dp27/Kgvpb3wwKIEymM99t/SN773MdUer9w== 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=MyTvAfjS; 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 7A6CB606A32F; Thu, 3 Dec 2026 02:08:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A6CB606A32F 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=MyTvAfjS X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B3273De81530963, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realsil.com.cn; s=dkim; t=1796263624; bh=XHft0DRtlvjWQ+7KcSM0X7sl5byO9zOG1gizlv6bTEc=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=MyTvAfjS+fn96D0aRC1f0x4+9GXjuX27kDaUvtvcyFGdf+nrZLuHLE+zC/pZDhRtZ pgODlzxDX4QgLX9dOmHdI8uVgxPirRHLs4Qv06FYZzV8n5ZDNH9PEXbPtiMi+oBdji LEFpNxcmWJFBcmEfEuqLvzzmxbi63jxvc55IzWhkH72aRSKB5xb0Zw6oxnCtrc3M4x iZurfbS5UsmAZNAv6oW3FTgGe0XBmHEME4ffpYeXM0XkBmqfU6PpuQx6hcCNADtQFN 5cKgqy/qdHCmnkRG+f0xcLozhBq0stAo1M5DPxt0QNKqRt/xzIukesjq3ZhQ/NyoAv 79kfH6oLdUJrw== Received: from RS-EX-MBS4.realsil.com.cn ([172.29.17.104]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B3273De81530963 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 3 Dec 2026 10:07:04 +0800 Received: from RS-EX-MBS3.realsil.com.cn (172.29.17.103) by RS-EX-MBS4.realsil.com.cn (172.29.17.104) 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 10:07:03 +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 10:07:03 +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: AQHdgXihFBjiA5JQPEmfm0L2ky3ffLdJNdiAgAFZ3RA= Date: Thu, 3 Dec 2026 02:07:03 +0000 Message-ID: References: <20261201094454.1150-1-javen_xu@realsil.com.cn> <20261201094454.1150-3-javen_xu@realsil.com.cn> <7cbb093d-bfd7-4efb-899d-f888ee20feee@lunn.ch> In-Reply-To: <7cbb093d-bfd7-4efb-899d-f888ee20feee@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: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 > >On Tue, Dec 01, 2026 at 05:44:52PM +0800, javen wrote: >> From: Javen Xu >> >> rtl_fw_write_firmware() accesses PHY registers directly, bypassing >> phylib. Hold MDIO bus lock meanwhile, so other phylib users cannot >> interleave their accesses with the firmware sequence. > >More signs you really do need to clean up this mess and use phylink/phylib >correctly. > >Why is the MAC driver downloading firmware into the PHY? The PHY driver >should do this. All the locking issues then go away. > I agree. But most of Realtek nics are single chip, mac and phy are highly i= ntegrated. 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 th= ink firmware here can not be moved into PHY driver for the bad design. Just as we discusses in r8169 phylink patch. Link: https://lore.kernel.org/netdev/7473edee9a67407c81b357492e9452c3@reals= il.com.cn/ Thanks, Javen