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 285FEC369CF for ; Fri, 18 Apr 2025 09:27:24 +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-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=saBkvGk3mAYaqEEobk5fJ7hee5mzM6LOhfJoDww8Mt4=; b=QBcd9xOBBalLQmD2ct6UjaAGvh DP51/hg3NAEcKBbMdMv+07gZf3pYxErm29vp7ptRzQKmoqCIKdnPPncZecSrqY4TVSDwa9u5NeRKY nbNq5ZMQlIYP3QhW1t5R80c+r0J2cOhQIq8UHHefVzA1SjhHtc3RJbQoZPR9CCXqcKhHRjGk3xGiF sFnaGiUN5dgu0xB3hPhmBBwQ1bimXjwk5B0g5pme9RnpT9/BJmoVpjgJqS6u8ZhUvp6jaPtiavpRl kj0wcK2gFD79xCPrWOE6+0oWMptC9vloQuc5Qv97j8QBYtGzGDJ5+f5vQ5tjDYDPYtX0DXYKpCKUs 8BCL0Otg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5i09-0000000FkZT-2Vw6; Fri, 18 Apr 2025 09:27:13 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u5hyH-0000000FkP1-0xW5 for linux-arm-kernel@lists.infradead.org; Fri, 18 Apr 2025 09:25:18 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id B944741C93; Fri, 18 Apr 2025 09:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744968314; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=saBkvGk3mAYaqEEobk5fJ7hee5mzM6LOhfJoDww8Mt4=; b=EAIyhXe5p0E6O2vzz8X+luYMG47i71CrkF0MKsepBvLp9Sjsty4vYpQecGOGAX2zeHaoz3 xGLLQg9R2KrDlVZkIjPrLB5MQRwP/H+jJYfbgUTnZaPLF/w83Ji5hGqXNasmp4B86ICdPZ r3vpARj/AxIiVaLmuFDqmUDTU6xaFPGlzlfxBUSooQo3esjc9A2FMITBcP6RBiCX8CtzRt eaKl349u8RAaog/acfgVmuz/GKfd7vZIR0lyWBOLxa2AljLPMYra2rCca6RPvJ0Mzzbxy4 htsuECfiXg7WN9kHs2Kf2ldyzgczcKRtlBL+q4tUYljr1K8b13IZUQliTtsafg== Date: Fri, 18 Apr 2025 11:25:11 +0200 From: Maxime Chevallier To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , 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: Re: [PATCH net-next v3 0/5] net: stmmac: socfpga: fix init ordering and cleanups Message-ID: <20250418112511.0be32c49@fedora.home> In-Reply-To: References: Organization: Bootlin X-Mailer: Claws Mail 4.3.1 (GTK 3.24.43; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfedujeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfgjfhhoofggtgfgsehtjeertdertddvnecuhfhrohhmpeforgigihhmvgcuvehhvghvrghllhhivghruceomhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevledtvdevueehhfevhfelhfekveeftdfgiedufeffieeltddtgfefuefhueeknecukfhppedvrgdtudemtggsudelmeekugegheemgeeltddtmeeiheeikeemvdelsgdumeelvghfheemvgektgejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddumegtsgduleemkegugeehmeegledttdemieehieekmedvlegsudemlegvfhehmegvkegtjedphhgvlhhopehfvgguohhrrgdrhhhomhgvpdhmrghilhhfrhhomhepmhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepudefpdhrtghpthhtoheplhhinhhugiesrghrmhhlihhnuhigrdhorhhgrdhukhdprhgtphhtthhopegrnhgurhgvfieslhhunhhnrdgthhdprhgtphhtthhopehhkhgrlhhlfigvihhtudesghhmrghilhdrtghomhdprhgtp hhtthhopegrlhgvgigrnhgurhgvrdhtohhrghhuvgesfhhoshhsrdhsthdrtghomhdprhgtphhtthhopegrnhgurhgvfidonhgvthguvghvsehluhhnnhdrtghhpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdrnhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtohhmpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrgh X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250418_022517_712548_78D2DD7B X-CRM114-Status: GOOD ( 20.94 ) 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 Russell, On Thu, 17 Apr 2025 18:13:24 +0100 "Russell King (Oracle)" wrote: > 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. > > Before we swap the order of socfpga_dwmac_init() and > stmmac_dvr_probe(), we need to change the way the interface is > obtained, as that uses driver data and the struct net_device which > haven't been initialised. Save a pointer to plat_dat in the socfpga > private data, and use that to get the interface mode. We can then swap > the order of the init and probe functions. > > 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. > > v2: fix oops when calling set_phy_mode() early. > v3: fix unused variable warnings in patch 2, add Maxime's r-b and t-b > to all but patch 2. Looks like they are missing :) I re-tested the whole V3 series though and gave a fresh look at your code, so, Tested-by: Maxime Chevallier Reviewed-by: Maxime Chevallier Thanks ! Maxime