RE: [PATCH v5 net 3/3] net: enetc: do not access non-existent registers on pseudo MAC
From: Claudiu Manoil <claudiu.manoil@nxp.com>
Date: 2026-03-17 10:32:47
Also in:
imx, lkml
-----Original Message----- From: Wei Fang <wei.fang@nxp.com> Sent: Tuesday, March 17, 2026 4:15 AM
[...]
Subject: RE: [PATCH v5 net 3/3] net: enetc: do not access non-existent registers on pseudo MACquoted
quoted
-----Original Message----- From: Wei Fang <wei.fang@nxp.com> Sent: Friday, March 13, 2026 11:47 AM[...]quoted
Subject: [PATCH v5 net 3/3] net: enetc: do not access non-existent registers on pseudo MAC The ENETC4_PM_IEVENT and ENETC4_PM_CMD_CFG registers do not existonquoted
the ENETC pseudo MAC, so the driver should prevent from accessing them. Fixes: 5175c1e4adca ("net: enetc: add basic support for the ENETC with pseudo MAC for i.MX94") Signed-off-by: Wei Fang <wei.fang@nxp.com> --- Note that the commit 5175c1e4adca ("net: enetc: add basic support for the ENETC with pseudo MAC for i.MX94") does not have such issue, this patch depends on the patch 2 in this patch set. --- drivers/net/ethernet/freescale/enetc/enetc4_pf.c | 7 +++++++ 1 file changed, 7 insertions(+)diff --git a/drivers/net/ethernet/freescale/enetc/enetc4_pf.cb/drivers/net/ethernet/freescale/enetc/enetc4_pf.c index 53cecbb23a97..56899f2254aa 100644--- a/drivers/net/ethernet/freescale/enetc/enetc4_pf.c +++ b/drivers/net/ethernet/freescale/enetc/enetc4_pf.c@@ -814,6 +814,9 @@ static void enetc4_mac_tx_graceful_stop(structenetc_pf *pf) val |= POR_TXDIS; enetc_port_wr(hw, ENETC4_POR, val); + if (enetc_is_pseudo_mac(si)) + return; +Shouldn't the ~PM_CMD_CFG_TX_EN step apply to pseudo-MACs too?Based on the NETC block guide, the pseudo MAC does not have PMa_COMMAND_CONFIG register. So no need to set PM_CMD_CFG_TX_EN and PM_CMD_CFG_RX_EN bits for pseudo MAC.
Right, sorry, I misread the manual. After all, excluding these registers is partly the point of this last patch, as discussed. Meanwhile, I was also able to test your patches on my setup with pseudo-MACs only and it passed. " [ 159.469353] nxp_enetc4 0000:00:00.0 enp0s0f0: configuring for fixed/internal link mode [ 159.469605] nxp_enetc4 0000:00:00.0 enp0s0f0: Link is Up - 2.5Gbps/Full - flow control off " so, Tested-by: Claudiu Manoil <claudiu.manoil@nxp.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>