netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Ajay Kaher <ajay.kaher@broadcom.com>,
	Alexey Makhalov <alexey.makhalov@broadcom.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	David Woodhouse <dwmw2@infradead.org>,
	Eric Dumazet <edumazet@google.com>,
	imx@lists.linux.dev, Jakub Kicinski <kuba@kernel.org>,
	Jonathan Lemon <jonathan.lemon@gmail.com>,
	netdev@vger.kernel.org, Nick Shi <nick.shi@broadcom.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Wei Fang <wei.fang@nxp.com>, Yangbo Lu <yangbo.lu@nxp.com>
Subject: Re: [PATCH net-next v2 0/2] ptp: safely cleanup when unregistering a PTP clock
Date: Wed, 17 Sep 2025 07:47:35 -0700	[thread overview]
Message-ID: <aMrKB2qDCTXURtxj@hoboy.vegasvil.org> (raw)
In-Reply-To: <aMnYIu7RbgfXrmGx@shell.armlinux.org.uk>

On Tue, Sep 16, 2025 at 10:35:30PM +0100, Russell King (Oracle) wrote:
> (I'm assuming drivers/ptp/ patches go via net-next as there is no
> git tree against the "PTP HARDWARE CLOCK SUPPORT" maintainers entry.)
> 
> The standard rule in the kernel for unregistering user visible devices
> is to unpublish the userspace API before doing any shutdown of the
> resources necessary for the operation of the device.
> 
> PTP has several issues in this area:
> 
> 1. ptp_clock_unregister() cancells and destroys work while the PTP
>    chardev is still published, which gives the opportunity for a
>    precisely timed user API call to cause a driver to attempt to
>    queue the aux work.
> 
> 2. PTP pins are not cleaned up - if userspace has enabled PTP pins,
>    e.g. for extts, drivers are forced to do cleanup before calling
>    ptp_clock_unregister() to stop events being forwarded into the
>    PTP layer. E.g mv88e6xxx cancells its internal tai_event_work
>    to avoid calling into the PTP clock code with a stale ptp_clock
>    pointer, but a badly timed userspace EXTTS enable will re-schedule
>    the tai_event_work.

Thanks, Russell!

For the series:

Acked-by: Richard Cochran <richardcochran@gmail.com>

  parent reply	other threads:[~2025-09-17 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 21:35 [PATCH net-next v2 0/2] ptp: safely cleanup when unregistering a PTP clock Russell King (Oracle)
2025-09-16 21:35 ` [PATCH net-next v2 1/2] ptp: describe the two disables in ptp_set_pinfunc() Russell King (Oracle)
2025-09-16 21:36 ` [PATCH net-next v2 2/2] ptp: rework ptp_clock_unregister() to disable events Russell King (Oracle)
2025-09-17  8:38   ` Vladimir Oltean
2025-09-17 10:47   ` Vadim Fedorenko
2025-09-17 14:47 ` Richard Cochran [this message]
2025-09-17 22:20 ` [PATCH net-next v2 0/2] ptp: safely cleanup when unregistering a PTP clock patchwork-bot+netdevbpf

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=aMrKB2qDCTXURtxj@hoboy.vegasvil.org \
    --to=richardcochran@gmail.com \
    --cc=ajay.kaher@broadcom.com \
    --cc=alexey.makhalov@broadcom.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=dwmw2@infradead.org \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nick.shi@broadcom.com \
    --cc=pabeni@redhat.com \
    --cc=svens@linux.ibm.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.com \
    --cc=yangbo.lu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).