T1: gate PowerTracking8812a to CHIP_8812 (fix wrong pwrtrk on 8821/8814)#69
Merged
Conversation
6786d10 to
ea77857
Compare
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>
ea77857 to
5effafd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The 8821AU canary diff (T1 follow-on) caught this bug:
PowerTracking8812a::TickThermalMeterwas firing on every Jaguar chip (8812 / 8821 / 8814), but its delta-swing tables + math are 8812-specific. Upstream maintains a parallelhalrf_8821a_ce.cfor 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):
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.ctranslation + 1T1R-specific table simplification.Test plan
🤖 Generated with Claude Code