Skip to contentSkip to conversation

ptp_ocp: make ptp_ocp driver compatible with PTP_EXTTS_REQUEST2

PATCH Applied Vadim Fedorenko 2 participants 2 messages Sep 18, 2025 – Sep 20, 2025

Subsystems (4)
lore
Share & tools
lore

Vadim Fedorenko

author maintainer
#0 lore raw

PATCH 1/1 ptp_ocp: make ptp_ocp driver compatible with PTP_EXTTS_REQUEST2

Originally ptp_ocp driver was not strictly checking flags for external timestamper and was always activating rising edge timestamping as it's the only supported mode. Recent changes to ptp made it incompatible with PTP_EXTTS_REQUEST2 ioctl. Adjust ptp_clock_info to provide supported mode and be compatible with new infra.

While at here remove explicit check of periodic output flags from the driver and provide supported flags for ptp core to check.

---
 drivers/ptp/ptp_ocp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ptp/ptp_ocp.c +2 -4
index 4e1286ce05c9..794ec6e71990 100644
@@ -1485,6 +1485,8 @@ static const struct ptp_clock_info ptp_ocp_clock_info = {
 	.pps		= true,
 	.n_ext_ts	= 6,
 	.n_per_out	= 5,
+	.supported_extts_flags = PTP_STRICT_FLAGS | PTP_RISING_EDGE,
+	.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE | PTP_PEROUT_PHASE,
 };
 
 static void
@@ -2095,10 +2097,6 @@ ptp_ocp_signal_from_perout(struct ptp_ocp *bp, int gen,
 {
 	struct ptp_ocp_signal s = { };
 
-	if (req->flags & ~(PTP_PEROUT_DUTY_CYCLE |
-			   PTP_PEROUT_PHASE))
-		return -EOPNOTSUPP;
-
 	s.polarity = bp->signal[gen].polarity;
 	s.period = ktime_set(req->period.sec, req->period.nsec);
 	if (!s.period)
Signature · 1 line
2.47.3
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 18 Sep 2025 13:11:46 +0000 you wrote:

Originally ptp_ocp driver was not strictly checking flags for external timestamper and was always activating rising edge timestamping as it's the only supported mode. Recent changes to ptp made it incompatible with PTP_EXTTS_REQUEST2 ioctl. Adjust ptp_clock_info to provide supported mode and be compatible with new infra.

While at here remove explicit check of periodic output flags from the driver and provide supported flags for ptp core to check.

[...]

Here is the summary with links:
- [net-next] ptp_ocp: make ptp_ocp driver compatible with PTP_EXTTS_REQUEST2

    https://git.kernel.org/netdev/net-next/c/d3ca2ef0c915

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html