From patchwork Tue Apr 15 16:29:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 14052449 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 61612C369AB for ; Tue, 15 Apr 2025 16:48:19 +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=dN5nYyiU35H99VU7lHwdDyUBPUQ+9txXBMSlQXrMmdM=; b=450Pw9ZwVx2YE0W2ZPMZvBHLdG rYqmgMXYHWeKp69+CMFZ/Fjq871yGnhxekkjYXQDrkHKdiqL24hShjTyfpYKAL32oon9l3byRyKHP TZfL0P8Co1eHiQwJnP5rFR+nHeVDQdqAEAwLZUUQ0v/Amdc6uQv/UPvuIfpbb8m0gDiLPtYAkY6rN EpmfoQNQkM3+Fg7M7ChL3xJhiwP1aYBp9yXMKqj/Cs6AZb5O2Vs0aNZUxubtUYt8CkbbuCmDKbw0R zYPfrOVe1yLaRBLHxgUvW14tje7mUGXXO8d1nv2zsx1jqjSeHfKy8PzQk/9klaM8hMh/9u56dJ4lu C6FxL+Ww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4jSD-00000006Sj0-12ft; Tue, 15 Apr 2025 16:48:09 +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 1u4jAK-00000006Pt0-2W46 for linux-arm-kernel@lists.infradead.org; Tue, 15 Apr 2025 16:29:42 +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=dN5nYyiU35H99VU7lHwdDyUBPUQ+9txXBMSlQXrMmdM=; b=tCSG7ijLCLZYTgm+x8yJfhVWNb j77xBlbDb8pWvFuI2hysvtt0TlXtumAMr2ujSjel9si064CRoAIYdeQkONNCnFnCnM6lZOHz4uHmd X0Pb3ZR8VBnv1ChNx8e5faJHZ6NxCcscq2OevudnD7kXgoXqzNy4SEvLD84TCeOOQPsmx+/+JEzKN a1reWh8eAecpU6u04O2S2FHRM7rK+x1lSXuitaUKUt5WM9f0g99uNbG1kztF200CSFjKBL/nvZCXS XkYr1749Mnal/2wYTqA5GcvQm9j10haHGEAOmzFgVDE6czJr4FYasyFKpwikEJVtrOAKCDHQI0FdM iiMk/kwA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33638) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u4jAC-0008T0-0g; Tue, 15 Apr 2025 17:29:32 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1u4jA8-0000Vx-14; Tue, 15 Apr 2025 17:29:28 +0100 Date: Tue, 15 Apr 2025 17:29:28 +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 0/5] net: stmmac: socfpga: fix init ordering and cleanups Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250415_092940_916571_A5D9EE62 X-CRM114-Status: GOOD ( 10.42 ) 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 Hi, This series fixes the init ordering of the socfpga probe function. The standard rule is to do all setup before publishing any device, and socfpga violates that. I can see no reason for this, but these patches have not been tested on hardware. Address this by moving the initialisation of dwmac->stmmac_rst along with all the other dwmac initialisers - there's no reason for this to be late as plat_dat->stmmac_rst has already been populated. Next, replace the call to ops->set_phy_mode() with an init function socfpga_dwmac_init() which will then be linked in to plat_dat->init. Then, add this to plat_dat->init, and switch to stmmac_pltfr_pm_ops from the private ops. The runtime suspend/resume socfpga implementations are identical to the platform ones, but misses the noirq versions which this will add. Next, swap the order of socfpga_dwmac_init() and stmmac_dvr_probe(). Finally, convert to devm_stmmac_pltfr_probe() by moving the call to ops->set_phy_mode() into an init function appropriately populating plat_dat->init. .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 79 +++++----------------- 1 file changed, 16 insertions(+), 63 deletions(-) Signed-off-by: Maxime Chevallier