All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: vjardin@free.fr
Cc: yangbo.lu@nxp.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	richardcochran@gmail.com, jacob.e.keller@intel.com,
	kory.maincent@bootlin.com, claudiu.manoil@nxp.com,
	vladimir.oltean@nxp.com, wei.fang@nxp.com, xiaoning.wang@nxp.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, ioana.ciornei@nxp.com
Subject: Re: [PATCH net 3/3] ptp: qoriq: fix support for PTP_EXTTS_REQUEST2 ioctl
Date: Wed, 07 Oct 2026 23:16:44 +0000	[thread overview]
Message-ID: <179141500461.434549.18154635092466251146@kernel.org> (raw)
In-Reply-To: <20261006-for-upstream-qoriq-ptp-extts-flags-v1-3-b4a161b92832@free.fr>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch sets `.supported_extts_flags = PTP_RISING_EDGE |
  PTP_STRICT_FLAGS` in `ptp_qoriq_caps` (drivers/ptp/ptp_qoriq.c).

--

ptp: qoriq: fix support for PTP_EXTTS_REQUEST2 ioctl

The patch sets .supported_extts_flags in ptp_qoriq_caps to
PTP_RISING_EDGE | PTP_STRICT_FLAGS. As a result, PTP_EXTTS_REQUEST2 requests
are no longer rejected with -EOPNOTSUPP by the PTP core. It also makes the
core reject falling edge requests, which the hardware does not support.

> diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
> index 76272e5ac5b85..bcd29104effe7 100644
> --- a/drivers/ptp/ptp_qoriq.c
> +++ b/drivers/ptp/ptp_qoriq.c
> @@ -355,6 +355,7 @@ static const struct ptp_clock_info ptp_qoriq_caps = {
>  	.n_per_out	= 0,
>  	.n_pins		= 0,
>  	.pps		= 1,
> +	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,

[Severity: Low]
Does this also change the behaviour of the legacy PTP_EXTTS_REQUEST ioctl
on qoriq clocks? The commit message doesn't mention it.

For the legacy ioctl, ptp_extts_request() in drivers/ptp/ptp_chardev.c
masks the flags to the V1 set, which still includes PTP_FALLING_EDGE. It
never adds PTP_STRICT_FLAGS:

	} else {
		req.extts.flags &= PTP_EXTTS_V1_VALID_FLAGS;
		memset(req.extts.rsv, 0, sizeof(req.extts.rsv));
	}

Whether the edge bits are treated as hints depends only on what the driver
declares, not on which ioctl was used:

	if (!(supported_extts_flags & PTP_STRICT_FLAGS))
		supported_extts_flags |= PTP_EXTTS_EDGES;
	/* Reject unsupported flags */
	if (req.extts.flags & ~supported_extts_flags)
		return -EOPNOTSUPP;

Before this patch, supported_extts_flags was 0. Legacy requests with
PTP_FALLING_EDGE, or with PTP_RISING_EDGE | PTP_FALLING_EDGE to mean either
edge, were accepted and timestamped on the rising edge.

With this patch, those same legacy requests return -EOPNOTSUPP. For
example, testptp -e N -E 2 or -E 3 in tools/testing/selftests/ptp issues
PTP_EXTTS_REQUEST with PTP_FALLING_EDGE set. That worked on qoriq before
this patch and fails after it.

The rejection itself looks consistent with how the core treats strict
drivers. It also matches dpaa2-ptp and enetc_ptp, which use the same flag
set.

However, the subject and first paragraph describe a PTP_EXTTS_REQUEST2-only
fix, and present the legacy ioctl as the path that already works:

    A driver that does not set
    .supported_extts_flags still accepts the legacy PTP_EXTTS_REQUEST ioctl,
    but every PTP_EXTTS_REQUEST2 request is rejected with -EOPNOTSUPP

The last paragraph says "a falling edge request is rejected", but it doesn't
say this also applies to legacy PTP_EXTTS_REQUEST users. It also doesn't
mention the rising plus falling "either edge" case.

The Fixes: tag makes this a likely stable backport. Could the commit message
say explicitly that legacy PTP_EXTTS_REQUEST callers asking for a falling
edge or both edges will now get -EOPNOTSUPP?

>  	.adjfine	= ptp_qoriq_adjfine,
>  	.adjtime	= ptp_qoriq_adjtime,
>  	.gettime64	= ptp_qoriq_gettime,

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261006-for-upstream-qoriq-ptp-extts-flags-v1-0-b4a161b92832%40free.fr

  reply	other threads:[~2026-10-07 23:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 13:34 [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Vincent Jardin via B4 Relay
2026-10-06 13:34 ` Vincent Jardin
2026-10-06 13:34 ` [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Vincent Jardin via B4 Relay
2026-10-06 13:34   ` Vincent Jardin
2026-10-07 23:16   ` netdev-bot+sashiko
2026-10-06 13:34 ` [PATCH net 2/3] net: enetc: " Vincent Jardin via B4 Relay
2026-10-06 13:34   ` Vincent Jardin
2026-10-07 23:16   ` netdev-bot+sashiko
2026-10-06 13:34 ` [PATCH net 3/3] ptp: qoriq: " Vincent Jardin via B4 Relay
2026-10-06 13:34   ` Vincent Jardin
2026-10-07 23:16   ` netdev-bot+sashiko [this message]
2026-10-06 22:40 ` [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Jacob Keller
2026-10-07 11:22 ` Kory Maincent

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=179141500461.434549.18154635092466251146@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=ioana.ciornei@nxp.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=vjardin@free.fr \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    --cc=yangbo.lu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.