From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B09712686AA for ; Fri, 18 Apr 2025 09:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.198 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744968319; cv=none; b=g8n6ENi+ub820CW8h+Q/7q6vY1drCnaMBtoGaWzfAHyWitpn5w8Rt7h1lNYYmQi/xyAZNIGe1rU3UhOyQ6kV7PuOn+95+L1EDZCGKr92LMRXxbttRqOmMQwlCVKhAER4Evek7SWmGKykEClS1/EzqnCh6rcepWQNRWnuMzGWsQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744968319; c=relaxed/simple; bh=y6791iVnnNSx0lfeHOPuKZIci/CEAl5MVd9WOciYOYY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YvQ5BU3iZulbB7S/g6D+H98OWJBjP7on5PvJTRgTRuoFLbqoTuSBtRiff+O9NECmnC+1Y43DGvE0lB1J0Q228c3Sk1+r0Y4KaaD43nehWMkZ6TUi3db86579+3V3ksGnqbN6mRhkWPOkNhUIrVfqDb0XbVke9+IhYnWeR1rJjvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=EAIyhXe5; arc=none smtp.client-ip=217.70.183.198 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="EAIyhXe5" 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) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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