Re: [PATCH net-next v3 3/3] ptp: ocp: support the WiWi revision 02 Time Card

From
Ahmad Byagowi <hidden>
Date
2026-11-19 21:20:05
Also in
linux-doc, linux-i2c, lkml
Reply to
Vadim Fedorenko, 2026-11-19
Hi Vadim,

On Thu, 19 Nov 2026 at 18:44:38 +0000, Vadim Fedorenko wrote:

Regarding the different addressing and interrupt layout:
another resource table.
Agreed. The next revision has a dedicated ocp_wiwi_resource table with
final BAR0 addresses and MSI-X vector numbers. I removed the runtime
offset/vector adjustment, the temporary resource copy, and the WiWi
filtering from ptp_ocp_register_resources(). The existing FB/Celestica,
ART, ADVA and ADVA X1 tables are unchanged. The WiWi table explicitly
contains the three UARTs and typed XIIC data, but no GNSS2 or SPI entry.

Regarding UART access and the omitted second GNSS interface:
Why it's not a problem for ADVA and ART boards?
I conflated the peripheral IP with the host interface in that description.
The aligned 32-bit requirement is specific to the WiWi LitePCIe path;
sharing UART IP does not establish the same PCIe access restrictions.
UART width is now selected by per-resource data, with the existing
byte-access default preserved for the other boards. WiWi's XIIC child
uses the force_32bit_access flag from patch 1.

The UART list is a separate issue. ART already has one GNSS UART entry;
ADVA and ADVA X1 have GNSS and MAC entries, not GNSS2. Thomas described
WiWi's second GNSS UART as instantiated but unwired on this board, so
the WiWi table exposes only GNSS, MAC and NMEA. I am not inferring wiring
for arbitrary boards from their PCI revision or claiming that the other
boards have a GNSS2 defect. The external SMA PPS2 input remains available.

Regarding the additional interrupt-readiness check:
new revision but not for the older ones?
WiWi has a separate LitePCIe per-input gate at BAR0+0x1800, in addition
to the PCI MSI-X masks. The legacy probe does not program that gate.
The WiWi path first opens only UART/XIIC inputs for child probe; it opens
timing inputs after the PHC and handlers exist. Because ptp_clock_register()
can expose the PHC before that second write, an early arm request returns
-EAGAIN without changing subscription state or programming the source.
After the checked write/readback it can be retried. Disable is not gated.

Both early and late gate writes now use the same checked-readback helper;
failure returns -EIO and unwinds probe. This is software ordering, not a
claim that WiWi loses masked pulses or that older firmware replays them.
The common timestamp-removal spinlock fix remains separate and is used
by all boards.

Regarding the path to supporting updates:
enable flash upgrades?
Not through a supported in-driver procedure in this series. I kept SPI
absent from the WiWi table and its input masked, and reject every WiWi
devlink flash request before looking up MTD or writing anything. There
is no override. This intentionally also removes raw MTD read access.

The documentation now spells out the follow-up needed: validate the
controller's access width and interrupt behavior, specify and check the
WiWi image header and board/revision compatibility, protect the golden
region in every erase/write path including raw MTD, then validate update
readback, activation and interrupted-update/watchdog recovery. Thomas's
description of a modified spi-xilinx path is not validation of an upstream
update implementation. A running build ID is not proof of the active slot.

Validation for this draft includes actual-source resource/UART/gate/flash
tests under ASan/UBSan, the spinlock removal-race suite (100 runs), and
13 deliberately broken variants rejected by the tests. The x86-64 PTP
and XIIC objects build with W=1 and KCFLAGS=-Werror; all four XIIC KUnit
tests pass under QEMU. The five-architecture Kconfig checks also pass.
No new physical-card test, firmware update or masked-pulse replay test
is claimed; the machine has been reserved for Windows HLK. I will report
that limitation in v4.

Thanks,
Ahmad
Thread (12 messages) 12 messages, 3 authors, last reply 22h 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