From: Simon Horman <horms@kernel.org>
To: dan.carpenter@linaro.org
Cc: Simon Horman <horms@kernel.org>,
robh@kernel.org, kuba@kernel.org, festevam@gmail.com,
ghennadi.procopciuc@oss.nxp.com, alexandre.torgue@foss.st.com,
linux-kernel@vger.kernel.org, andrew+netdev@lunn.ch,
shawnguo@kernel.org, mbrugger@suse.com,
mcoquelin.stm32@gmail.com, linaro-s32@linaro.org,
davem@davemloft.net, s.hauer@pengutronix.de, edumazet@google.com,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
conor+dt@kernel.org, krzk+dt@kernel.org,
devicetree@vger.kernel.org, Frank.li@nxp.com,
chester62515@gmail.com, netdev@vger.kernel.org,
kernel@pengutronix.de, pabeni@redhat.com,
jan.petrous@oss.nxp.com,
linux-stm32@st-md-mailman.stormreply.com, s32@nxp.com
Subject: Re: [v4,1/3] net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII
Date: Mon, 26 Jan 2026 15:24:30 +0000 [thread overview]
Message-ID: <20260126152430.1390514-1-horms@kernel.org> (raw)
In-Reply-To: <8f2139e8adf02b485a4c84d558fc23f78cf04add.1769195864.git.dan.carpenter@linaro.org>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII
This commit adds syscon/regmap support for accessing the GMAC_0_CTRL_STS
register on s32 chipsets, while maintaining backwards compatibility with
the existing direct MMIO approach for older device trees.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
> index 5a485ee98fa7..2e6bb41f49e1 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c
[ ... ]
> @@ -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, S32_PHY_INTF_SEL_RGMII);
Should the regmap_write() return value be checked here? The function
returns int and the caller s32_gmac_init() checks the return value
expecting errors to be propagated. For comparison, dwmac-sun55i.c in
sun55i_gmac200_set_syscon() does check regmap_write() return value:
ret = regmap_write(regmap, SYSCON_REG, reg);
if (ret < 0)
return dev_err_probe(dev, ret, "Failed to write to syscon\n");
>
> dev_dbg(gmac->dev, "PHY mode set to %s\n", phy_modes(*gmac->intf_mode));
>
> return 0;
[ ... ]
next prev parent reply other threads:[~2026-01-26 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 19:51 [PATCH v4 0/3] s32g: Use a syscon for GPR Dan Carpenter
2026-01-23 19:51 ` [PATCH v4 1/3] net: stmmac: s32: use a syscon for S32_PHY_INTF_SEL_RGMII Dan Carpenter
2026-01-26 15:24 ` Simon Horman [this message]
2026-01-26 15:33 ` [v4,1/3] " Russell King (Oracle)
2026-01-26 16:01 ` Simon Horman
2026-01-27 8:55 ` Dan Carpenter
2026-01-27 12:57 ` Simon Horman
2026-01-23 19:51 ` [PATCH v4 2/3] dt-bindings: net: nxp,s32-dwmac: Use the GPR syscon Dan Carpenter
2026-01-26 15:45 ` Rob Herring (Arm)
2026-01-23 19:51 ` [PATCH v4 3/3] dts: s32g: Add GPR syscon region Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260126152430.1390514-1-horms@kernel.org \
--to=horms@kernel.org \
--cc=Frank.li@nxp.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=chester62515@gmail.com \
--cc=conor+dt@kernel.org \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=festevam@gmail.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=imx@lists.linux.dev \
--cc=jan.petrous@oss.nxp.com \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linaro-s32@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mbrugger@suse.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox