Re: [PATCH net] net: fec: drain PEROUT requests before canceling the timer
From: Simon Horman
Date: Sat Sep 26 2026 - 12:22:21 EST
On Thu, Sep 24, 2026 at 09:03:39PM -0500, mhun512@xxxxxxxxx wrote:
> fec_ptp_stop() cancels perout_timer before unregistering the PTP clock.
> A PEROUT ioctl can set perout_enable, release the driver's locks and
> then be preempted before hrtimer_start(). The unregister path waits for
> that ioctl, which can rearm the timer after it was canceled. Removal
> then frees the netdev containing the still-armed timer.
>
> Unregister the PTP clock first so all in-flight ioctls have returned
> before canceling the timer. Clear the PEROUT state and compare channel
> afterward, then disable PPS. Serialize the channel write with PTP clock
> shutdown and skip it when that clock is off.
>
> This issue was identified during our ongoing static-analysis research
> while reviewing kernel code.
>
> Fixes: 350749b909bf ("net: fec: Add support for periodic output signal of PPS")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> ---
> drivers/net/ethernet/freescale/fec_ptp.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_ptp.c
> b/drivers/net/ethernet/freescale/fec_ptp.c
> index 56801c2009d5..67901e036ac3 100644
> --- a/drivers/net/ethernet/freescale/fec_ptp.c
> +++ b/drivers/net/ethernet/freescale/fec_ptp.c
> @@ -506,10 +506,13 @@ static int fec_ptp_pps_disable(struct
> fec_enet_private *fep, uint channel)
Hi Myeonghun, all,
This patch does not apply because the two lines above should be a single line.
Unfortunately this means that CI did not run on this patch.
Please repost after figuring out what went wrong here.
--
pw-bot: changes-requested