* [PATCH v2 net] net: enetc: do not print error log if addr is 0
@ 2025-12-22 2:26 Wei Fang
2025-12-28 19:38 ` Vladimir Oltean
2025-12-30 10:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Wei Fang @ 2025-12-22 2:26 UTC (permalink / raw)
To: claudiu.manoil, vladimir.oltean, xiaoning.wang, andrew+netdev,
davem, edumazet, kuba, pabeni
Cc: netdev, linux-kernel, imx
A value of 0 for addr indicates that the IEB_LBCR register does not
need to be configured, as its default value is 0. However, the driver
will print an error log if addr is 0, so this issue needs to be fixed.
Fixes: 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
v2 changes:
Separate tests for "if (addr < 0)" and a later "if (!addr)".
v1: https://lore.kernel.org/imx/20251219082922.3883800-1-wei.fang@nxp.com/
---
drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c
index 443983fdecd9..7fd39f895290 100644
--- a/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c
+++ b/drivers/net/ethernet/freescale/enetc/netc_blk_ctrl.c
@@ -577,11 +577,17 @@ static int imx94_enetc_mdio_phyaddr_config(struct netc_blk_ctrl *priv,
}
addr = netc_get_phy_addr(np);
- if (addr <= 0) {
+ if (addr < 0) {
dev_err(dev, "Failed to get PHY address\n");
return addr;
}
+ /* The default value of LaBCR[MDIO_PHYAD_PRTAD] is 0,
+ * so no need to set the register.
+ */
+ if (!addr)
+ return 0;
+
if (phy_mask & BIT(addr)) {
dev_err(dev,
"Find same PHY address in EMDIO and ENETC node\n");
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net] net: enetc: do not print error log if addr is 0
2025-12-22 2:26 [PATCH v2 net] net: enetc: do not print error log if addr is 0 Wei Fang
@ 2025-12-28 19:38 ` Vladimir Oltean
2025-12-30 10:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2025-12-28 19:38 UTC (permalink / raw)
To: Wei Fang
Cc: claudiu.manoil, xiaoning.wang, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel, imx
On Mon, Dec 22, 2025 at 10:26:28AM +0800, Wei Fang wrote:
> A value of 0 for addr indicates that the IEB_LBCR register does not
> need to be configured, as its default value is 0. However, the driver
> will print an error log if addr is 0, so this issue needs to be fixed.
>
> Fixes: 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
> ---
> v2 changes:
> Separate tests for "if (addr < 0)" and a later "if (!addr)".
> v1: https://lore.kernel.org/imx/20251219082922.3883800-1-wei.fang@nxp.com/
> ---
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2 net] net: enetc: do not print error log if addr is 0
2025-12-22 2:26 [PATCH v2 net] net: enetc: do not print error log if addr is 0 Wei Fang
2025-12-28 19:38 ` Vladimir Oltean
@ 2025-12-30 10:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-12-30 10:30 UTC (permalink / raw)
To: Wei Fang
Cc: claudiu.manoil, vladimir.oltean, xiaoning.wang, andrew+netdev,
davem, edumazet, kuba, pabeni, netdev, linux-kernel, imx
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Mon, 22 Dec 2025 10:26:28 +0800 you wrote:
> A value of 0 for addr indicates that the IEB_LBCR register does not
> need to be configured, as its default value is 0. However, the driver
> will print an error log if addr is 0, so this issue needs to be fixed.
>
> Fixes: 50bfd9c06f0f ("net: enetc: set external PHY address in IERB for i.MX94 ENETC")
> Signed-off-by: Wei Fang <wei.fang@nxp.com>
>
> [...]
Here is the summary with links:
- [v2,net] net: enetc: do not print error log if addr is 0
https://git.kernel.org/netdev/net/c/5939b6dbcda8
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-30 10:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-22 2:26 [PATCH v2 net] net: enetc: do not print error log if addr is 0 Wei Fang
2025-12-28 19:38 ` Vladimir Oltean
2025-12-30 10:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).