summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorWei Fang <wei.fang@nxp.com>2025-11-25 16:52:07 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-12-07 06:24:56 +0900
commit18a474a325572270086ac3b1bc2b7d4322105d1c (patch)
treee8bd8520f75f76c66ab7ff759ddef26f42b350f9 /drivers/net
parent3fd2105e1b7e041cc24be151c9a31a14d5fc50ab (diff)
downloadlinux-18a474a325572270086ac3b1bc2b7d4322105d1c.tar.gz
linux-18a474a325572270086ac3b1bc2b7d4322105d1c.tar.bz2
linux-18a474a325572270086ac3b1bc2b7d4322105d1c.zip
net: fec: cancel perout_timer when PEROUT is disabled
[ Upstream commit 50caa744689e505414673c20359b04aa918439e3 ] 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: 350749b909bf ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/freescale/fec_ptp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 7f6b57432071..cb3f05da3eee 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -498,6 +498,8 @@ static int fec_ptp_pps_disable(struct fec_enet_private *fep, uint channel)
{
unsigned long flags;
+ hrtimer_cancel(&fep->perout_timer);
+
spin_lock_irqsave(&fep->tmreg_lock, flags);
writel(0, fep->hwp + FEC_TCSR(channel));
spin_unlock_irqrestore(&fep->tmreg_lock, flags);