From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 48EE1CA1015 for ; Thu, 4 Sep 2025 16:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=UM6zfWF0u7L0EiLPumM84yVNekT/Opoto010oDSlxHI=; b=2+XMBtViWXQ4ZeUHBTM6S2d7x7 XVIyBfY1rovCr/wYx7CojJ8rMZjLmFiMPb815x9qX3rs/8xPeAFQkelQuz5kdL7Ue8a7qL2SjO4f2 2ha4CXjZBlDsKHQ5rRBh5LcrzYeEBhm9UiM52jzrprfstcPii6DdPJeDxLRe5+iwwZsZ9Ud7Oykg+ GB70pQj7qdrYtcwm7i8wXcGKy9MGU7cMsRYP2SUc/o3JR+iadSP03goh2Y9YQPnM6HKETJwZJPP8b YRBmjQPaXG5JBxXmjVddk/0mmT/hvaNJQFbzNg/Fl8I8kzB+b7PC7hD8Id4BGPt2+XUOL98lnGk1I BeeifhAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuClC-0000000CqQm-0PHq; Thu, 04 Sep 2025 16:24:30 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uu8ni-0000000BSsE-46q0 for linux-arm-kernel@lists.infradead.org; Thu, 04 Sep 2025 12:10:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UM6zfWF0u7L0EiLPumM84yVNekT/Opoto010oDSlxHI=; b=BEEpseDoJgLW2hnUegX3r6yEdH ZRVvraXzhuUctfQq/biYhwN6IylSBPtjVyvBmOTXjeS1/YErNlCnUbwSUt5ea82c27TbSdJobr6DC GqigxS9/iVotnSKp4uF6HTvByseg59YrKUdAsge9aFHWXQXm/XtyKqpWP0A6/hVEOWnvE+qKE7Q0p hAKEFQ8aQLTiRYqtr6q8Kt60UWzuxB5CJe9o1bzySFa+XtDTYeBixCuzEDq4hYdHGyKoTKcG8T+Ls 08H93sWt8n2my4avYRbCzjfg1aHK6HQuRfrj4NXe6BZHzpR96hvl/xwV5kW/8CeYF1S2SCFN6O46W NFUItaPQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:48470) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1uu8nd-000000001wn-0R8C; Thu, 04 Sep 2025 13:10:45 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1uu8na-000000001WV-1IVn; Thu, 04 Sep 2025 13:10:42 +0100 Date: Thu, 4 Sep 2025 13:10:42 +0100 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next v2 00/11] net: stmmac: mdio cleanups Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250904_051051_018349_A8AC96BE X-CRM114-Status: GOOD ( 11.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 03, 2025 at 01:38:57PM +0100, Russell King (Oracle) wrote: Hi, Clean up the stmmac MDIO code: - provide an address register formatter to avoid repeated code - provide a common function to wait for the busy bit to clear - pre-compute the CR field (mdio clock divider) - move address formatter into read/write functions - combine the read/write functions into a common accessor function - move runtime PM handling into common accessor function - rename register constants to better reflect manufacturer names - move stmmac_clk_csr_set() into stmmac_mdio - make stmmac_clk_csr_set() return the CR field value and remove priv->clk_csr - clean up if() range tests in stmmac_clk_csr_set() - use STMMAC_CSR_xxx definitions in initialisers Untested on hardware; would be grateful for any testing people can do. v2: add "Return:" to patch 1 and 9 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 5 +- .../net/ethernet/stmicro/stmmac/dwmac-loongson.c | 3 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 82 ----- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 345 ++++++++++++--------- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 5 +- 6 files changed, 207 insertions(+), 235 deletions(-) -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!