From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 159312836A4 for ; Fri, 12 Dec 2025 06:41:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765521676; cv=none; b=RPXXaOsb27yu8xKBmBFHIDQkLlnkfo2Hb8tARtdfcfX62V0WT/lGgD+zXQY1CBeJrh7U+kyOzJiXlyGdhG8v0o1JAzddz7CyaGBMaaLUWX/XojYmXVqqxGY5+lSnfGTf/6mq9USfhh2Q7Q70bi8plNbLuJHFcyGMkFsHNgRDEBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765521676; c=relaxed/simple; bh=EGGjWYnkkHDyueL0BDm4DN/rC1WlBNGx0u/5qlcPAFA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GCcAPu7QNRY0+vlqSk9q3t49fRuSkrEaTU55H67hAIqppcNzBT3jIkI3mhab6agsWN2YiD9a4jr6u97e4rGuX4HnOOU2aZon6LL7E4mYTkF0uZ2CkrUdFezR7R6DVJR6HBV5QCWf3D1GFx6bGneWlrg0sFEOgt+2CmIBBQkGqws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=tYM9o4Hb; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="tYM9o4Hb" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-477aa218f20so5681585e9.0 for ; Thu, 11 Dec 2025 22:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765521672; x=1766126472; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/0dbF2KGAYM3vdkkaB9ys4HQSTDRocKJY/9bGXcOOVY=; b=tYM9o4HbBtBZCS7IgxuzB3LW8VMuorLZkcvJnLi3Xntn9TrO8h8vvm1deF587AhjD0 m4jvZd/OegEkOfbSa/eQFlu5nuyG/EMSNi04VYcvpN9Ufh8429qBeDByAPiWDaMP46TG xmrWoKWFhygCGOjqssCzjliDJSJ/CmJMXgGymzZq11KeTwu6QTR+m7FqFmXesaPpVFrp 8dVVaaQO7Mt2v6pXo7ekFm3Lt2iKtFFbxyZh03XW0N+a4lHJ7Y0prcnYNeb47zfkLz5Y HAwW8v0jknmPZNzcGAbCeN6DZfsAmQ6PBkdwgKOsLh7JTVgyZunV0fHFqsc8/VJEMAuS fDFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765521672; x=1766126472; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/0dbF2KGAYM3vdkkaB9ys4HQSTDRocKJY/9bGXcOOVY=; b=mdAFPbt9Ir6SgPfyRLzF49WF+BhdrVrm3fuQhuuIR6KcB7OgwRxGb6d0ekN8Gbqw6R wgD4HxThGpoLWrlzZcWha7FSqVhqsglHo5R8n1IuELpurTTaV4c7PsaH2WUIlH6Ltztf zKQldg1IpSCxtJL5E2ZgIudxwJeWtZu5ag7ghzWoN+jqH745xuzbwedzqOiFKJy93ANI 3Ui4NnUHx57/Ge3RkKRU1eHPgE3ZTUc05r4Y8sRaxmk+3BuqhLadzdh/MFhcsoczhVBU 7xNajmUPglm0ync/fPT4yrssIzYBn13QR7QwMKNi8qFvDVk2tc9vjvchlrIOlFn+3rn6 3EIA== X-Forwarded-Encrypted: i=1; AJvYcCWJh3hQBSq9kIpVm8lRKKJjcGrC3P96iyjrS6WQgVkNU+e1pxrCvd36D5McZRtsnvrw0x94FPbT9A+Kzj0=@vger.kernel.org X-Gm-Message-State: AOJu0Ywqss5gQb0iNbCqpR43/1bgdMeIaQo6QoGzQT87SgkicPFYHOBg JyjQvslvW3EUh1ZyQt7tO3Zx/u3b/LYZbS4ftICXTO+q8UnINqFfSaxuYchPwUTUDoI= X-Gm-Gg: AY/fxX58ShgbgQ6uQ9PdwbT8mdSz8CCeHnI6zELTfYCWhuCgi+WV6k24uAGxjjTfUWT ba7/sYDxB0Bmu+Hq7EOJzzetsIuQ3GCu/H9/Hs/O1y63nbcSNJ3/ST00MdWt+bxNjuWnx/D3e1R YjK9OrLt3jsvbbS3vssR7w1XxtS1ds9ZQv/9pkBA0vMIZpd/8Vq8VpJOjXwyqCjQeFmsYDquGrS CDik1xSgu+3f6/a7UktfJ6L36GqAF93124wtsTBY/YlTy/8qM4xWQGDTio3sYEbCrqVPZtD6SEF Sx89+G+rgkrBTaaF9V+deUMjnZbaxmEVuNLvbWQ0sdsiciM0vUqFV1BFWId+SxgZf+Bic4ta6Jf mgePHCa6O5qjCSsCE5OeCRCtB5nF3iNhBoVxiIau2xOq7IFK7LHXQ8aouiFV/TIk+X0wwnjNfYD YJtge1gChnr63/BsMA X-Google-Smtp-Source: AGHT+IF5qezNkUaAJ9catHYZZtFdsT9KvXk7hbPAPFs0cPAp04mHo7MQ82wa12a1D0dIkmm73s4oQQ== X-Received: by 2002:a05:600c:470b:b0:479:2a09:9262 with SMTP id 5b1f17b1804b1-47a8f8c00d1mr7099105e9.9.1765521672165; Thu, 11 Dec 2025 22:41:12 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f3a1b17sm5503315e9.2.2025.12.11.22.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 22:41:11 -0800 (PST) Date: Fri, 12 Dec 2025 09:41:08 +0300 From: Dan Carpenter To: "Russell King (Oracle)" Cc: Jan Petrous , s32@nxp.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linaro-s32@linaro.org Subject: Re: [PATCH 1/4] net: stmmac: s32: use the syscon interface PHY_INTF_SEL_RGMII Message-ID: References: <6275e666a7ef78bd4c758d3f7f6fb6f30407393e.1764592300.git.dan.carpenter@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Dec 01, 2025 at 04:48:12PM +0000, Russell King (Oracle) wrote: > On Mon, Dec 01, 2025 at 04:08:20PM +0300, Dan Carpenter wrote: > > On the s32 chipset the GMAC_0_CTRL_STS register is in GPR region. > > Originally, accessing this register was done in a sort of ad-hoc way, > > but we want to use the syscon interface to do it. > > > > This is a little bit uglier because we to maintain backwards compatibility > > to the old device trees so we have to support both ways to access this > > register. > > > > Signed-off-by: Dan Carpenter > > --- > > .../net/ethernet/stmicro/stmmac/dwmac-s32.c | 23 +++++++++++++++---- > > 1 file changed, 18 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c > > index 5a485ee98fa7..20de761b7d28 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c > > @@ -11,12 +11,14 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > #include > > #include > > #include > > +#include > > #include > > > > #include "stmmac_platform.h" > > @@ -32,6 +34,8 @@ > > struct s32_priv_data { > > void __iomem *ioaddr; > > void __iomem *ctrl_sts; > > + struct regmap *sts_regmap; > > + unsigned int sts_offset; > > struct device *dev; > > phy_interface_t *intf_mode; > > struct clk *tx_clk; > > @@ -40,7 +44,10 @@ struct s32_priv_data { > > > > static int s32_gmac_write_phy_intf_select(struct s32_priv_data *gmac) > > { > > - writel(S32_PHY_INTF_SEL_RGMII, gmac->ctrl_sts); > > + if (gmac->ctrl_sts) > > + writel(S32_PHY_INTF_SEL_RGMII, gmac->ctrl_sts); > > + else > > + regmap_write(gmac->sts_regmap, gmac->sts_offset, PHY_INTF_SEL_RGMII); > > Sorry, but even if that regmap_write() is targetting the exact same > register, these are not identical. > > S32_PHY_INTF_SEL_RGMII, which is a S32-specific value, takes the value 2. > PHY_INTF_SEL_RGMII is the dwmac specific value, and takes the value 1. > > If this targets the same register, then by writing PHY_INTF_SEL_RGMII, > you are in effect writing the equivalent of S32_PHY_INTF_SEL_SGMII to > it. This seems like a bug. > Yeah. Sorry, I forward ported this, then back ported it, then forward ported this again and I messed up. :( regards, dan carpenter