mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Claudiu Manoil <claudiu.manoil@nxp.com>
To: "netdev-bot+sashiko@kernel.org" <netdev-bot+sashiko@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	dl-S32 <S32@nxp.com>, "bhelgaas@google.com" <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kuba@kernel.org" <kuba@kernel.org>
Subject: RE: [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices
Date: Wed, 18 Nov 2026 15:43:30 +0000	[thread overview]
Message-ID: <GV2PR04MB11740A7E208FDFCD4A158BF41967A2@GV2PR04MB11740.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <179493091076.3136.7730860553084197808@kernel.org>

From: netdev-bot+sashiko@kernel.org <netdev-bot+sashiko@kernel.org>
Sent: Tuesday, November 17, 2026 5:55 PM
> To: Claudiu Manoil <claudiu.manoil@nxp.com>
> Cc: netdev@vger.kernel.org; dl-S32 <S32@nxp.com>; bhelgaas@google.com;
> linux-pci@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org
> 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@nxp.com/#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@nxp.com/#27330675

  reply	other threads:[~2026-11-18 15:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1794581338.git.claudiu.manoil@nxp.com>
2026-11-13 15:02 ` [PATCH net-next v4 1/6] net: enetc: Add pseudo-MAC support for ENETCv4 Ports via a fixed-link node Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 16:11     ` Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 2/6] net: enetc: Allocate int_vector array dynamically Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 3/6] net: enetc: Enable probing of version 4.4 devices Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-18 15:43     ` Claudiu Manoil [this message]
2026-11-13 15:02 ` [PATCH net-next v4 4/6] arm64: dts: s32n79: add NETC IEP18 ECAM node for ENETC PPM ports Claudiu Manoil
2026-11-13 15:02 ` [PATCH net-next v4 5/6] arm64: dts: s32n79-rdb: enable NETC IEP18 Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko
2026-11-13 15:02 ` [PATCH net-next v4 6/6] PCI: Create OF node for NXP ENETC pseudo-MAC functions Claudiu Manoil
2026-11-17 15:55   ` netdev-bot+sashiko

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=GV2PR04MB11740A7E208FDFCD4A158BF41967A2@GV2PR04MB11740.eurprd04.prod.outlook.com \
    --to=claudiu.manoil@nxp.com \
    --cc=S32@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.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

all inboxes | Powered by JetHome®