]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ptp_ocp: make ptp_ocp driver compatible with PTP_EXTTS_REQUEST2
authorVadim Fedorenko <vadim.fedorenko@linux.dev>
Thu, 18 Sep 2025 13:11:46 +0000 (13:11 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:28 +0000 (15:37 -0500)
[ Upstream commit d3ca2ef0c915d219e0d958e0bdcc4be6c02c210b ]

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.

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20250918131146.651468-1-vadim.fedorenko@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ptp/ptp_ocp.c

index f354f2f51a48c40e6659230c6f62d7a39a4feecd..a5c3632529862f3019c0dbcfd8f65ea857edfab4 100644 (file)
@@ -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)