Follow-ups left open by the WriteTsf / tsf_write_ok work (#430)

Offen
#434 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c
Bereich
backend

Rechercherichtung

Start with the referenced RtlJaguarDevice.h, IRadio.h, AdapterCaps.h, docs/time-distribution.md, RtlJaguarDevice.cpp, and the MT7612U ReadTsf implementation; compare their contracts and behavior with the #430 review measurements. The work spans hardware-specific locking, TSF semantics, documentation, and C ABI changes. Done means the follow-ups are resolved consistently, including the documented Jaguar1 measurement and checked MT7612U reads.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

Non-blocking items from the #430 review (merged as bb64508). Each was raised inline on the PR and resolved to merge; none changes what shipped. Measurements referenced are in the #430 review body.

1. Jaguar1 ReadTsf runs unlocked against the now-locked pair write

RtlJaguarDevice::WriteTsf writes REG_TSFTR low then high under _port0_mu; ReadTsf takes no lock. A read that lands between the two control transfers returns old_hi<<32 | new_lo. The hi/lo/hi retry in read_tsftr only fires when the high word changes between its own reads, so a high-word write that lands after the second read goes unnoticed. Jaguar2/3 hold _reg_mu in both. _port0_mu is recursive; taking it in ReadTsf is one line and matches the steer paths, which already read the pair under it.

While there: PinBeaconTbtt / AdjustBeaconTimingFine on all three Jaguar backends still hand-roll the same 0x0560/0x0564 pair (AdjustBeaconTimingFine without the wrap retry; every steer write discards rtw_write's bool). They already hold the lock RtlTsf.h prescribes, so read_tsftr / write_tsftr are drop-in (a no-readback variant if the bracket cannot afford the PCIe / near-wrap readback).

2. "Expect a Jaguar1 write to move an active beacon's TBTT" contradicts the 8814A note

RtlJaguarDevice.h (WriteTsf) and IRadio.h say the J1 TBTT is locked to the TSF grid "on all three dies". The same file's AdjustBeaconTimingFine note records the 8814A TBTT free-running across a TSF shift (a −5000 µs shift moved the phase by only the ~0.8 ms bracket off-time) until the DUAL_TSF_RST pulse, which the bare WriteTsf does not issue. Scope the expectation to the 8812A/8821A, or state the 8814A is expected not to follow. The beacon-armed WriteTsf case (cadence / seq / body timestamp across a ±5 s write) is unmeasured on every J1 die.

3. Measurement roster duplicated three times, and already stale

The per-die readback roster lives in AdapterCaps.h (the tsf_write_ok comment), docs/time-distribution.md (the table) and RtlJaguarDevice.cpp (WriteTsf comment). All three still say the J1 override "has not itself run on Jaguar1 hardware"; it has (review body: RTL8821AU, 10/10 forward and 10/10 backward WriteTsf calls, readback error minus host time −300…−15 µs). Collapse the two comments to the flag's meaning plus a pointer, and add the J1 row to the docs table.

4. IRadio::WriteTsf contract: false is wider than "transport failure"

write_tsftr returns false on PCIe (and on USB near a low-word wrap) whenever the readback lands ≥ 100 ms past the target, which the helper's own comment names as a host preemption or an ignored small backward write, not only a transport fault. A caller taking the IRadio.h sentence literally re-issues its stale precomputed target and steps the clock back by the preemption. Also, "a device that has gone reports false on every call" drops the hedge RtlTsf.h keeps: over vfio the readback is a raw volatile load on a BAR mapping that can fault rather than read all-ones.

5. MT7612U: C ABI has no tsf_write cap, and the library ReadTsf is unchecked

struct mt7612u_caps already carries negative bits (narrowband, fast_retune); with mt7612u_write_tsf deleted, a tsf_write : 1 bit would let the C ABI say what AdapterCaps::tsf_write_ok says instead of a link error being the only signal. Separately, Mt7612uRadio::ReadTsf → mt7612u_read_tsf still reads DW0 then DW1 through unchecked mt_rr with no wrap retry; only the bringup gate got the checked tsf_read_chk reader.

Vorherrschende Sprache
C
Sterne
56
Forks
29
Ø Merge
3 Std. 43 Min.
Gemergte PRs (30 T.)
75

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus OpenIPC/devourer

Alle Issues in OpenIPC/devourer

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.