mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588
@ 2026-10-06 13:34 Vincent Jardin via B4 Relay
  2026-10-06 13:34 ` [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Vincent Jardin via B4 Relay
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-10-06 13:34 UTC (permalink / raw)
  To: Yangbo Lu, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Jacob Keller,
	Kory Maincent, Claudiu Manoil, Vladimir Oltean, Wei Fang,
	Clark Wang
  Cc: netdev, linux-kernel, imx, Ioana Ciornei, Vincent Jardin

Since commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags
to ptp_clock_info"), the PTP core rejects every PTP_EXTTS_REQUEST2
request for a driver that does not set .supported_extts_flags. The three
users of the QorIQ 1588 (dpaa2-ptp, enetc, ptp_qoriq),
so linuxptp ts2phc cannot arm their external timestamp inputs.

The timer timestamps the rising edge only, since ptp_qoriq_init() clears
ETEP1 and ETEP2. Each patch declares PTP_RISING_EDGE | PTP_STRICT_FLAGS
for one driver.

Patch 1 fixes the failure seen on an LX2160A board.
Patches 2 and 3 are build-tested/code review only.

Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
Vincent Jardin (3):
      dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
      net: enetc: fix support for PTP_EXTTS_REQUEST2 ioctl
      ptp: qoriq: fix support for PTP_EXTTS_REQUEST2 ioctl

 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 1 +
 drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 1 +
 drivers/ptp/ptp_qoriq.c                          | 1 +
 3 files changed, 3 insertions(+)
---
base-commit: d5a007b9b457c915ab1a53227e8939e4018aa97a
change-id: 20261006-for-upstream-qoriq-ptp-extts-flags-1c6fd731d66f

Best regards,
-- 
Vincent Jardin <vjardin@free.fr>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
  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 via B4 Relay
  2026-10-06 13:34 ` [PATCH net 2/3] net: enetc: " Vincent Jardin via B4 Relay
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-10-06 13:34 UTC (permalink / raw)
  To: Yangbo Lu, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Jacob Keller,
	Kory Maincent, Claudiu Manoil, Vladimir Oltean, Wei Fang,
	Clark Wang
  Cc: netdev, linux-kernel, imx, Ioana Ciornei, Vincent Jardin

From: Vincent Jardin <vjardin@free.fr>

Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") moved the validation of the external timestamp request
flags into the PTP core. 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

On an LX2160A board, linuxptp ts2phc arms the external timestamp channel
of the 1588 timer with PTP_EXTTS_REQUEST2, gets -EOPNOTSUPP and exits,
so the PHC cannot be disciplined from an external 1PPS.

