Skip to content

T1: gate PowerTracking8812a to CHIP_8812 (fix wrong pwrtrk on 8821/8814)#69

Merged
josephnef merged 1 commit into
masterfrom
t1-pwrtrk-8812-gate
Jun 2, 2026
Merged

T1: gate PowerTracking8812a to CHIP_8812 (fix wrong pwrtrk on 8821/8814)#69
josephnef merged 1 commit into
masterfrom
t1-pwrtrk-8812-gate

Conversation

@josephnef
Copy link
Copy Markdown
Collaborator

Summary

The 8821AU canary diff (T1 follow-on) caught this bug: PowerTracking8812a::TickThermalMeter was firing on every Jaguar chip (8812 / 8821 / 8814), but its delta-swing tables + math are 8812-specific. Upstream maintains a parallel halrf_8821a_ce.c for 8821 with different per-band tables and 1T1R-specific logic — the 8812 code produces wrong values on 8821.

Findings

8821 ch6 canary divergences (pre-gate):

Register Kernel Devourer Notes
BB 0xc1c[31:21] 0x200 (0 dB) 0x1C8 (-1 dB) devourer's wrong pwrtrk write
BB 0x8b0 0x18 0x42 AGC-state side effect

Post-gate: both divergences disappear — pwrtrk no longer fires on 8821, BB stays at band-init values matching kernel's not-yet-converged state.

Fix

Gate the trigger at both call sites with _eepromManager->version_id.ICType == CHIP_8812:

  • RadioManagementModule::phy_SwChnlAndSetBwMode8812 (per channel-set tick)
  • HalModule::rtl8812au_hal_init (cold-init seed)

Matches the same chip-gating pattern already used for IQK (Iqk8812a).

8814AU also benefits — pwrtrk was firing on it with the same 8812 tables. No matrix run for 8814 because 8814 TX is gated by issue #36, but canary correctness improves.

Future work

8821AU pwrtrk port — separate change. Needs halrf_8821a_ce.c translation + 1T1R-specific table simplification.

Test plan

  • 8821 ch6 canary: BB 0xc1c + BB 0x8b0 divergences gone (verified post-build).
  • Build clean.
  • Full matrix at ch6/ch36/ch100 with all 3 adapters — 8812 dongle was off USB during this work; verification pending re-plug. Expected: 8821 + 8814 unchanged from PR T1: fix 5G TX-AGC over-power + expand canary set (path-B mirror, IQK/DPK outputs) #67 baseline (which is currently stacked under this); 8812 unchanged (still runs pwrtrk).

🤖 Generated with Claude Code

@josephnef josephnef force-pushed the t1-pwrtrk-8812-gate branch from 6786d10 to ea77857 Compare June 2, 2026 14:47
8821AU canary diff caught the bug: `PowerTracking8812a::TickThermalMeter`
was firing on every Jaguar chip (8812 / 8821 / 8814), but its
delta-swing tables + math are 8812-specific. Upstream maintains a
parallel `halrf_8821a_ce.c` for 8821 with different per-band tables
and 1T1R-specific logic; the 8812 code produces wrong values on 8821.

8821 ch6 canary (pre-gate):
  BB 0xc1c[31:21] = 0x1C8 (-1 dB)   <- devourer's wrong pwrtrk write
  BB 0xc1c[31:21] = 0x200 ( 0 dB)   <- kernel, untouched
  BB 0x8b0        = 0x42             <- AGC-state side effect
  BB 0x8b0        = 0x18             <- kernel

Post-gate: both divergences disappear (8821 pwrtrk no longer fires
at all; BB stays at the band-init values, matching kernel's
not-yet-converged state).

Gate the trigger in both call sites:
  - `RadioManagementModule::phy_SwChnlAndSetBwMode8812` (per
    channel-set tick)
  - `HalModule::rtl8812au_hal_init` (cold-init seed)

Defer the 8821AU pwrtrk port to a separate change; matches the same
chip-gating pattern already used for IQK (`Iqk8812a` is also
CHIP_8812-only).

8814AU also benefits from this gate — pwrtrk was firing on 8814AU
too with the same 8812 tables. No matrix run for 8814 because 8814
TX is gated by the separate issue #36, but the canary correctness
improves.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@josephnef josephnef force-pushed the t1-pwrtrk-8812-gate branch from ea77857 to 5effafd Compare June 2, 2026 14:50
@josephnef josephnef merged commit b835ca1 into master Jun 2, 2026
5 checks passed
@josephnef josephnef deleted the t1-pwrtrk-8812-gate branch June 2, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant