From: netdev-bot+sashiko@kernel.org
To: frieder@fris.de
Cc: claudiu.manoil@nxp.com, vladimir.oltean@nxp.com,
wei.fang@nxp.com, xiaoning.wang@nxp.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, richardcochran@gmail.com,
imx@lists.linux.dev, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
frieder.schrempf@kontron.de
Subject: Re: [PATCH net-next 3/4] net: enetc: add i.MX952 ENETC support
Date: Sun, 22 Nov 2026 11:00:51 +0000 [thread overview]
Message-ID: <179534525124.3135.3738979682916581664@kernel.org> (raw)
In-Reply-To: <20261118-imx952-enetc-v1-3-25721440602e@kontron.de>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 2 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] When an i.MX952 (ENETC rev 4.6) VF cannot get its IP minor
revision from the PF, enetc_vf_get_revision()…
- [Medium] This finding is speculative.
--
net: enetc: add i.MX952 ENETC support
This commit adds ENETC revision 4.6 (i.MX952) entries to the enetc_info
table, with new PF and VF driver data that use a 133 MHz sysclk. It also
maps revision 4.6 to a PTP timer at PCI_DEVFN(0, 1) in
enetc_get_phc_index_by_pdev().
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
> index c6571b5cc8425..4ef387578b1e4 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
[ ... ]
> @@ -3832,6 +3840,13 @@ static const struct enetc_drvdata enetc4_vf_data = {
> .eth_ops = &enetc_vf_ethtool_ops,
> };
>
> +static const struct enetc_drvdata enetc4_6_vf_data = {
> + .sysclk_freq = ENETC_CLK_133M,
> + .tx_csum = true,
> + .max_frags = ENETC4_MAX_SKB_FRAGS,
> + .eth_ops = &enetc_vf_ethtool_ops,
> +};
> +
[Severity: Medium]
What happens to an i.MX952 VF when it cannot get the minor revision from
the PF? enetc_vf_get_revision() in enetc_vf.c falls back to a fixed
revision:
drivers/net/ethernet/freescale/enetc/enetc_vf.c:enetc_vf_get_revision() {
...
ip_mn = enetc_vf_get_ip_minor_revision(si);
if (ip_mn >= 0) {
si->revision = (si->pdev->revision << 8) | ip_mn;
return;
}
si->revision = ENETC_REV_4_1;
...
}
In that case enetc_get_driver_data() matches the ENETC_REV_4_1 VF entry.
It selects enetc4_vf_data (333 MHz) instead of enetc4_6_vf_data
(133 MHz), and enetc_vf_netdev_setup() copies the 333 MHz value into
priv->sysclk_freq.
Before this patch every v4 VF drvdata used 333 MHz, so the fallback still
gave the right clock. Now that rev 4.6 uses a different sysclk, would
every usec/cycle conversion on that VF be off by about 2.5x?
For example, enetc_init_si_rings_params() does:
priv->tx_ictt = enetc_usecs_to_cycles(600, priv->sysclk_freq);
At the real 133 MHz clock this works out to about 1.5 ms instead of
600 us. The RX DIM work and the ethtool coalesce get/set paths would be
scaled by the same wrong factor.
The fallback also makes enetc_get_phc_index_by_pdev() take the
ENETC_REV_4_1 case. That case looks up the timer at PCI_DEVFN(24, 0), not
at the PCI_DEVFN(0, 1) added below for rev 4.6. Without a ptp-timer
phandle, could the VF then report no PHC, or the wrong one?
The fallback runs whenever enetc_vf_get_ip_minor_revision() returns an
error. That can be a DMA allocation failure, a busy mailbox, a poll
timeout, or an error status from the PF.
> static const struct enetc_platform_info enetc_info[] = {
> { .revision = ENETC_REV_1_0,
> .dev_id = ENETC_DEV_ID_PF,
[ ... ]
> diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
> index 7965dfd06f5f6..3c6c6fc0ab8cf 100644
> --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
> +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c
> @@ -1149,6 +1149,7 @@ static int enetc_get_phc_index_by_pdev(struct enetc_si *si)
> devfn = PCI_DEVFN(24, 0);
> break;
> case ENETC_REV_4_3:
> + case ENETC_REV_4_6:
> devfn = PCI_DEVFN(0, 1);
> break;
[Severity: Medium]
Is there a NETC timer at 00.1 on the bus of each i.MX952 ENETC?
netc_blk_ctrl.c puts the two i.MX952 ENETCs on different buses:
#define IMX952_ENETC0_BUS_DEVFN 0x0
#define IMX952_ENETC1_BUS_DEVFN 0x100
This lookup uses the ENETC's own bus->number. So ENETC0 would look for a
timer at 00:00.1, and ENETC1 would look for one at 01:00.1.
i.MX94 has a timer at 00.1 on each bus. It also programs the
ENETC-to-timer binding explicitly in imx94_enetc_update_tid():
netc_reg_write(priv->ierb, IERB_ETBCR(eid), tid);
imx952_ierb_init() only writes the byte credit registers and never
programs IERB_ETBCR. There are also no i.MX952 timer definitions or NETC
DT nodes in the tree to compare against, so I couldn't verify the
topology. This may well be fine on real hardware.
If only one timer exists, would the ENETC on the other bus get -1 here
and report no PHC?
If each bus has its own timer, but the reset value of IERB_ETBCR does not
bind each ENETC to the timer on its own bus, could the PHC index reported
to userspace differ from the timer that actually timestamps the packets?
> default:
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261118-imx952-enetc-v1-0-25721440602e%40kontron.de
next prev parent reply other threads:[~2026-11-22 11:00 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 10:37 [PATCH net-next 0/4] net: enetc: Add i.MX952 support Frieder Schrempf
2026-11-18 10:37 ` [PATCH net-next 1/4] dt-bindings: net: nxp,netc-blk-ctrl: add i.MX952 compatible Frieder Schrempf
2026-11-18 17:43 ` Conor Dooley
2026-11-18 10:37 ` [PATCH net-next 2/4] net: enetc: netc_blk_ctrl: add i.MX952 support Frieder Schrempf
2026-11-18 13:51 ` Andrew Lunn
2026-11-22 11:00 ` netdev-bot+sashiko
2026-11-18 10:37 ` [PATCH net-next 3/4] net: enetc: add i.MX952 ENETC support Frieder Schrempf
2026-11-19 10:38 ` sashiko-bot
2026-11-22 11:00 ` netdev-bot+sashiko [this message]
2026-11-18 10:37 ` [PATCH net-next 4/4] ptp: netc: use 133 MHz system clock on i.MX952 Frieder Schrempf
2026-11-19 10:38 ` sashiko-bot
2026-11-18 10:43 ` [PATCH net-next 0/4] net: enetc: Add i.MX952 support Clark Wang
2026-11-18 10:50 ` Frieder Schrempf
-- strict thread matches above, loose matches on Subject: below --
2026-11-04 9:22 [PATCH net-next 0/4] net: enetc: add i.MX952 NETC v4.6 support xiaoning.wang
2026-11-04 9:22 ` [PATCH net-next 3/4] net: enetc: add i.MX952 ENETC support xiaoning.wang
2026-11-05 9:27 ` sashiko-bot
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=179534525124.3135.3738979682916581664@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=frieder.schrempf@kontron.de \
--cc=frieder@fris.de \
--cc=imx@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=vladimir.oltean@nxp.com \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/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