Skip to content

Commit 9a060d0

Browse files
WeiFang-NXPPaolo Abeni
authored andcommitted
net: fec: do not register PPS event for PEROUT
There are currently two situations that can trigger the PTP interrupt, one is the PPS event, the other is the PEROUT event. However, the irq handler fec_pps_interrupt() does not check the irq event type and directly registers a PPS event into the system, but the event may be a PEROUT event. This is incorrect because PEROUT is an output signal, while PPS is the input of the kernel PPS system. Therefore, add a check for the event type, if pps_enable is true, it means that the current event is a PPS event, and then the PPS event is registered. Fixes: 350749b ("net: fec: Add support for periodic output signal of PPS") Signed-off-by: Wei Fang <wei.fang@nxp.com> Link: https://patch.msgid.link/20251125085210.1094306-5-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent c0a1f3d commit 9a060d0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,11 @@ static irqreturn_t fec_pps_interrupt(int irq, void *dev_id)
718718
fep->next_counter = (fep->next_counter + fep->reload_period) &
719719
fep->cc.mask;
720720

721-
event.type = PTP_CLOCK_PPS;
722-
ptp_clock_event(fep->ptp_clock, &event);
721+
if (fep->pps_enable) {
722+
event.type = PTP_CLOCK_PPS;
723+
ptp_clock_event(fep->ptp_clock, &event);
724+
}
725+
723726
return IRQ_HANDLED;
724727
}
725728

0 commit comments

Comments
 (0)