From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (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 F027A18FDD5 for ; Wed, 16 Apr 2025 08:32:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.196 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744792382; cv=none; b=mxI1ogJRWJTPqgnWLVrMdV4Om4be7qJXNAwXMh8/Yp90pl6lQvT2YWli+R7mxQeVNoty+Lamg7CpccXQa/yqDtRpUTMiDs+7ux8r/kzQgtYHuzdzuKFVo5bP7Ti6qEwxtph8AOvsITVB7wyvWiBHR2P3u8mpkCxgyLvZHvFTBHA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744792382; c=relaxed/simple; bh=2WVJBRqhDFU85DmzsRJ7X3VnauLaC/rGvRhHi4S7aAg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=l2pLgzEekXH+074WOa60K2pORfJ4Lc1LuuqyMsjdKUHpIrSftWv5hb3L7nT6WrDgpKGke3dEO9jRyCM7577gHSRNbdFB0Pq6WUiuqSZsSTBhqLx7CsvwdKLvaOTHFE9vfFPiyDySLhJK1zEGskUHoX08YNkXn+ZulnsUfXxxx5Y= 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=UWDn9fuG; arc=none smtp.client-ip=217.70.183.196 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="UWDn9fuG" Received: by mail.gandi.net (Postfix) with ESMTPSA id 05D39433EC; Wed, 16 Apr 2025 08:32:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1744792378; 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=RQGQgS3fn9DpLHF39v5wKc9omOFCoaDRzybsm2gWEIE=; b=UWDn9fuGUR59UV7s0DWAYDL0GZA6lja8F9iLNR0CJm41eX4TBQgHujtyQR0dQ9lamNwbKK ynw+rFpw8QvOgLP1M3LsmaAyOW+wqFCNfkKm+jiiwo8yaIvcsXSQH1gEzk5+T5cMLBPCqB /egJWGENgZXhvhu721EkXQG3NWlIw3g5Z4nzBLcj35NcuJF/RQcuko7k6+AjY14H0w7Juj M9r59IYpzvkiQsahyB2sxO0hsXuO4821Y4D3oXYm4KUWzjbFxRw0LKsU0MCo7EgWbM+bbr uE5v0PHcjcYVzMvUPaN3fPUf2HBJbOJJ1Onc+KB/DPZiNxgYzwGymLzNd5zKkA== Date: Wed, 16 Apr 2025 10:32:53 +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 0/5] net: stmmac: socfpga: fix init ordering and cleanups Message-ID: <20250416103253.629db3de@fedora.home> In-Reply-To: References: <20250416095343.1820272f@fedora.home> 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: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdehledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfgjfhhoofggtgfgsehtjeertdertddvnecuhfhrohhmpeforgigihhmvgcuvehhvghvrghllhhivghruceomhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomheqnecuggftrfgrthhtvghrnhepgeevledtvdevueehhfevhfelhfekveeftdfgiedufeffieeltddtgfefuefhueeknecukfhppedvrgdtudemtggsudelmeekugegheemgeeltddtmeeiheeikeemvdelsgdumeelvghfheemvgektgejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdgrtddumegtsgduleemkegugeehmeegledttdemieehieekmedvlegsudemlegvfhehmegvkegtjedphhgvlhhopehfvgguohhrrgdrhhhomhgvpdhmrghilhhfrhhomhepmhgrgihimhgvrdgthhgvvhgrlhhlihgvrhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepudefpdhrtghpthhtoheplhhinhhugiesrghrmhhlihhnuhigrdhorhhgrdhukhdprhgtphhtthhopegrnhgurhgvfieslhhunhhnrdgthhdprhgtphhtthhopehhkhgrlhhlfigvihhtudesghhmrghilhdrtghomhdprhgtp hhtthhopegrlhgvgigrnhgurhgvrdhtohhrghhuvgesfhhoshhsrdhsthdrtghomhdprhgtphhtthhopegrnhgurhgvfidonhgvthguvghvsehluhhnnhdrtghhpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdrnhgvthdprhgtphhtthhopegvughumhgriigvthesghhoohhglhgvrdgtohhmpdhrtghpthhtohepkhhusggrsehkvghrnhgvlhdrohhrgh X-GND-Sasl: maxime.chevallier@bootlin.com On Wed, 16 Apr 2025 09:20:38 +0100 "Russell King (Oracle)" wrote: > On Wed, Apr 16, 2025 at 09:53:43AM +0200, Maxime Chevallier wrote: > > I've given this a try and unfortunately : > > Great, someone with hardware, and who responds to patches! :) > > > This is only to get the phymode, maybe we should do like dwmac_imx > > and store a pointer to plat_dat into struct dwmac_socfpga, so that we > > can get it back in dwmac_init ? I've tried with the patch below and it > > does solve the issue, but maybe you have a better approach. > > Yes, but I don't think we need such a big patch: > > drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > index 8e6d780669b9..59f90b123c5b 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c > @@ -50,6 +50,7 @@ struct socfpga_dwmac { > u32 reg_offset; > u32 reg_shift; > struct device *dev; > + struct plat_stmmacenet_data *plat_dat; > struct regmap *sys_mgr_base_addr; > struct reset_control *stmmac_rst; > struct reset_control *stmmac_ocp_rst; > @@ -233,10 +234,7 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * > > static int socfpga_get_plat_phymode(struct socfpga_dwmac *dwmac) > { > - struct net_device *ndev = dev_get_drvdata(dwmac->dev); > - struct stmmac_priv *priv = netdev_priv(ndev); > - > - return priv->plat->mac_interface; > + return dwmac->plat_dat->mac_interface; > } > > static void socfpga_sgmii_config(struct socfpga_dwmac *dwmac, bool enable) > @@ -490,6 +488,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) > */ > dwmac->stmmac_rst = plat_dat->stmmac_rst; > dwmac->ops = ops; > + dwmac->plat_dat = plat_dat; > > plat_dat->bsp_priv = dwmac; > plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed; > Even better indeed ! I've tested it and it works. I'll be happy to test any followup :) Maxime