All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shengzhuo Wei" <me@cherr.cc>
To: "Bui Duc Phuc" <phucduc.bui@gmail.com>
Cc: "Wei Fang" <wei.fang@nxp.com>, "Simon Horman" <horms@kernel.org>,
	 "Frank Li" <frank.li@nxp.com>,
	"Shenwei Wang" <shenwei.wang@nxp.com>,
	 "andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	 "davem@davemloft.net" <davem@davemloft.net>,
	 "edumazet@google.com" <edumazet@google.com>,
	 "kuba@kernel.org" <kuba@kernel.org>,
	 "pabeni@redhat.com" <pabeni@redhat.com>,
	 "richardcochran@gmail.com" <richardcochran@gmail.com>,
	 "swboyd@chromium.org" <swboyd@chromium.org>,
	 "imx@lists.linux.dev" <imx@lists.linux.dev>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	 "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	 "Shengzhuo Wei" <me@cherr.cc>
Subject: Re: [PATCH net v3] net: fec: Propagate PTP initialization errors
Date: Mon, 7 Sep 2026 23:58:55 +0800	[thread overview]
Message-ID: <ap7fP5Lz04kySgn9@pve> (raw)
In-Reply-To: <CAABR9nHUXPL8dV8iqJ-x4OWRLw-qRm8MTq_QDTEJ94WhLWRiqg@mail.gmail.com>

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

  reply	other threads:[~2026-09-07 15:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 10:55 [PATCH net v3] net: fec: Propagate PTP initialization errors phucduc.bui
2026-09-05 10:56 ` sashiko-bot
2026-09-07  2:06   ` Bui Duc Phuc
2026-09-06 13:17 ` Simon Horman
2026-09-07  2:09   ` Bui Duc Phuc
2026-09-07  2:19     ` Wei Fang
2026-09-07  2:28       ` Bui Duc Phuc
2026-09-07 15:58         ` Shengzhuo Wei [this message]
2026-09-08  1:39           ` Bui Duc Phuc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ap7fP5Lz04kySgn9@pve \
    --to=me@cherr.cc \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=frank.li@nxp.com \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phucduc.bui@gmail.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=swboyd@chromium.org \
    --cc=wei.fang@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.