Re: [PATCH net v2 1/4] ptp: ocp: prevent timestamp rearming during detach

From
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Date
2026-11-20 19:31:42
Reply to
Ahmad Byagowi, 2026-11-19
On 19/11/2026 23:46, Ahmad Byagowi wrote:
On Thu, 19 Nov 2026 at 22:23 UTC, Vadim Fedorenko wrote:
quoted
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.
quoted
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
Thread (11 messages) 11 messages, 2 authors, last reply 1h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help