All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Ahmad Byagowi <ahmadexp@gmail.com>
Cc: netdev@vger.kernel.org,
	Richard Cochran <richardcochran@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach
Date: Fri, 20 Nov 2026 19:31:39 +0000	[thread overview]
Message-ID: <75abd6c6-f0ee-4665-9451-05e0e1a7a3d7@linux.dev> (raw)
In-Reply-To: <20261119-timecard-common-v3-discussion-743fce65f675-ahmadexp@gmail.com>

On 19/11/2026 23:46, Ahmad Byagowi wrote:
> On Thu, 19 Nov 2026 at 22:23 UTC, Vadim Fedorenko wrote:
>> enable() callback has to set PTP_PF_EXTTS function
> 
> Thanks. I tested the cleanup path. Recording an assignment makes the core
> disable that channel, but ptp_ocp exposes six timestamp channels and only
> four SMA descriptors. TS0 is the internal GNSS source and TS5 is the PHC
> source. All six can be enabled without pin assignments. Four descriptors
> cannot record that state without rejecting requests or changing the pin
> interface. extts_enable sysfs also reaches enable() without an assignment.

Fair point. Pins are pins, time stampers are time stampers. We have to
disable things which may trigger interrupts, the time stampers.

> Would you and Richard prefer disabling all n_ext_ts channels in
> ptp_disable_all_events(), followed by the existing PPS disable? That keeps
> cleanup after posix_clock_unregister(), without inventing pin assignments.
> I have prepared and tested that alternative locally, not posted it yet.

Yes, it's better to make correct core PTP cleanup function.

> 
> I also removed ptp_ocp's preliminary disable loop. Otherwise it can clear
> pps_req_map while an in-flight enable subsequently rearms the hardware.
> An overlapping sysfs/ioctl request can likewise leave an empty map with
> the source enabled, so the final disable now always masks and drains an
> empty PPS map. The shortcut remains while another subscription is active.
> 
>> why do we need it now?
> 
> The v2 teardown exception covered a disable that had cleared the map and
> dropped the spinlock but had not yet completed synchronize_irq(). The
> previous mutex version held its lock through the IRQ drain. This local
> revision removes the stopping flag and its special-case condition: core
> cleanup runs after active requests finish, and an empty map is disabled
> and drained regardless of its prior value.

Could you please keep more context while quoting? It's really hard to
follow the conversation otherwise


  reply	other threads:[~2026-11-20 19:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 21:19 [PATCH net v2 0/4] ptp: ocp: fix timestamp teardown and DPLL routing Ahmad Byagowi
2026-11-19 21:19 ` [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach Ahmad Byagowi
2026-11-19 22:23   ` Vadim Fedorenko
2026-11-19 23:46     ` Ahmad Byagowi
2026-11-20 19:31       ` Vadim Fedorenko [this message]
2026-11-20 21:21         ` Ahmad Byagowi
2026-11-19 21:19 ` [PATCH net v2 2/4] ptp: ocp: use hardware selectors in DPLL frequency operations Ahmad Byagowi
2026-11-19 22:23   ` Vadim Fedorenko
2026-11-19 21:19 ` [PATCH net v2 3/4] ptp: ocp: report disabled SMA inputs consistently over DPLL Ahmad Byagowi
2026-11-19 22:24   ` Vadim Fedorenko
2026-11-19 21:19 ` [PATCH net v2 4/4] ptp: ocp: correct the DCF output frequency Ahmad Byagowi
2026-11-19 22:24   ` Vadim Fedorenko

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=75abd6c6-f0ee-4665-9451-05e0e1a7a3d7@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=ahmadexp@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.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.