]> www.infradead.org Git - users/hch/misc.git/commitdiff
ptp: netc: only enable periodic pulse event interrupts for PPS
authorWei Fang <wei.fang@nxp.com>
Mon, 15 Sep 2025 08:25:28 +0000 (16:25 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Sep 2025 22:18:58 +0000 (15:18 -0700)
The periodic pulse event interrupts are used to register the PPS events
into the system, so it is only applicable to PTP_CLK_REQ_PPS request.
However, these interrupts are mistakenly enabled in PTP_CLK_REQ_PEROUT
request, so fix this error.

Fixes: 671e266835b8 ("ptp: netc: add periodic pulse output support")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Link: https://patch.msgid.link/20250915082528.1616361-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/ptp/ptp_netc.c

index 75594f47807d35eb0371221e73801a69507e9f1f..94e952ee69902e7e7ca1836d2dc33495185c69cf 100644 (file)
@@ -305,13 +305,14 @@ static void netc_timer_enable_periodic_pulse(struct netc_timer *priv,
        fiper_ctrl |= FIPER_CTRL_SET_PW(channel, fiper_pw);
        fiper_ctrl |= alarm_id ? FIPER_CTRL_FS_ALARM(channel) : 0;
 
-       priv->tmr_emask |= TMR_TEVNET_PPEN(channel) |
-                          TMR_TEVENT_ALMEN(alarm_id);
+       priv->tmr_emask |= TMR_TEVENT_ALMEN(alarm_id);
 
-       if (pp->type == NETC_PP_PPS)
+       if (pp->type == NETC_PP_PPS) {
+               priv->tmr_emask |= TMR_TEVNET_PPEN(channel);
                netc_timer_set_pps_alarm(priv, channel, integral_period);
-       else
+       } else {
                netc_timer_set_perout_alarm(priv, channel, integral_period);
+       }
 
        netc_timer_wr(priv, NETC_TMR_TEMASK, priv->tmr_emask);
        netc_timer_wr(priv, NETC_TMR_FIPER(channel), fiper);