Re: [PATCH net v3] net: fec: Propagate PTP initialization errors

From: Shengzhuo Wei

Date: Mon Sep 07 2026 - 12:01:39 EST


On 2026-09-07 09:28, Bui Duc Phuc wrote:
> Oh, great! I see it now.
>
> However, it looks like that patch does not fully address the root cause.
>
> There are two places where devm_request_irq() is called:
> For PPS in fec_ptp_init().
>
> In probe():
> devm_request_irq(&pdev->dev, irq, fec_enet_interrupt,
> 0, pdev->name, ndev);
>
> The approach in that patch only handles the first case, so it does not
> fully solve the problem.
>

Yes, my patch leaves the main Ethernet IRQs unchanged.

For PPS, it also addresses the handler racing with PHC teardown,
as discussed in your earlier thread. Clearing pps_enable does not
wait for a handler that has already passed the check. The explicit
devm_free_irq() waits for that handler before ptp_clock_unregister().

Moving the netdev allocation to devm would address the IRQ/netdev
freeing order, but by itself would not provide that synchronization
before PHC teardown.

For the probe failure case Simon pointed out, we also need to account
for the failed_reset path skipping fec_ptp_stop(). With the explicit
IRQ release in fec_ptp_stop(), applying both patches would still
leave that path without the early IRQ cleanup.

I am preparing v2 with fec_ptp_stop() moved after unregister_netdev(),
as Wei suggested for patch 1.

Are you planning a separate patch for the IRQ lifetime issue? I'd
like to coordinate so that we cover these paths without duplicating
the work.

Thanks,
Shengzhuo