ptp_qoriq_init() programs TMR_CTRL with ETEP1 and ETEP2 cleared, so the
timer timestamps the rising edge of its external trigger inputs. Declare
that, with PTP_STRICT_FLAGS, so that a falling edge request is rejected
instead of being timestamped on the rising edge.

Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
index 4497e3c0456d..ac2b873dcf8e 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c
@@ -78,6 +78,7 @@ static const struct ptp_clock_info dpaa2_ptp_caps = {
 	.n_per_out	= 3,
 	.n_pins		= 0,
 	.pps		= 1,
+	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
 	.adjfine	= ptp_qoriq_adjfine,
 	.adjtime	= ptp_qoriq_adjtime,
 	.gettime64	= ptp_qoriq_gettime,

-- 
2.43.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 2/3] net: enetc: fix support for PTP_EXTTS_REQUEST2 ioctl
  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 ` [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 via B4 Relay
  2026-10-06 13:34 ` [PATCH net 3/3] ptp: qoriq: " Vincent Jardin via B4 Relay
  2026-10-06 22:40 ` [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Jacob Keller
  3 siblings, 0 replies; 5+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-10-06 13:34 UTC (permalink / raw)
  To: Yangbo Lu, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Jacob Keller,
	Kory Maincent, Claudiu Manoil, Vladimir Oltean, Wei Fang,
	Clark Wang
  Cc: netdev, linux-kernel, imx, Ioana Ciornei, Vincent Jardin

From: Vincent Jardin <vjardin@free.fr>

Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") moved the validation of the external timestamp request
flags into the PTP core. 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 ENETC timer is the QorIQ 1588 timer, set up by ptp_qoriq_init(), which
programs TMR_CTRL with ETEP1 and ETEP2 cleared, so it timestamps the
rising edge of its external trigger inputs. Declare that, with
PTP_STRICT_FLAGS, so that a falling edge request is rejected instead of
being timestamped on the rising edge.

Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
index 162cbc801730..5ffee882d624 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc_ptp.c
@@ -16,6 +16,7 @@ static struct ptp_clock_info enetc_ptp_caps = {
 	.n_per_out	= 0,
 	.n_pins		= 0,
 	.pps		= 1,
+	.supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
 	.adjfine	= ptp_qoriq_adjfine,
 	.adjtime	= ptp_qoriq_adjtime,
 	.gettime64	= ptp_qoriq_gettime,

-- 
2.43.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net 3/3] ptp: qoriq: fix support for PTP_EXTTS_REQUEST2 ioctl
  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 ` [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Vincent Jardin via B4 Relay
  2026-10-06 13:34 ` [PATCH net 2/3] net: enetc: " Vincent Jardin via B4 Relay
@ 2026-10-06 13:34 ` Vincent Jardin via B4 Relay
  2026-10-06 22:40 ` [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Jacob Keller
  3 siblings, 0 replies; 5+ messages in thread
From: Vincent Jardin via B4 Relay @ 2026-10-06 13:34 UTC (permalink / raw)
  To: Yangbo Lu, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Jacob Keller,
	Kory Maincent, Claudiu Manoil, Vladimir Oltean, Wei Fang,
	Clark Wang
  Cc: netdev, linux-kernel, imx, Ioana Ciornei, Vincent Jardin

From: Vincent Jardin <vjardin@free.fr>

Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") moved the validation of the external timestamp request
flags into the PTP core. 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, since
the core always adds PTP_STRICT_FLAGS to it

ptp_qoriq_init() programs TMR_CTRL with ETEP1 and ETEP2 cleared, so the
timer timestamps the rising edge of its external trigger inputs. Declare
that, with PTP_STRICT_FLAGS, so that a falling edge request is rejected
instead of being timestamped on the rising edge.

Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Signed-off-by: Vincent Jardin <vjardin@free.fr>
---
 drivers/ptp/ptp_qoriq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ptp/ptp_qoriq.c b/drivers/ptp/ptp_qoriq.c
index 76272e5ac5b8..bcd29104effe 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,
 	.adjfine	= ptp_qoriq_adjfine,
 	.adjtime	= ptp_qoriq_adjtime,
 	.gettime64	= ptp_qoriq_gettime,

-- 
2.43.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588
  2026-10-06 13:34 [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Vincent Jardin via B4 Relay
                   ` (2 preceding siblings ...)
  2026-10-06 13:34 ` [PATCH net 3/3] ptp: qoriq: " Vincent Jardin via B4 Relay
@ 2026-10-06 22:40 ` Jacob Keller
  3 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2026-10-06 22:40 UTC (permalink / raw)
  To: vjardin, Yangbo Lu, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Richard Cochran, Kory Maincent,
	Claudiu Manoil, Vladimir Oltean, Wei Fang, Clark Wang
  Cc: netdev, linux-kernel, imx, Ioana Ciornei

On 10/6/2026 6:34 AM, Vincent Jardin via B4 Relay wrote:
> Since commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags
> to ptp_clock_info"), the PTP core rejects every PTP_EXTTS_REQUEST2
> request for a driver that does not set .supported_extts_flags. The three
> users of the QorIQ 1588 (dpaa2-ptp, enetc, ptp_qoriq),
> so linuxptp ts2phc cannot arm their external timestamp inputs.
> 
> The timer timestamps the rising edge only, since ptp_qoriq_init() clears
> ETEP1 and ETEP2. Each patch declares PTP_RISING_EDGE | PTP_STRICT_FLAGS
> for one driver.
> 
> Patch 1 fixes the failure seen on an LX2160A board.
> Patches 2 and 3 are build-tested/code review only.
> 

Yep. This change was intentional so that PTP_EXTTS_REQUEST2 would be
rejected until the drivers were updated to specifically indicated which
set of flags they actually supported.

Thanks for verifying which edge these drivers timestamp.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

> Signed-off-by: Vincent Jardin <vjardin@free.fr>
> ---
> Vincent Jardin (3):
>       dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
>       net: enetc: fix support for PTP_EXTTS_REQUEST2 ioctl
>       ptp: qoriq: fix support for PTP_EXTTS_REQUEST2 ioctl
> 
>  drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 1 +
>  drivers/net/ethernet/freescale/enetc/enetc_ptp.c | 1 +
>  drivers/ptp/ptp_qoriq.c                          | 1 +
>  3 files changed, 3 insertions(+)
> ---
> base-commit: d5a007b9b457c915ab1a53227e8939e4018aa97a
> change-id: 20261006-for-upstream-qoriq-ptp-extts-flags-1c6fd731d66f
> 
> Best regards,


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-06 22:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH net 1/3] dpaa2-ptp: fix support for PTP_EXTTS_REQUEST2 ioctl Vincent Jardin via B4 Relay
2026-10-06 13:34 ` [PATCH net 2/3] net: enetc: " Vincent Jardin via B4 Relay
2026-10-06 13:34 ` [PATCH net 3/3] ptp: qoriq: " Vincent Jardin via B4 Relay
2026-10-06 22:40 ` [PATCH net 0/3] net: freescale: fix PTP_EXTTS_REQUEST2 for QorIQ 1588 Jacob Keller

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®