Skip to content

Commit 50caa74

Browse files
WeiFang-NXPPaolo Abeni
authored andcommitted
net: fec: cancel perout_timer when PEROUT is disabled
The PEROUT allows the user to set a specified future time to output the periodic signal. If the future time is far from the current time, the FEC driver will use hrtimer to configure PEROUT one second before the future time. However, the hrtimer will not be canceled if the PEROUT is disabled before the hrtimer expires. So the PEROUT will be configured when the hrtimer expires, which is not as expected. Therefore, cancel the hrtimer in fec_ptp_pps_disable() to fix this issue. 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-2-wei.fang@nxp.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent b3e528a commit 50caa74

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/ethernet/freescale/fec_ptp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ static int fec_ptp_pps_disable(struct fec_enet_private *fep, uint channel)
497497
{
498498
unsigned long flags;
499499

500+
hrtimer_cancel(&fep->perout_timer);
501+
500502
spin_lock_irqsave(&fep->tmreg_lock, flags);
501503
writel(0, fep->hwp + FEC_TCSR(channel));
502504
spin_unlock_irqrestore(&fep->tmreg_lock, flags);

0 commit comments

Comments
 (0)