RE: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices
From: Claudiu Manoil
Date: Wed Nov 18 2026 - 10:43:42 EST
From: netdev-bot+sashiko@xxxxxxxxxx <netdev-bot+sashiko@xxxxxxxxxx>
Sent: Tuesday, November 17, 2026 5:55 PM
> To: Claudiu Manoil <claudiu.manoil@xxxxxxx>
> Cc: netdev@xxxxxxxxxxxxxxx; dl-S32 <S32@xxxxxxx>; bhelgaas@xxxxxxxxxx;
> linux-pci@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; kuba@xxxxxxxxxx
> Subject: Re: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4
> devices
>
> 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] This patch adds ENETC_REV_4_4 entries to enetc_info[] so that
> S32N79 PFs (0xe101/0xe110) and VFs (0xef00) now probe.
> - [Medium] When an ENETC v4 VF cannot get the IP minor revision from its
> PF over the VSI-PSI mailbox, enetc_vf_get_revision()...
>
> --
>
> net: enetc: Enable probing of version 4.4 devices
>
> This commit adds driver data and platform info entries for the ENETC v4.4
> PF and VF devices on S32N79 SoCs. These run with a 500 MHz system clock.
> The PFs use the 0xe101 or 0xe110 device ID and the VFs use 0xef00.
>
> > diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c
> b/drivers/net/ethernet/freescale/enetc/enetc.c
> > index 855b2d3b87182..e3aa117d323d5 100644
> > --- a/drivers/net/ethernet/freescale/enetc/enetc.c
> > +++ b/drivers/net/ethernet/freescale/enetc/enetc.c
> > @@ -3840,6 +3840,20 @@ static const struct enetc_drvdata
> enetc4_vf_data = {
>
> [ ... ]
>
> > +static const struct enetc_drvdata enetc4_s32n79_vf_data = {
> > + .sysclk_freq = ENETC_CLK_500M,
> > + .tx_csum = true,
> > + .max_frags = ENETC4_MAX_SKB_FRAGS,
> > + .eth_ops = &enetc_vf_ethtool_ops,
> > +};
>
> [Severity: Medium]
> Can an S32N79 VF end up with the 333 MHz drvdata instead of this one?
>
> The VF gets its minor revision from the PF over the VSI-PSI mailbox. If
> that query fails, enetc_vf_get_revision() falls back to 4.1:
If the enetc_vf_get_revision() query fails we have bigger concerns than
the VF coalescing operating on a 333 MHz reference. There's no fix for this
fail, and it's outside the scope of this patch set.
>
> 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;
> ...
> }
>
> The query can fail in several ways:
>
> - -EIO when the mailbox is busy
> - -ETIMEDOUT after the 200 ms poll
> - an error status returned by the PSI
> - -ENOMEM from dma_alloc_coherent()
>
> S32N79 VFs use the same 0xef00 device ID. So in that case
> enetc_get_driver_data() matches {ENETC_REV_4_1, NXP_ENETC_VF_DEV_ID}
> and selects enetc4_vf_data, which uses ENETC_CLK_333M.
> enetc_vf_netdev_setup() then copies that value into priv->sysclk_freq.
>
> Before this patch every v4 platform ran at 333 MHz, so the fallback made no
> difference. On a 500 MHz platform, wouldn't enetc_usecs_to_cycles()
> program the default 600 us tx_ictt, the DIM rx_ictt and the set_coalesce values at
> roughly 0.67x the requested timeout?
>
> enetc_get_coalesce() converts back with the same clock. So ethtool -c would
> still show the requested values while the hardware fires about 1.5x sooner.
>
> Should the fallback change now that v4 platforms don't all use the same
> clock frequency?
>
> > @@ -3870,6 +3884,18 @@ static const struct enetc_platform_info
> enetc_info[] = {
> > .dev_id = NXP_ENETC_VF_DEV_ID,
> > .data = &enetc4_vf_data,
> > },
> > + { .revision = ENETC_REV_4_4,
> > + .dev_id = NXP_ENETC_PPM_DEV_ID,
> > + .data = &enetc4_s32n79_ppm_data,
> > + },
> > + { .revision = ENETC_REV_4_4,
> > + .dev_id = NXP_ENETC_PF_DEV_ID,
> > + .data = &enetc4_s32n79_ppm_data,
> > + },
> > + { .revision = ENETC_REV_4_4,
> > + .dev_id = NXP_ENETC_VF_DEV_ID,
> > + .data = &enetc4_s32n79_vf_data,
> > + },
>
> [Severity: Medium]
> Does enetc_get_phc_index_by_pdev() in enetc_ethtool.c also need an
> ENETC_REV_4_4 case? It has its own per-revision table for the timer devfn:
>
In short, no. PTP support for ENETC 4.4 is not available at this point.
The explanation is the same as replied here, for v2:
https://patchwork.kernel.org/project/netdevbpf/patch/537a977b10b3d76c30b1f879f423bde4fd6f42f8.1791908694.git.claudiu.manoil@xxxxxxx/#27330675
The VF for v4.4 does not support the existing timestamping scheme.
On platforms with NETC v4.4, CONFIG_PTP_NETC_V4_TIMER will not be 'enabled'
since the v4 timer is a separate device on a different bus that is not owned by Linux,
on v4.4 SoCs. No need to modify ndo_hwtstamp_set() in this case, and it's outside
the scope of this patch set anyway.
> drivers/net/ethernet/freescale/enetc/enetc_ethtool.c:enetc_get_phc_index_b
> y_pdev() {
> ...
> switch (si->revision) {
> case ENETC_REV_1_0:
> devfn = PCI_DEVFN(0, 4);
> break;
> case ENETC_REV_4_1:
> devfn = PCI_DEVFN(24, 0);
> break;
> case ENETC_REV_4_3:
> devfn = PCI_DEVFN(0, 1);
> break;
> default:
> return -1;
> }
> ...
> }
>
> enetc4_s32n79_vf_data uses enetc_vf_ethtool_ops, which provides
> enetc_get_ts_info(). SR-IOV VFs have no OF node, so enetc_get_phc_index()
> always takes the per-pdev path. For a v4.4 VF the call chain is:
>
> enetc_get_ts_info()
> enetc_get_phc_index()
> enetc_get_phc_index_by_pdev()
> default: return -1
>
> enetc_get_ts_info() then jumps to timestamp_tx_sw. It reports no PHC and
> only SOF_TIMESTAMPING_TX_SOFTWARE.
>
> enetc_hwtstamp_set() and enetc_hwtstamp_get() still accept hardware
> timestamping configs, because they only check
> enetc_ptp_clock_is_enabled().
>
> Would ptp4l and similar tools then fail to find a PHC on S32N79 VFs?
>
> The v4.4 PF uses enetc4_ppm_ethtool_ops, which has no get_ts_info, so this
> seems to affect only the VFs.
>
> The code doesn't show whether a NETC timer is reachable on the VF's PCI
> bus on S32N79. If PTP is intentionally left unsupported on v4.4, could the
> commit message say so?
>
https://patchwork.kernel.org/project/netdevbpf/patch/537a977b10b3d76c30b1f879f423bde4fd6f42f8.1791908694.git.claudiu.manoil@xxxxxxx/#27330675