net: dsa: mt7530: check CORE_PLL_GROUP4 access in mt7531_setup()
Subsystems (71)
Sasha Levin
maintainerPATCH 1/1 platform/x86: thinkpad_acpi: Fix fan speed reporting on Edge E330
In reply to Sasha LevinFrom: Andrew Onyshchuk <[email protected]>
[ Upstream commit 8d840dad456f88374d8a3b03851452a280d6ee50 ]
The ThinkPad Edge E330 with H3 firmware uses the non-standard EC fan register block. Without a matching quirk, thinkpad_acpi reads the legacy tachometer registers and reports 0 RPM.
Add the H3 BIOS family to TPACPI_FAN_NS so the driver reads the fan period from EC register 0x95 using the existing non-standard reporting path.
Tested on a ThinkPad Edge E330 with BIOS H3ET77WW and EC H3EC35WW.
---
LLM Generated explanations, may be completely bogus:
## Local tree
This checkout is **pending-6.12** (p-6.12-3-gc504cf0baa3d8), kernel **6.12.111**. The verdict is only for this tree.
The driver is still drivers/platform/x86/thinkpad_acpi.c (not yet moved to drivers/platform/x86/lenovo/). The H3 TPACPI_FAN_NS quirk is **not** present. The non-standard fan path that the quirk selects **is** present.
---
## PHASE 1: COMMIT MESSAGE FORENSICS
**Step 1.1: PARSE THE SUBJECT LINE**
Record: **[platform/x86 thinkpad_acpi] [Fix] [fan speed reporting on ThinkPad Edge E330]**
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- Reviewed-by: Mark Pearson <[email protected]> (Lenovo thinkpad_acpi reviewer)
- Reviewed-by: Ilpo Järvinen <[email protected]> (platform/x86 maintainer)
- Signed-off-by: Andrew Onyshchuk <[email protected]> (author)
- Signed-off-by: Ilpo Järvinen <[email protected]> (maintainer)
- `Link:
https://patch.msgid.link/[email protected]`
- No Fixes: tag (expected)
- No Reported-by: / Tested-by: tags (testing is described in the body instead)
- Ignore pipeline Signed-off-by: Sasha Levin / [Upstream commit ...] if present
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- **Bug:** Edge E330 with H3 firmware uses the non-standard EC fan register block.
- **Symptom:** without a quirk, the driver reads the legacy tachometer registers and reports **0 RPM**.
- **Root cause:** missing BIOS-family match in fan_quirk_table.
- **Fix:** add TPACPI_Q_LNV('H', '3', TPACPI_FAN_NS) so the existing NS path reads period from EC **0x95**.
- **Version info:** tested on BIOS **H3ET77WW**, EC **H3EC35WW**. No kernel-version range given.
- **Failure mode:** wrong hwmon/procfs fan speed (always 0), not a crash.
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: Not a disguised cleanup. It is an explicit hardware-quirk bug fix.
---
## PHASE 2: DIFF ANALYSIS
**Step 2.1: INVENTORY THE CHANGES**
Record:
- One file: drivers/platform/x86/lenovo/thinkpad_acpi.c in the submitted patch; local equivalent is drivers/platform/x86/thinkpad_acpi.c.
- **+1 line**, 0 removed.
- Function/data: fan_quirk_table[].
- Scope: **single-file surgical hardware quirk**.
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record:
- **Before:** tpacpi_check_quirks(fan_quirk_table) does not match BIOS family H3. fan_init() uses TPACPI_FAN_RD_TPEC and reads fan_rpm_offset **0x84/0x85**. On this EC those registers are unused, so speed is 0.
- **After:** BIOS H3 matches TPACPI_FAN_NS. fan_init() sets fan_with_ns_addr, selects TPACPI_FAN_RD_TPEC_NS, and fan_get_speed() reads fan_rpm_status_ns (**0x95**) and converts period to RPM via FAN_RPM_CAL_CONST / lo.
Verified in this tree:
```8156:8162:drivers/platform/x86/thinkpad_acpi.c
case TPACPI_FAN_RD_TPEC_NS:
if (!acpi_ec_read(fan_rpm_status_ns, &lo))
return -EIO;
if (speed)
*speed = lo ? FAN_RPM_CAL_CONST / lo : 0;
break;
```**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record: **(h) Hardware workaround** — quirk-table entry enabling an existing EC register path. Same class as the X120e TPR and L13/X13 Yoga NS fan quirks already in this file.
**Step 2.4: ASSESS THE FIX QUALITY**
Record:
- Obviously correct: one table entry, existing matcher, existing NS reader.
- BIOS matching is right: H3ET77WW is the 8-char xxyTkkWW form, so tpacpi_parse_fw_id() stores TPID('H','3'), which is exactly what TPACPI_Q_LNV('H','3', ...) matches (ec = TPACPI_MATCH_ANY).
- Minimal; no API/data-structure change.
- Regression risk is limited to H3-family machines. FAN_NS also marks host fan control as undefined (fan_ctrl_status_undef = 1) and uses NS status register 0x93. That is the same behavior already used for L13/X13 Yoga, L380/L390, 11e Gen5. Mark Pearson noted the platform is ~14 years old and he could not independently confirm; the author tested it. Overmatch of unrelated H3 BIOS families is possible in theory but H3ET is the E330/E335 firmware family.
---
## PHASE 3: GIT HISTORY INVESTIGATION
**Step 3.1: BLAME THE CHANGED LINES**
Record: The insertion sits among NS quirks added by:
- 66e92e23a7276 (2023-12-14) Vishnu Sankar — introduced TPACPI_FAN_NS (L13 Yoga Gen 2, X13 Yoga Gen 2)
- a6dcd3f1725e0 (2024-02-29) Vishnu Sankar — more NS models (L380, L390, 11e Gen5, …)
Both **are ancestors of this HEAD**. The E330 bug is the missing table row, not a newly introduced regression. This machine has been mis- reported for as long as the default 0x84/0x85 path has been used.
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. Not applicable.
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record: Related fan quirks already in this 6.12 tree:
- f92324135f09e — X120e TPR fan-speed quirk (stable-style backport already here)
- 1be765b292577 — L480 TPACPI_FAN_DECRPM incorrect RPM
- a6dcd3f1725e0 / 66e92e23a7276 — NS fan register path
- 48792ab445529 — T495/E560 ACPI fan quirk
Standalone one-line table add; not patch X/Y.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record: git log --author='Onyshchuk' on drivers/platform/x86/ in this tree is empty. Author is an outside contributor with Lenovo + maintainer review, not the subsystem maintainer.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
Record: Depends only on TPACPI_FAN_NS / fan_rpm_status_ns / TPACPI_Q_LNV, all present here. Can apply standalone (path tweak only).
---
## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- b4 dig -c 051292bf7697e72a760401b6883c55a98beecc5b failed: SHA is not in this tree (Not a valid commit name).
- b4 mbox for msgid [email protected] returned 404.
- lore.kernel.org fetches returned 403.
- Recovered the thread from Patchew and LKML mirrors:
- https://patchew.org/linux/20260806154417.618575-1-
[email protected]/
- https://lkml.iu.edu/2608.0/11369.html
- Single [PATCH], not a series. Applied by Ilpo as 051292bf7697e72a760401b6883c55a98beecc5b.
- No NAK. Ilpo noted Linus’s policy that even fixes usually go via for- next unless they are current-cycle regressions — that is merge-window routing, not a stable NAK.
- No reviewer asked for Cc: stable.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record: Mark Pearson (Lenovo) Reviewed-by; Ilpo Järvinen applied it. Recipients from Openwall copy: platform-driver-x86, ibm-acpi-devel, linux-kernel, plus Pearson / Clark / Holschuh / Hans.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No syzbot/bugzilla. Evidence is the author’s hardware test (H3ET77WW / H3EC35WW). Mark Pearson: platform is ~14 years old; he could not confirm but was glad the author figured it out.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: Standalone. Same pattern as earlier NS fan quirk additions. E330/E335 share the H3ET BIOS family; the 2-char H3 match is the driver’s normal family match.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: lore.kernel.org/stable search returned 403. No evidence this was already requested or rejected on stable. UNVERIFIED beyond that.
---
## PHASE 5: CODE SEMANTIC ANALYSIS
semcode MCP is not available; used grep/read.
**Step 5.1: IDENTIFY KEY FUNCTIONS**
Record: No function body change. Touches fan_quirk_table, consumed by fan_init(). Downstream: fan_get_speed(), fan_get_status(), fan_read(), sysfs fan1_input.
**Step 5.2: TRACE CALLERS**
Record:
- fan_get_speed() → fan_fan1_input_show() (hwmon fan1_input) and fan_read() (/proc/acpi/ibm/fan).
- Userspace: lm-sensors, thinkfan, TLP, etc., on ThinkPads with CONFIG_THINKPAD_ACPI.
- Init-time quirk match only; no IRQ path.
**Step 5.3: TRACE CALLEES**
Record: Existing acpi_ec_read(0x95) and RPM conversion. No new allocation/locking.
**Step 5.4: FOLLOW THE CALL CHAIN**
Record: Reachable from userspace sysfs/proc reads on E330 with thinkpad_acpi loaded. Unprivileged read of hwmon is typical. Not a syscall crash path.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: Nine existing TPACPI_FAN_NS rows in the same table; this is the tenth. Thermal NS table for the Yoga/11e set is **not** extended here (E330 was not claimed to need thermal NS).
---
## PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record: Yes. fan_quirk_table in drivers/platform/x86/thinkpad_acpi.c (lines 8805–8837) has NS entries through 11e Gen5 and then jumps to TPACPI_FAN_NOFAN. No 'H','3' row. Default TPEC RPM path is used → 0 RPM on E330. Infrastructure needed for the fix is here since 66e92e23a7276.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: **Minor path adjustment only.** Surrounding context in this tree matches the hunk exactly (same 11e Gen5 / X1 Tablet / L480 / x120e neighbors). File move to lenovo/ happened after 6.12. Expected apply:
change path, otherwise clean.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: NS path and other model quirks are here. This specific H3/E330 line is not. git merge-base --is-ancestor 051292bf7697… HEAD fails because that SHA is not in this object store.
---
## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: **platform/x86 thinkpad_acpi** — **PERIPHERAL/IMPORTANT for ThinkPad users**. Fan sysfs is widely used; not core mm/fs/net.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Actively maintained; recent 6.12 backports already include other thinkpad_acpi fan quirks (X120e TPR, T495 NOACPI). Mature driver, long- lived quirk table.
---
## PHASE 8: IMPACT AND RISK ASSESSMENT
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: **Driver-specific / DMI-specific.** Only Lenovo machines whose BIOS parses as family H3 (E330 H3ET; likely E335 siblings). Everyone else is unchanged.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: Every read of fan1_input or /proc/acpi/ibm/fan on those machines. Common for anyone monitoring fans. Unprivileged sysfs read. Not a race.
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: Incorrect fan RPM (always 0). **MEDIUM** for affected users (broken monitoring; thinkfan/sensors may treat the fan as stopped). Not panic, UAF, or corruption. Still a real hardware bug with a standard quirk fix.
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- **Benefit:** Makes fan tachometer work on E330 (and H3-family siblings) on 6.12 LTS. Same class of fix already accepted in this tree for X120e/L480/Yoga.
- **Risk:** Very low — one line, model-gated, existing code path.
- **Ratio:** Favorable.
---
## PHASE 9: FINAL SYNTHESIS
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Real, tested hardware bug: E330 reports 0 RPM.
- Classic stable-eligible **hardware quirk** (one TPACPI_Q_LNV row).
- Existing NS path already in 6.12; no new feature/API.
- 1-line, obviously correct; Lenovo + pdx86 review.
- Analogous fan quirks already live in this tree.
- Applies here with a trivial path change.
AGAINST:
- Not crash/security/corruption.
- Old niche laptop; small population.
- Maintainer sent it via for-next, not as a current-cycle regression.
- Author-only test; Pearson could not independently verify.
UNRESOLVED:
- Stable-list discussion (lore 403).
- Whether every H3 BIOS SKU (e.g. E335) truly uses 0x95; family-level match is the driver’s normal pattern.
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — 1-line quirk; tested on E330 H3ET77WW; two Reviewed-by.
2. Fixes a real bug that affects users? **PASS** — fan speed stuck at 0.
3. Important issue? **PASS** under the hardware-quirk exception; severity MEDIUM, not CRITICAL.
4. Small and contained? **PASS** — +1 line, one table.
5. No new features or APIs? **PASS** — enables existing NS path for one BIOS family.
6. Can apply to the local tree? **PASS** — NS path present; path rename only.
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: **Hardware quirk/workaround** — qualifies even though it adds a table row.
**Step 9.4: DECISION**
This is the same kind of thinkpad_acpi fan quirk this 6.12 tree already carries. The bug exists here, the fix is surgical, and the risk is confined to H3-family ThinkPads.
---
### What the commit solves for this tree
On ThinkPad Edge E330 (BIOS family H3), thinkpad_acpi reads the standard EC tachometer at 0x84/0x85 and always reports 0 RPM. Adding TPACPI_FAN_NS for H3 switches that model onto the existing 0x95 period reader so hwmon//proc/acpi/ibm/fan show a real speed. 6.12 already has that reader; it is only missing this DMI row.
### Risk vs benefit
Benefit is correct fan monitoring on those laptops. Risk is a one-line, model-gated change. Backport needs only retargeting the path from lenovo/thinkpad_acpi.c to drivers/platform/x86/thinkpad_acpi.c.
---
### Verification
- [Phase 1] Parsed subject/tags/body from the provided commit message; Link msgid [email protected].
- [Phase 2] Diff is +1 TPACPI_Q_LNV('H','3', TPACPI_FAN_NS) in fan_quirk_table.
- [Phase 2] Read fan_get_speed() NS case (0x95) and fan_init() NS setup in this tree.
- [Phase 2] Read tpacpi_parse_fw_id(): H3ET77WW → TPID('H','3'), matches TPACPI_Q_LNV.
- [Phase 3] git blame -L 8822,8837: NS rows from 66e92e23a7276 and a6dcd3f1725e0.
- [Phase 3] git merge-base --is-ancestor 66e92e23a7276 HEAD and a6dcd3f1725e0 HEAD: both in tree.
- [Phase 3] git log --author=Onyshchuk on platform/x86: no local commits.
- [Phase 4] b4 dig/b4 mbox/lore.kernel.org failed (missing SHA / 404 / 403). Thread recovered from Patchew + lkml.iu.edu + Openwall:
Pearson Reviewed-by, Ilpo applied as 051292bf7697.
- [Phase 4] Web search: H3ET is E330/E335 BIOS family; author tested H3ET77WW.
- [Phase 5] semcode unavailable; grep fan_get_speed → sysfs fan1_input and fan_read().
- [Phase 6] git describe HEAD → p-6.12-3-gc504cf0baa3d8; make kernelversion → 6.12.111.
- [Phase 6] Grep: no 'H', '3' / Edge E330 in local file; NS table ends at 11e Gen5.
- [Phase 6] File exists only at drivers/platform/x86/thinkpad_acpi.c.
- [Phase 6] 051292bf7697 is not a valid object in this repo.
- [Phase 7] CONFIG_THINKPAD_ACPI in drivers/platform/x86/Kconfig.
- [Phase 8] Failure mode: 0 RPM reporting, not oops.
- UNVERIFIED: stable@ lore discussion (HTTP 403); independent confirmation on E335.
**YES**
drivers/platform/x86/lenovo/thinkpad_acpi.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/lenovo/thinkpad_acpi.c +1 -0
@@ -8854,6 +8854,7 @@ static const struct tpacpi_quirk fan_quirk_table[] __initconst = {TPACPI_Q_LNV3 ('R' ,'0' ,'T' ,TPACPI_FAN_NS ),/* 11e Gen5 GL */ TPACPI_Q_LNV3 ('R' ,'1' ,'D' ,TPACPI_FAN_NS ),/* 11e Gen5 GL-R */ TPACPI_Q_LNV3 ('R' ,'0' ,'V' ,TPACPI_FAN_NS ),/* 11e Gen5 KL-Y */ +TPACPI_Q_LNV ('H' ,'3' ,TPACPI_FAN_NS ),/* Edge E330 */ TPACPI_Q_LNV3 ('N' ,'1' ,'O' ,TPACPI_FAN_NOFAN ),/* X1 Tablet (2nd gen) */ TPACPI_Q_LNV3 ('R' ,'0' ,'Q' ,TPACPI_FAN_DECRPM ),/* L480 */ TPACPI_Q_LNV('8', 'F', TPACPI_FAN_TPR), /* ThinkPad x120e */
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ALSA: hda/realtek: Enable mute LEDs on HP Spectre x360 16-aa0xxx
In reply to Sasha LevinFrom: Shang En Sim <[email protected]>
[ Upstream commit bfcdc1c0eaeae5525c726193568e8d638b2afdc0 ]
The HP Spectre x360 2-in-1 Laptop 16-aa0xxx with PCI subsystem ID 0x103c:0x8c17 only gets the CS35L41 amplifier setup from ALC287_FIXUP_CS35L41_I2C_2, so the speaker-mute and mic-mute keyboard LEDs do not work.
Use ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX like subsystem ID 0x8c16 so the mute LEDs work.
Tested on HP Spectre x360 2-in-1 Laptop 16-aa0xxx.
---
LLM Generated explanations, may be completely bogus:
The local tree is **6.18.53** (pending-6.18, p-6.18-1-g03b85e06ca9bf). The buggy 0x8c17 mapping is present here, and the target AA0XXX fixup already exists.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: [ALSA hda/realtek] [Enable] [map HP Spectre x360 16-aa0xxx SSID 0x8c17 to the mute-LED fixup already used by 0x8c16]
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- Fixes: none (expected for this review)
- Reported-by: none
- Tested-by: none as a tag; body says the author tested on the 16-aa0xxx
- Reviewed-by: none
- Acked-by: none
- Link: https://patch.msgid.link/[email protected]
- Cc: stable: none (expected)
- Signed-off-by: Shang En Sim <[email protected]> (author)
- Signed-off-by: Takashi Iwai <[email protected]> (ALSA maintainer; applied the patch)
- No syzbot / sanitizer tags
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- Bug: SSID 0x103c:0x8c17 is wired only to ALC287_FIXUP_CS35L41_I2C_2, so CS35L41 amps are set up but speaker- mute and mic-mute keyboard LEDs do not work.
- Symptom: mute/mic-mute LEDs stay dead on this 16-aa0xxx variant.
- Root cause: sibling 0x8c16 already uses ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX; 0x8c17 was left on the amp-only quirk.
- Version info: none in the message.
- Author’s fix: use the same AA0XXX fixup as 0x8c16. Tested on the 16-aa0xxx.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not hidden. This is an explicit hardware-quirk correction, not cleanup disguised as a fix.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- File: sound/hda/codecs/realtek/alc269.c (1 hunk)
- Scope: 1 line changed in alc269_fixup_tbl[] (SSID string + fixup id)
- Classification: single-file surgical quirk-table update
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record: Before, SND_PCI_QUIRK(0x103c, 0x8c17, ...) selected ALC287_FIXUP_CS35L41_I2C_2 (cs35l41_fixup_i2c_two only). After, the same SSID selects ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX. That fixup still calls cs35l41_fixup_i2c_two, and also applies speaker pin configs, GPIO amp enable, mute-LED coefbit, and GPIO LED setup. Path:
codec probe via snd_hda_pick_fixup().
Step 2.3: IDENTIFY THE BUG MECHANISM
Record: [Hardware workaround / audio codec quirk] The wrong existing fixup left mute LEDs (and the extra speaker GPIO/pin work from the 2024 Spectre fixup) unused. The new mapping reuses an already-present fixup.
Step 2.4: ASSESS THE FIX QUALITY
Record: Obviously correct: 0x8c16 and 0x8c17 were added together as “HP Spectre 16”; 0x8c16 already got the full AA0XXX fixup. One-line table change, no new API. Regression risk is low: the author tested 0x8c17 hardware; the new fixup still runs the old CS35L41 I2C setup. Residual risk is that 0x8c17 could differ slightly from 0x8c16 in speaker pin/GPIO behavior; that is unverified beyond the author’s test.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record: In this tree the 0x8c17 line is attributed to aeeb85f26c3bb (“ALSA: hda: Split Realtek HD-audio codec driver”, 2025-07-09), which is a file move. The content originated in aa8e3ef4fe533 (“ALSA:
hda/realtek: Add quirks for various HP ENVY models”, 2024-01-26, first in v6.9). Both aa8e3ef4fe533 and 557f6e4ab5ba6 are ancestors of this HEAD.
Step 3.2: FOLLOW THE FIXES: TAG
Record: No Fixes: tag. The incomplete 0x8c17 mapping has been in the lineage since v6.9; the AA0XXX fixup landed in 557f6e4ab5ba6 (v6.12) for 0x8c16 only and left 0x8c17 on the amp-only quirk.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record: Related: 557f6e4ab5ba6 added alc245_fixup_hp_spectre_x360_16_aa0xxx and switched 0x8c16. Recent alc269.c history is other HP mute-LED quirks. This commit is standalone, not patch X/Y.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Shang En Sim has no other Realtek commits in this history. Takashi Iwai applied it. This tree already contains many similar HP mute-LED SND_PCI_QUIRK backports.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: Needs ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX and the 0x8c17 table row. Both exist here. git apply --check of bfcdc1c0eaeae succeeded (hunk at offset -491). Standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- b4 dig -c bfcdc1c0eaeae:
https://patch.msgid.link/[email protected]
- b4 dig -a: v1 only (2026-08-06)
- Thread (mbox): Takashi Iwai “Applied to for-next branch now. Thanks.” No NAK, no stable request, no design concerns.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record: b4 dig -w: To Jaroslav Kysela, Takashi Iwai; Cc linux-sound@. Maintainer applied it.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: No bugzilla/syzbot link. Evidence is the author’s hardware test in the commit body. WebFetch of lore/msgid.link returned 403; the thread was recovered via b4 dig -m.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: Standalone. Sibling work is 557f6e4ab5ba6 (already in this tree).
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: No lore.kernel.org/stable discussion of this subject was found.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: Table alc269_fixup_tbl[] only. No function body edited. Consumed fixup: alc245_fixup_hp_spectre_x360_16_aa0xxx.
Step 5.2: TRACE CALLERS
Record: alc269_probe() → snd_hda_pick_fixup(..., alc269_fixup_tbl, alc269_fixups) (around line 8517). That is HD-audio codec probe, not a hot path or IRQ path.
Step 5.3: TRACE CALLEES
Record: New fixup calls snd_hda_apply_pincfgs, snd_hda_override_conn_list, alc_update_gpio_data, cs35l41_fixup_i2c_two, alc245_fixup_hp_mute_led_coefbit, alc245_fixup_hp_gpio_led. Old quirk only called cs35l41_fixup_i2c_two.
Step 5.4: FOLLOW THE CALL CHAIN
Record: PCI/HDA enumeration at boot on this laptop. Userspace mute keys then drive the LED hooks. Reachable on that hardware without extra privileges.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: Same file already maps 0x8c16 to AA0XXX. Many nearby HP SND_PCI_QUIRK mute-LED entries. This is the same pattern, for the missed sibling SSID.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: Yes. sound/hda/codecs/realtek/alc269.c:6957:SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2)
Target enum, function, and alc269_fixups[] slot all exist. git merge- base --is-ancestor bfcdc1c0eaeae HEAD is false, so the fix is not in this tree yet. Incomplete 0x8c17 mapping dates to v6.9; 6.18 still has it.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: Clean apply (git apply --check succeeded). File layout matches mainline (sound/hda/codecs/realtek/alc269.c). No rework needed.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: 557f6e4ab5ba6 is here (0x8c16 + AA0XXX function). 0x8c17 is still on the amp-only quirk. No substitute fix.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: [ALSA HD-audio Realtek] [IMPORTANT] Common laptop codec path; this change is one HP SSID only.
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: High. Recent alc269.c log is mostly HP/Lenovo/ASUS quirk additions, including mute LEDs. Mature quirk table, not experimental code.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: Driver-specific / platform-specific: HP Spectre x360 16-aa0xxx with PCI SSID 0x103c:0x8c17 only.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Every probe of that codec (boot). Mute/mic-mute keys then fail to light LEDs. Unprivileged users hit it on that laptop. Not a race.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record: Mute/mic-mute LEDs do not work. The unused AA0XXX path also has speaker pin/GPIO amp setup that 0x8c16 already gets. Not a panic, deadlock, or corruption. Severity MEDIUM for that hardware; this is the documented audio-codec quirk exception.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record: Benefit high for those users (LEDs, and the same speaker fixup as 0x8c16). Risk very low: 1-line table change, same fixup already used by sibling SSID, maintainer-applied, author-tested. Ratio strongly favors backport.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Real hardware bug on a shipping HP Spectre x360 16-aa0xxx SSID
- Classic SND_PCI_QUIRK audio-codec quirk correction (stable exception)
- Buggy row and target fixup both exist in 6.18.53
- One-line, applies cleanly, no new API
- Author tested; Takashi Iwai applied
- Sibling 0x8c16 already uses this fixup here
- This tree already takes similar HP mute-LED quirks
AGAINST:
- No crash/security/corruption
- No Fixes:/Cc: stable (not a negative by itself)
- Author is not the subsystem maintainer (mitigated by Iwai applying it)
- Theoretical 0x8c16 vs 0x8c17 hardware difference (mitigated by test on 0x8c17)
UNRESOLVED:
- Could not HTTP-fetch lore (403); thread recovered via b4 mbox
- No independent second-user report
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? PASS — one-line SSID remap; author tested; maintainer applied
2. Fixes a real bug that affects users? PASS — mute LEDs dead on this SSID
3. Important issue? PASS under the audio-codec quirk exception (MEDIUM, not a panic)
4. Small and contained? PASS — 1 line, one table
5. No new features or APIs? PASS — reuses existing fixup
6. Can apply to the local tree? PASS — git apply --check succeeded; prerequisites present
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: Hardware quirk / audio codec SND_PCI_QUIRK (HP mute LED + pin/GPIO). This class is treated as stable material.
Step 9.4: MAKE YOUR DECISION
This tree already has the incomplete 0x8c17 mapping and the AA0XXX fixup. The commit only points this SSID at that fixup. That is a small, tested hardware quirk and should be backported.
What the commit solves: 0x8c17 currently only programs CS35L41 amps, so mute LEDs do not work. After the change it matches 0x8c16.
Risk vs benefit: very low risk, clear user-visible fix on that laptop. No missing prerequisites in 6.18.53.
Verification:
- [Phase 1] Parsed tags: Link to msgid; SOBs Shang En Sim and Takashi Iwai; no Fixes/Reported-by/Cc:stable
- [Phase 2] Diff: 1 line in alc269_fixup_tbl; 0x8c17 ALC287_FIXUP_CS35L41_I2C_2 → ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX
- [Phase 2] Confirmed AA0XXX still calls cs35l41_fixup_i2c_two plus mute-LED/GPIO/pin setup (alc269.c:3550-3590)
- [Phase 2] Confirmed old quirk is amp-only ([ALC287_FIXUP_CS35L41_I2C_2] → cs35l41_fixup_i2c_two)
- [Phase 3] git blame -L 6954,6960: 0x8c17 line from split commit aeeb85f26c3bb; origin aa8e3ef4fe533 (v6.9)
- [Phase 3] git merge-base --is-ancestor aa8e3ef4fe533 HEAD true; 557f6e4ab5ba6 true; bfcdc1c0eaeae false
- [Phase 3] git show 557f6e4ab5ba6: added AA0XXX for 0x8c16, left 0x8c17 unchanged
- [Phase 4] b4 dig -c bfcdc1c0eaeae:
patch.msgid.link/[email protected]
- [Phase 4] b4 dig -a: v1 only
- [Phase 4] b4 dig -w: Kysela, Iwai, linux-sound
- [Phase 4] b4 dig -m: Iwai applied to for-next; no NAK
- [Phase 4] WebFetch lore/msgid.link: 403; used mbox instead
- [Phase 4] Stable lore search: no discussion of this patch
- [Phase 5] alc269_probe() calls snd_hda_pick_fixup(..., alc269_fixup_tbl, ...)
- [Phase 6] git describe HEAD: p-6.18-1-g03b85e06ca9bf; make kernelversion: 6.18.53; branch pending-6.18
- [Phase 6] Buggy line at alc269.c:6957; 0x8c16 already AA0XXX at 6956
- [Phase 6] git show bfcdc1c0eaeae | git apply --check: succeeded at offset -491
- [Phase 8] Failure mode: mute LEDs inoperative on SSID 0x8c17; severity MEDIUM; quirk exception applies
- UNVERIFIED: HTTP lore body (403); whether any 0x8c17 unit differs electrically from 0x8c16 beyond the author’s test
**YES**
sound/hda/codecs/realtek/alc269.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/hda/codecs/realtek/alc269.c +1 -1
@@ -6969,7 +6969,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x103c ,0x8bf0 ,"HP" ,ALC236_FIXUP_HP_GPIO_LED ),SND_PCI_QUIRK (0x103c ,0x8c15 ,"HP Spectre x360 2-in-1 Laptop 14-eu0xxx" ,ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX ),SND_PCI_QUIRK (0x103c ,0x8c16 ,"HP Spectre x360 2-in-1 Laptop 16-aa0xxx" ,ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX ), -SND_PCI_QUIRK (0x103c ,0x8c17 ,"HP Spectre 16" ,ALC287_FIXUP_CS35L41_I2C_2 ), +SND_PCI_QUIRK (0x103c ,0x8c17 ,"HP Spectre x360 2-in-1 Laptop 16-aa0xxx" ,ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX ),SND_PCI_QUIRK (0x103c ,0x8c21 ,"HP Pavilion Plus Laptop 14-ey0XXX" ,ALC245_FIXUP_HP_X360_MUTE_LEDS ),SND_PCI_QUIRK (0x103c ,0x8c2d ,"HP Victus 15-fa1xxx (MB 8C2D)" ,ALC245_FIXUP_HP_MUTE_LED_COEFBIT ), SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT),
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 PCI: vmd: Add Nova Lake (NVL) and Dunlow (DNL) Device IDs
In reply to Sasha LevinFrom: Szymon Durawa <[email protected]>
[ Upstream commit 55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8 ]
Add VMD Device ID Support for Intel NVL/DNL processors.
---
LLM Generated explanations, may be completely bogus:
This tree is **6.12.111** (p-6.12-3-gc504cf0baa3d8). The commit is a PCI ID table update for the existing Intel VMD driver, and that driver plus VMD_FEATS_CLIENT are already here.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1:** Record: [PCI: vmd] [Add] Add Nova Lake (NVL) and Dunlow (DNL) Device IDs
**Step 1.2:** Tags (ignoring pipeline Signed-off-by: Sasha Levin / [Upstream commit ...]):
- Suggested-by: Nirmal Patel (Intel VMD maintainer)
- Signed-off-by: Szymon Durawa (author, Intel)
- Signed-off-by: Bjorn Helgaas (PCI maintainer; applied it)
- Cc: Nirmal Patel, Jonathan Derrick
- Link: https://patch.msgid.link/20260819130523.398493-1-
[email protected]
- No Fixes:, Reported-by, Tested-by, Reviewed-by in the committed message (Reviewed-by: Nirmal Patel was given on v1 but not copied into the commit)
- No Cc: stable (expected for this review)
**Step 1.3:** Record: Bug description: none as a crash/leak. The body is one sentence: add VMD Device IDs for Intel NVL/DNL. Failure mode without the patch: vmd does not bind to 8086:d70b / 8086:d73b, so NVMe/PCIe devices under Intel RST/VMD stay hidden. No version range in the message. Root cause: missing PCI IDs in vmd_ids[].
**Step 1.4:** Record: Not a hidden bug fix. It is a hardware-ID enablement patch, which is an explicit stable exception.
===============================================================
PHASE 2: DIFF ANALYSIS
===============================================================
**Step 2.1:** Record: drivers/pci/controller/vmd.c only; +4 / -0. Function/data: vmd_ids[]. Scope: single-file surgical ID add.
**Step 2.2:** Record: Before: table ends at 0xb07f (mainline) / 0xb06f (this 6.12 tree). After: 0xd70b and 0xd73b appended with .driver_data = VMD_FEATS_CLIENT. Probe path for those IDs then runs vmd_probe() → vmd_enable_domain().
**Step 2.3:** Record: Category **h) hardware workarounds / device ID additions**. Mechanism: PCI core matches the ID table; without the entries the driver never probes.
**Step 2.4:** Record: Obviously correct; same pattern as existing client SKUs (0x7d0b, 0xad0b, 0xb60b, 0xb06f). No locking/API/data-structure change. Regression risk is very low: only systems with those two IDs are affected, and they currently have no VMD driver at all.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1:** Record: vmd_ids[] dates to 2016 (185a383ada2e). VMD_FEATS_CLIENT grouping is 14d2079af6483 (2023, in this tree). Last IDs in this tree are 0xb60b/0xb06f from 34883c93bd330 (already backported to 6.12.y). 0xd70b/0xd73b are absent here. 0xb07f is in the parent context of the mainline commit but **not** in this tree; it is a sibling ID, not a functional prerequisite.
**Step 3.2:** Record: No Fixes: tag. Not applicable.
**Step 3.3:** Record: Same-file history includes several prior DID adds that followed this exact pattern:
- 57a128acaba02 PCI: vmd: Add DID 8086:7D0B and 8086:AD0B for Intel MTL SKUs
- 34883c93bd330 PCI: vmd: Add DID 8086:B06F and 8086:B60B for Intel client SKUs (already in this 6.12 tree)
Standalone; not patch X/Y of a series that this commit depends on.
**Step 3.4:** Record: Author Szymon Durawa has no other VMD commits in this tree. Suggested/reviewed by Nirmal Patel, who authored the previous client DID add in this file.
**Step 3.5:** Record: Uses existing PCI_VDEVICE and VMD_FEATS_CLIENT. Does not use later v7.3 features (VMD_FEAT_USE_BIOS_INFO, BUS_RESTRICT_CFG=3). Those other v7.3 VMD patches target different IDs (0x28C1 / Arrow Lake-HX). Can apply standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1:** Record: Mainline SHA 55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8 (not an ancestor of this HEAD).
- b4 dig: https://patch.msgid.link/20260819130523.398493-1-
[email protected]
- v1: 2026-07-08 (duplicate subject, missing CCs)
- v2: 2026-07-29 (CCs added)
- v3: 2026-08-19 (description added) — this is what was applied
- No NAKs. Manivannan asked for a changelog body and full maintainer CC. Nirmal Patel Reviewed-by on v1. Bjorn: “Applied to pci/controller/vmd for v7.3”. No reviewer asked for Cc: stable.
**Step 4.2:** Record: Recipients included linux-pci, Bjorn Helgaas, Nirmal Patel, Jonathan Derrick, Dan Williams, Lukas Wunner, Lorenzo Pieralisi, Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring. Right maintainers were on the thread by v2/v3.
**Step 4.3:** Record: No syzbot/bugzilla report. This is Intel enablement, not a fuzzer crash.
**Step 4.4:** Record: Standalone 1-patch series. Same v7.3 VMD merge also had BIOS-info / BUS_RESTRICT_CFG=3 / _OSC patches; this ID add does not depend on them.
**Step 4.5:** Record: No stable-list discussion found (lore.kernel.org/stable returned 403; web search did not show a stable thread for this subject). Absence is not a negative signal.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1:** Record: Modified vmd_ids[] only. Consumers:vmd_drv.id_table → PCI core → vmd_probe().
**Step 5.2:** Record: Callers of vmd_probe(): PCI bus match on VMD devices. Context: driver probe during enumeration (boot / module load), not IRQ/hot path. Impact surface: only 8086:d70b and 8086:d73b.
**Step 5.3:** Record: vmd_probe() uses id->driver_data as feature flags, then vmd_enable_domain(). VMD_FEATS_CLIENT already includes membar shadow VSCAP, bus restrictions, first-vector offset, BIOS PM quirk.
**Step 5.4:** Record: Reachable whenever firmware presents those PCI IDs (Intel RST/VMD mode on NVL/DNL). Userspace cannot invent the IDs; missing IDs mean missing NVMe.
**Step 5.5:** Record: Same pattern as every recent client VMD DID add. 34883c93bd330 is the direct precedent already in this tree.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1:** Record: VMD driver exists (drivers/pci/controller/vmd.c, CONFIG_VMD). VMD_FEATS_CLIENT exists at lines 83–86. Current table ends at 0xb06f (lines 1109–1132). 0xd70b and 0xd73b are **not** present. Hardware is new; the *driver* has been here for years.
**Step 6.2:** Record: Backport difficulty: **minor context tweak**. Hunk context mentions 0xb07f, which this tree lacks. Insert the two entries after 0xb06f. No semantic rework.
**Step 6.3:** Record: No equivalent NVL/DNL IDs already here. git merge-base --is-ancestor 55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8 HEAD failed (not in this tree).
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1:** Record: Subsystem PCI host controller / Intel VMD.
Criticality: **IMPORTANT** for Intel client systems using RST/VMD (common laptop default); not core mm/fs, but storage disappearance is user-visible.
**Step 7.2:** Record: Mature driver (since ~2016). Recent 6.12 VMD work is bugfixes plus prior DID adds. This is the same mature ID-table pattern.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1:** Record: Affected users: Intel Nova Lake / Dunlow systems with VMD enabled (CONFIG_VMD, x86_64). Not universal.
**Step 8.2:** Record: Trigger: boot/enumeration on that hardware. Common on those SKUs if BIOS leaves RST/VMD on. Not a race; not unprivileged- exploit.
**Step 8.3:** Record: Failure mode: VMD and child NVMe never bind → missing system/data disks. Severity: **HIGH** for those platforms (storage unavailable), not a kernel oops.
**Step 8.4:** Record: Benefit high for NVL/DNL on 6.12.y (LTS still receiving updates at 6.12.111). Risk very low: 4 lines, existing flags, existing probe path. Precedent: 0xb06f/0xb60b already backported here.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1:** FOR:
- Stable exception: PCI ID add to an existing driver
- Driver, VMD_FEATS_CLIENT, and probe path all present in 6.12.111
- Same pattern already backported (34883c93bd330)
- 4 lines, no new APIs, no new features beyond matching two IDs
- Suggested/reviewed by VMD maintainer; applied by PCI maintainer
- Without it, NVMe behind VMD is invisible on those CPUs
AGAINST:
- Not a crash/UAF/security fix
- Context mentions 0xb07f, absent here (trivial adjust)
- NVL/DNL are newer than 6.12’s original release; other platform bits may still be missing on a given machine — but that is true of every DID backport and is not a reason to omit the IDs
UNRESOLVED:
- Could not read lore.kernel.org/stable (403). No evidence of a deliberate stable skip.
**Step 9.2:** Stable rules:
1. Obviously correct and tested? **PASS** (standard ID table; maintainer review + applied)
2. Fixes a real bug that affects users? **PASS** (devices never bind without the IDs)
3. Important issue? **PASS** under the device-ID exception; storage non- enumeration is serious for affected hardware
4. Small and contained? **PASS** (4 lines, one table)
5. No new features or APIs? **PASS** (IDs only; existing feature flags)
6. Can apply to this tree? **PASS** (minor context conflict only)
**Step 9.3:** Record: Exception category: **NEW DEVICE IDs** on an existing driver.
**Step 9.4:** Backport. The local tree has the driver and the client feature set; this is the same class of change already taken for earlier Intel client VMD IDs.
Verification:
- [Phase 1] Parsed tags: Suggested-by Nirmal Patel; SOB Durawa + Helgaas; Link msgid 20260819130523.398493-1; no Fixes/syzbot
- [Phase 2] Diff: +4 lines in vmd_ids[] for 0xd70b and 0xd73b with VMD_FEATS_CLIENT
- [Phase 3] blame: table from 2016; VMD_FEATS_CLIENT from 14d2079af6483 (in tree); last IDs 34883c93bd330 (in tree)
- [Phase 3] No Fixes: tag
- [Phase 3] git merge-base --is-ancestor 55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8 HEAD → not in this tree
- [Phase 4] b4 dig -c 55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8:
matched v1/v2/v3; v3 applied
- [Phase 4] b4 dig -w: linux-pci + Helgaas + Patel on original To/Cc
- [Phase 4] v1 mbox: Manivannan requested description/CCs; Nirmal Patel Reviewed-by; no NAK
- [Phase 4] v3 mbox: Helgaas applied for v7.3
- [Phase 4] lore.kernel.org/stable fetch: 403, UNVERIFIED whether it was discussed on stable@
- [Phase 5] vmd_probe() reads id->driver_data; CONFIG_VMD in drivers/pci/controller/Kconfig
- [Phase 6] git describe HEAD / Makefile: 6.12.111; IDs 0xd70b/0xd73b/0xb07f absent from local vmd.c
- [Phase 6] VMD_FEATS_CLIENT present at lines 83–86 of local vmd.c
- [Phase 8] Failure mode: VMD/NVMe not enumerated on NVL/DNL, not a panic
This is a four-line PCI ID addition to a driver that already exists in 6.12.y, using feature flags already used by other client SKUs. That is exactly the stable device-ID exception.
**YES**
drivers/pci/controller/vmd.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/pci/controller/vmd.c +4 -0
@@ -1141,6 +1141,10 @@ static const struct pci_device_id vmd_ids[] = { .driver_data = VMD_FEATS_CLIENT,}, {PCI_VDEVICE(INTEL, 0xb07f), .driver_data = VMD_FEATS_CLIENT,}, + {PCI_VDEVICE(INTEL, 0xd70b), + .driver_data = VMD_FEATS_CLIENT,}, + {PCI_VDEVICE(INTEL, 0xd73b), + .driver_data = VMD_FEATS_CLIENT,}, {0,} };MODULE_DEVICE_TABLE (pci, vmd_ids);
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH AUTOSEL 6.18] PCI: vmd: Add Nova Lake (NVL) and Dunlow (DNL) Device IDs
Sashiko has reviewed this patch and found no issues.
Quoted 6 lines
From: Szymon Durawa <[email protected]>
[ Upstream commit
55aa45154fe48b7d8e96bc031ad27d5b0edfcdb8]Add VMD Device ID Support for Intel NVL/DNL processors.
Quoted 7 lines
Suggested-by Nirmal Patel <[email protected]>Signed-off-by Szymon Durawa <[email protected]>Signed-off-by Bjorn Helgaas <[email protected]>Cc Nirmal Patel <[email protected]>Cc Jonathan Derrick <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Sasha Levin
maintainerPATCH 1/1 ceph: fix use-after-dereference of NULL ci in __ceph_remove_cap()
In reply to Sasha LevinFrom: Xiubo Li <[email protected]>
[ Upstream commit a354d7eaa1a57f1532c8072a424cc2d339a73cc0 ]
The NULL check for "ci" in __ceph_remove_cap() was dead code because ci was dereferenced via &ci->netfs.inode before the check, and cap->session was dereferenced via session->s_mdsc->fsc->client even earlier. On a double-remove, both cap->ci and cap->session are set to NULL by the first call, so the second call would crash before ever reaching the guard.
Move ci, session, cl, and inode initializations after the NULL check so that the early-return actually works.
---
LLM Generated explanations, may be completely bogus:
I have enough to decide: this is a real NULL-deref regression in this 6.12 tree, the hunk matches locally, and the original crash was production-confirmed.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: [ceph] [fix] restore a dead NULL-ci guard in __ceph_remove_cap() so a second remove does not crash
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- Signed-off-by: Xiubo Li <[email protected]> (author; Ceph FS maintainer)
- Reviewed-by: Viacheslav Dubeyko <[email protected]>
- Signed-off-by: Ilya Dryomov <[email protected]> (Ceph maintainer who applied it)
- No Fixes: tag (expected for this review pipeline)
- No Reported-by / Tested-by / Link / Cc: stable
- Ignore any pipeline “Upstream commit” / “Signed-off-by: Sasha Levin” markers; they are not part of this evaluation
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- Bug: the if (!ci) early-return in __ceph_remove_cap() is dead. ci is used as &ci->netfs.inode before the check, and cap->session is used as session->s_mdsc->fsc->client even earlier.
- Symptom/failure mode: on a second remove, cap->ci (and often cap->session) are already NULL, so the second call NULL-derefs and oopses before the guard.
- Version info in the message: none.
- Root cause (author): initializers were placed before the NULL check, so the check cannot run.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not disguised. Explicit crash fix: move loads after the existing “already removed” guard.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- File: fs/ceph/caps.c only (+10 / -7; net ~3 lines of real change)
- Function: __ceph_remove_cap()
- Scope: single-function surgical fix
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- Before (this tree, fs/ceph/caps.c 1142–1155):
- session = cap->session
- cl = session->s_mdsc->fsc->client (deref session)
- ci = cap->ci
- inode = &ci->netfs.inode (deref ci)
- then if (!ci) return;
- After:
- declare the locals
- ci = cap->ci; if (!ci) return;
- then load session, cl, inode
- Path: second/concurrent remove of the same struct ceph_cap. Normal first remove is unchanged.
Step 2.3: IDENTIFY THE BUG MECHANISM
Record:
- Category: NULL pointer dereference (memory-safety), restoring a race/double-remove guard
- Mechanism: first __ceph_remove_cap() always does cap->ci = NULL and, unless s_cap_iterator == cap, also cap->session = NULL. A second call then hits NULL session or NULL ci during initializer evaluation. Moving the check first makes the early-return real again.
Step 2.4: ASSESS THE FIX QUALITY
Record:
- Obviously correct: C initializers must not run before the pointer they depend on is checked.
- Minimal: only reorders existing locals; no API/lock/data-structure change.
- Regression risk: very low. The only behavioral change on the already- removed path is dropping doutc(cl, "inode is NULL\n"), which could not run safely anyway because cl comes from session.
- Residual: session is still not NULL-checked after ci is confirmed non-NULL. In this tree cap->session is only set to NULL in __ceph_remove_cap() (non-iterator case) and in iterate_session_caps() after !cap->ci, so session-NULL with ci- non-NULL is not a current assignment pattern.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record:
- Function exists since Sage Weil 2009 (a8599bd821d084).
- Real NULL-ci guard added in e5cafce3ad0f8 (“ceph: fix race in concurrent __ceph_remove_cap invocations”, Luis Henriques, 2020; in v5.11-rc1). That commit *moved* mdsc init *after* if (!ci) for this exact crash.
- Regression: 38d46409c4639 (“ceph: print cluster fsid and client global_id in all debug logs”, Xiubo Li, 2023; in v6.7-rc1) added cl = session->s_mdsc->fsc->client and inode = &ci->netfs.inode *before* the check so doutc() could use them. That made the 2020 guard dead again.
Step 3.2: FOLLOW THE FIXES: TAG
Record: no Fixes: tag. The commit that reintroduced the crash is 38d46409c4639, which **is** an ancestor of this tree (git merge-base --is-ancestor exit 0). Original 2020 fix e5cafce3ad0f8 is also here.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record:
- ea60ed6fcf29e — UAF in __ceph_remove_cap() (rb_erase ordering); already here.
- a76d0a9c288ea — wrapper ceph_remove_cap() with its own if (!ci) check; already here.
- Recent fs/ceph/caps.c work is unrelated (revoke, UAF in kick_flushing, deadcode).
- Standalone; subject is not “patch X/Y”. A later mainline series proposing RB_CLEAR_NODE() instead of ci=NULL is **not** in this tree (ceph_cap_is_removed does not exist) and is not required for this fix.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Xiubo Li is listed in MAINTAINERS for Ceph FS and is a regular fs/ceph/ contributor in this history. Ilya Dryomov (other Ceph maintainer) committed it.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: none. It only reorders locals against code this tree already has (ci->netfs.inode, doutc, lockdep_assert_held). Applies standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- Mainline SHA: a354d7eaa1a57f1532c8072a424cc2d339a73cc0 (not an ancestor of HEAD; object exists locally).
- b4 dig -c a354d7eaa1a5: https://patch.msgid.link/20260714-ceph-fix-
[email protected]
- b4 dig -a: single v1, no v2/v3.
- Thread is two messages: the patch and Dubeyko “Makes sense.” + Reviewed-by. No NAK, no requested respin.
- Applied by Ilya Dryomov (CommitDate Wed Aug 26 2026).
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record (b4 dig -w): Xiubo Li, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, ceph-devel, linux-kernel. Right maintainers were on To/Cc.
Step 4.3: SEARCH FOR THE BUG REPORT
Record:
- This 2026 patch itself has no new syzbot/bugzilla link.
- The guard it restores was for a **production oops**: Ceph tracker 43272, “unable to handle kernel NULL pointer at __ceph_remove_cap+0x2a”. Stack: trim_caps_cb → iterate_session_caps → dispatch, with evict/destroy_inode in the trace; MDS reconnect/stale-caps workload. Ilya identified NULL cap->ci. That is the same function and the same check e5cafce3ad0f8 added (Cc: stable).
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: standalone one-patch series (change-id: 20260714-ceph-fix- remove-cap-cf7d8a7a242a). Unrelated later RB_CLEAR_NODE RFC is not a prerequisite for 6.12.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: UNVERIFIED for lore.kernel.org/stable HTML (Anubis 403). Full review thread was recovered via b4 dig -m. No reviewer asked to skip stable; no NAK.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: __ceph_remove_cap() only.
Step 5.2: TRACE CALLERS
Record (this tree):
- ceph_remove_cap() in fs/ceph/caps.c — wrapper; already has a safe if (!ci) return using caller mdsc, then calls __ceph_remove_cap().
- ceph_purge_inode_cap() in fs/ceph/caps.c — **direct** call, no inner NULL check.
- ceph_purge_inode_cap() callers: remove_session_caps_cb() (fs/ceph/mds_client.c), ceph_inode_shutdown() (fs/ceph/inode.c).
- Wrapper callers include __ceph_remove_caps() from ceph_evict_inode(), trim_caps_cb(), and cap import/export in caps.c.
- Context: inode eviction, session teardown, cap trim, MDS dispatch / ceph_con_workfn workqueue — not a one-time init path.
Step 5.3: TRACE CALLEES
Record: lockdep_assert_held, rb_erase, spin_lock(&session->s_cap_lock), __ceph_queue_cap_release, ceph_put_cap, ceph_change_snap_realm, __cap_delay_cancel. Unchanged by this patch.
Step 5.4: FOLLOW THE CALL CHAIN
Record: reachable from CephFS runtime: MDS reconnect/trim (trim_caps_cb / iterate_session_caps) and inode eviction. Userspace mounts CephFS; MDS recovery and memory reclaim trigger cap trim. Unprivileged users do not need a special syscall beyond using a mounted CephFS.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: wrapper ceph_remove_cap() already does the check correctly. __ceph_remove_cap() is the remaining broken copy after 38d46409c4639. Direct ceph_purge_inode_cap() still needs the inner guard.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: YES. Local tree is **pending-6.12 / 6.12.111** (git describe HEAD = p-6.12-3-gc504cf0baa3d8, Makefile VERSION=6 PATCHLEVEL=12 SUBLEVEL=111). Current fs/ceph/caps.c:1142-1155 is exactly the pre- patch code. Candidate a354d7eaa1a5 is **not** an ancestor of HEAD. Regression 38d46409c4639 (v6.7-rc1) **is** an ancestor.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: clean apply. The old hunk in this checkout matches the commit diff exactly (verified by matching the current function prologue). No netfs.inode mismatch.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: e5cafce3ad0f8 is here but is ineffective because of 38d46409c4639. No later equivalent reorder exists in this caps.c.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: [fs/ceph — CephFS client] [IMPORTANT: production distributed filesystem; not core VFS for every machine, but crash/data-path for all CONFIG_CEPH_FS users]
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: actively maintained (recent cap UAF/revoke fixes). This particular guard dates to 2020 and was broken by 2023 debug logging, not by new 6.12-only infrastructure.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: CephFS client users (CONFIG_CEPH_FS). Enterprise/HPC/cloud deployments commonly run this.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: concurrent __ceph_remove_cap() on the same cap — historically iterate_session_caps (trim_caps_cb / remove_session_caps_cb) vs inode eviction, especially around MDS reconnect/stale caps. Timing- dependent; documented as a real oops, not a lab-only theory. Trigger is kernel Ceph client activity, not a raw unprivileged syscall to an unused subsystem.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record: NULL deref → kernel oops in __ceph_remove_cap. Severity **CRITICAL**. Tracker 43272 is exactly that oops.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- Benefit: high — restores a stable-worthy crash guard that 6.12 still has on paper but cannot execute.
- Risk: very low — ~10-line local reorder, no locking/API change, first- remove path identical.
- Ratio: strongly favors backport.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Real NULL deref / oops, not cleanup.
- Production crash already recorded (tracker 43272); 2020 fix was Cc:
stable.
- 6.12 contains the v6.7 debug-log regression that killed that guard.
- Tiny, obviously correct, applies cleanly here.
- Written and applied by Ceph maintainers; reviewed with no NAK.
- Direct caller ceph_purge_inode_cap() still bypasses the wrapper check.
AGAINST:
- No Fixes:/Cc: stable on this 2026 commit (not a negative under these rules).
- Affects only CephFS, not every kernel.
- Double-remove is a race, not every cap remove.
UNRESOLVED:
- lore.kernel.org/stable HTML search blocked (Anubis). Review mbox was obtained via b4.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? **PASS** — reorder after the pointer check; maintainer review + mainline apply.
2. Fixes a real bug that affects users? **PASS** — oops; same class as tracker 43272.
3. Important issue (crash, security, corruption, deadlock)? **PASS** — kernel NULL deref / oops.
4. Small and contained? **PASS** — one function, one file, 17-line diff.
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — buggy code present; hunk matches 6.12.111.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: not an ID/quirk/DT/build/docs exception. Ordinary crash fix; qualifies on the main rules.
Step 9.4: MAKE YOUR DECISION
This 6.12 tree still evaluates session->s_mdsc and &ci->netfs.inode before if (!ci). That is a crash on a second remove. The patch restores the 2020 guard with no extra dependencies. It should be backported.
What the commit solves and why it matters here:__ceph_remove_cap() is supposed to no-op when cap->ci is already NULL (first remove already ran, including the iterate_session_caps delayed-remove case). In 6.12 those loads happen first, so the second call oopses. CephFS hits this on cap trim/session teardown versus eviction.
Risk vs benefit: benefit is avoiding a Ceph client oops; risk is a few lines of initializer movement.
Concerns: none for this tree. No missing prerequisites; no conflicting RB_CLEAR_NODE conversion.
Verification:
- [Phase 1] Tags: author/reviewer/maintainer SOBs only; no Fixes/Reported-by/Cc: stable
- [Phase 2] Diff: __ceph_remove_cap() in fs/ceph/caps.c, +10/-7, move ci/session/cl/inode after if (!ci)
- [Phase 3] git blame fs/ceph/caps.c 1142–1160: guard from e5cafce3ad0f8 (v5.11); bad inits from 38d46409c4639 (v6.7-rc1)
- [Phase 3] git show e5cafce3ad0f8: original stable-bound NULL-ci fix moved mdsc after the check
- [Phase 3] git show 38d46409c4639: added cl = session->... and inode = &ci->netfs.inode before if (!ci)
- [Phase 3] git merge-base --is-ancestor 38d46409c4639 HEAD → yes; e5cafce3ad0f8 → yes; a354d7eaa1a5 → no
- [Phase 4] b4 dig -c a354d7eaa1a5: lore
https://patch.msgid.link/20260714-ceph-fix-remove-
[email protected]
- [Phase 4] b4 dig -a: v1 only
- [Phase 4] b4 dig -w: Dryomov/Markuze/Dubeyko/ceph-devel CC’d
- [Phase 4] mbox: Dubeyko Reviewed-by, no NAK
- [Phase 4] tracker.ceph.com/issues/43272: production NULL deref in __ceph_remove_cap from trim_caps_cb
- [Phase 5] Callers: wrapper ceph_remove_cap() (safe) and ceph_purge_inode_cap() (unsafe direct)
- [Phase 6] git describe HEAD: p-6.12-3-gc504cf0baa3d8; make kernelversion: 6.12.111; buggy prologue present at caps.c:1144–1155
- [Phase 6] Current function text matches the patch’s old hunk exactly
- [Phase 8] Failure mode: kernel oops on NULL session/ci, severity CRITICAL
- UNVERIFIED: lore.kernel.org/stable HTML search (Anubis); not used for the verdict
**YES**
fs/ceph/caps.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
fs/ceph/caps.c +10 -7
@@ -1141,18 +1141,21 @@ int ceph_is_any_caps(struct inode *inode)*/ void __ceph_remove_cap (struct ceph_cap *cap,bool queue_release) { -struct ceph_mds_session *session = cap->session; -struct ceph_client *cl = session->s_mdsc->fsc->client; -struct ceph_inode_info *ci = cap->ci; -struct inode *inode = &ci->netfs.inode; +struct ceph_mds_session *session; +struct ceph_client *cl; +struct ceph_inode_info *ci; +struct inode *inode;struct ceph_mds_client *mdsc;int removed =0 ;/* 'ci' being NULL means the remove have already occurred */ -if (!ci) { -doutc (cl,"inode is NULL\n" ); + ci = cap->ci; +if (!ci)return ; - } + + session = cap->session; + cl = session->s_mdsc->fsc->client; + inode = &ci->netfs.inode;lockdep_assert_held (&ci->i_ceph_lock);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 mfd: ipaq-micro: Fix out-of-bounds stack read in ipaq_micro_str
In reply to Sasha LevinFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit da3a98c941753255418616d249e5b40db0927c26 ]
ipaq_micro_str() decodes a UTF-16LE string into an ASCII string. It copies characters to a stack buffer retstr, but fails to null-terminate it. When kstrdup() is called on retstr, it can read past the buffer into uninitialized stack memory, potentially leaking stack contents.
Fix this by initializing retstr to zero.
---
LLM Generated explanations, may be completely bogus:
The local tree is **v7.3-rc4** (7.3.0-rc4). The bug is in ipaq_micro_str(): it copies UTF-16LE bytes into an uninitialized 256-byte stack buffer and then kstrdup()/strlen() can walk off the end of that buffer. That is a real out-of-bounds stack read and a kernel-stack leak into dmesg, introduced in 2014, with a one-line zero- init fix that applies here with no prerequisites.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: **[mfd / ipaq-micro] [Fix] out-of-bounds stack read in ipaq_micro_str**
- Subsystem prefix: mfd: ipaq-micro:
- Action verb: **Fix** (explicit bug-fix language)
- Claimed intent: stop ipaq_micro_str() from reading past a stack buffer
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- **Reported-by:** [email protected] (automated analysis bot, not syzbot, not a user crash report)
- **Assisted-by:** Antigravity:gemini-3.5-flash (LLM-assisted)
- **Signed-off-by:** Dmitry Torokhov (author)
- **Link:** https://patch.msgid.link/[email protected]
- **Signed-off-by:** Lee Jones (MFD maintainer)
- **No Fixes:** tag (expected for this review pipeline)
- **No Cc: [email protected]** (expected; not treated as a negative)
- **No Tested-by / Reviewed-by / Acked-by**
- No Sasha Levin SOB and no [Upstream commit ...] marker on the commit itself
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- **Bug:** ipaq_micro_str() decodes UTF-16LE into ASCII in stack buffer retstr and never NUL-terminates it.
- **Symptom/failure mode:** kstrdup(retstr) uses strlen(), which can read past retstr into uninitialized stack, **leaking stack contents**.
- **Version information:** none in the message.
- **Root cause (author):** missing terminator on a stack buffer before a C-string API.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: **Not a hidden fix.** Subject and body state an OOB read / stack leak. The one-line zero-init matches that claim.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- **File:** drivers/mfd/ipaq-micro.c — 1 insertion, 1 deletion
- **Function:** ipaq_micro_str()
- **Scope:** single-file, single-line surgical fix
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- **Before:** char retstr[256]; is uninitialized. Loop writes len/2 ASCII bytes at retstr[0 .. len/2-1] and never writes a terminator. kstrdup(retstr) calls strlen() (verified in mm/util.c).
- **After:** char retstr[256] = { 0 }; zero-fills the buffer, so the first unused byte is NUL and kstrdup stays inside the array.
- **Path:** __init probe dump only (ipaq_micro_eeprom_dump() → ipaq_micro_str()), not a hot path.
Step 2.3: IDENTIFY THE BUG MECHANISM
Record:
- **Categories:** uninitialized data **and** out-of-bounds stack read; possible kernel-stack leak to dmesg.
- **Mechanism:** C-string API on a non-terminated stack buffer. Callers pass len of 10/40/20/10, so 5–20 bytes are written and 236–251 bytes stay uninitialized. If those leftover bytes contain no NUL, strlen() reads **past** the 256-byte array.
- **Fix:** full zero-init; len is u8 so len/2 <= 127, always room for a terminator.
Step 2.4: ASSESS THE FIX QUALITY
Record:
- **Quality:** obviously correct. Equivalent to retstr[i] = '\0' after the loop; zero-init is simpler and covers every len.
- **Regression risk:** very low. Only this helper; no locking, APIs, or control-flow change. Extra zeros cannot make a well-formed EEPROM string worse; they only stop the over-read.
- **Red flags:** none (1 line, one driver, no public API).
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record:
- **Buggy function introduced by:** dcc21cc09e3c22 — “mfd: Add driver for Atmel Microcontroller on iPaq h3xxx” (Linus Walleij, 2014-04-03; merged 2014-06-03).
- **First appeared:** v3.16-rc1 (git describe --contains dcc21cc09e3c22 → v3.16-rc1~82^2~6^2~20).
- The char retstr[256]; / kstrdup pattern was unchanged from introduction until this fix.
Step 3.2: FOLLOW THE FIXES: TAG
Record: **No Fixes: tag.** Introducer identified by blame:dcc21cc09e3c22, present in this tree (git merge-base --is-ancestor not needed for HEAD history; the file and function are here).
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record:
- Recent file commits are style/helpers (str_enable_disable, %*ph, missing break, etc.), not a competing terminator fix.
- **Standalone**, not patch X/Y. No follow-up on this helper after da3a98c941753.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record:
- Author **Dmitry Torokhov** is a long-time input/MFD contributor, not the iPAQ driver original author.
- Nearby MFD work is unrelated (rohm, ucb1x00, mt6397). This looks like a bot-found one-off, not a series.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record:
- **No dependencies.** Changes only char retstr[256]; → = { 0 }. Pre-fix function in this tree’s parent of the fix is identical to the candidate hunk. **Applies standalone.**
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- **b4 dig -c da3a98c941753:** https://patch.msgid.link/aintJF4X5tWDW-
[email protected]
- **b4 dig -a:** single **v1** only (2026-06-10); no v2/v3.
- Thread (saved via b4 dig -m): Dmitry’s patch + Lee Jones “Applied, thanks!” (2026-06-18). **No NAK, no stable nomination, no risk discussion.**
- lore.kernel.org WebFetch returned **403**; discussion recovered from the mbox instead.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record: **b4 dig -w** original recipients: Dmitry Torokhov, **Lee Jones** ([email protected], MFD maintainer), linux- [email protected]. Maintainer applied it. No other review mail in the thread.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: Reporter is **sashiko-bot**, not syzbot. No bugzilla/syzkaller link. No user “I hit this on hardware” report found in the thread. Severity from the author: stack OOB + possible stack leak.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: **Standalone v1.** Not part of a multi-patch series.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: **UNVERIFIED** for lore.kernel.org/stable (HTTP 403). No stable discussion in the captured mbox.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: **ipaq_micro_str()** only.
Step 5.2: TRACE CALLERS
Record: (semcode unavailable; git grep / file read)
- Only caller: ipaq_micro_eeprom_dump() with (dump, 10), (dump+10, 40), (dump+50, 20), (dump+70, 10).
- That dump is __init and is called from **micro_probe()** after MFD cells are added.
- Results go to dev_info() and, for the serial-number string, add_device_randomness().
Step 5.3: TRACE CALLEES
Record: loop assignment; **kstrdup()** → strlen() + kmalloc + memcpy (mm/util.c). That is what turns missing NUL into an over-read and a heap copy of whatever strlen walked.
Step 5.4: FOLLOW THE CALL CHAIN
Record:
- builtin_platform_driver_probe(..., micro_probe) → ipaq_micro_eeprom_dump → ipaq_micro_str.
- **Reachable only when this platform device probes**, i.e. Compaq iPAQ h3xxx with CONFIG_MFD_IPAQ_MICRO / SA1100_H3600.
- Not a syscall-reachable path for unprivileged users on generic hardware. Requires that board.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: No other ipaq_micro_str-style helper in-tree. Sibling iPAQ drivers (keys/ts/battery) do not duplicate this decoder.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record:
- **Yes.** File and helper exist. Pre-fix form (char retstr[256]; + kstrdup) is in this lineage from dcc21cc09e3c22 (v3.16) through the parent of da3a98c941753.
- Current HEAD already contains the zero-init line (commit is an ancestor of HEAD). That is **not** used as “already selected for stable”; it only confirms the surrounding code is the same.
- Local version: **7.3.0-rc4** / v7.3-rc4-27-gf0100363d8c37.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: **Clean apply.** Hunk context (ipaq_micro_eeprom_read / ipaq_micro_str / loop / kstrdup) is unchanged besides this one initializer. No refactor of this function in this tree.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: No earlier alternate terminator fix. 3d1c3272a8095 is an unrelated missing-break change.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY Record:
- **Subsystem:** MFD driver drivers/mfd/ipaq-micro.c (Compaq iPAQ Atmel companion).
- **Criticality: PERIPHERAL.** MFD_IPAQ_MICRO depends on SA1100_H3600 (StrongARM iPAQ H3100/H3600/H3700). SA1100_H3600 is still a real board option (not UNUSED_BOARD_FILES, unlike several other sa1100 boards).
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: **Mature / low churn.** Driver added 2014; later commits are small cleanups. Bug is long-standing, not a new-subsystem issue.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: **Platform-specific / config-specific** — only kernels built for Compaq iPAQ H3xxx (SA1100_H3600 selects MFD_IPAQ_MICRO). Not universal, not enterprise-default hardware.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record:
- **Trigger:** once per boot, in __init micro_probe(), when the microcontroller EEPROM is dumped.
- **How common:** every probe on that hardware; never on other machines.
- **Unprivileged userspace:** cannot trigger this without the device (not a syzbot-style syscall bug). If dmesg is readable, leaked stack bytes in dev_info lines are the exposure.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record:
- **Failure mode:** strlen/kstrdup over-read of stack; copy of extra stack bytes into a heap string; print via dev_info (kernel log info leak); oversized add_device_randomness() on the serial path. Possible large kmalloc if no NUL is found soon; crash only if the scan hits an unmapped guard (possible, not demonstrated).
- **Severity: HIGH** for memory safety / info leak on that platform; **LOW population**. Not a guaranteed panic on every boot.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- **Benefit:** stops a real OOB stack read and stack leak for every iPAQ micro probe. Code has been wrong since v3.16.
- **Risk:** very low (one initializer, no behavior change for terminated strings).
- **Ratio:** benefit modest in user count, risk near zero. For a 1-line memory-safety fix that is obviously correct, that still favors inclusion.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
**FOR backporting to this tree:**
- Real bug: missing NUL + kstrdup/strlen → OOB stack read; leftover- buffer chance of no NUL is high (~35–40% if leftover bytes are random), so this is not a purely theoretical race.
- Failure includes kernel-stack contents in dmesg (info leak) and a possibly oversized allocation.
- One-line, obviously correct, no new API/feature.
- Present in this tree’s code since v3.16; no missing prerequisites.
- MFD maintainer Lee Jones applied v1 with no objections.
- Matches stable patterns: uninitialized data, OOB, small surgical fix.
**AGAINST:**
- Extremely niche 2000-era PDA; not a core/enterprise path.
- Probe/__init only; not a hot-path leak or a syscall UAF.
- Reporter is sashiko-bot + LLM assist, not a hardware user or syzbot repro.
- No Cc: stable in review (not a negative per pipeline rules).
**UNRESOLVED:**
- Could not query lore.kernel.org/stable (403).
- No runtime crash log; analysis is from code + commit text.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? **PASS** — zero-init makes kstrdup well-defined; maintainer applied it. (No extra Tested-by; correctness is visible from the code.)
2. Fixes a real bug that affects users? **PASS** — OOB read + stack leak on this driver’s probe path. Affected users are iPAQ H3xxx owners only, but the bug is real.
3. Important issue? **PASS** — out-of-bounds stack read and kernel-stack leak, not a style cleanup. Severity HIGH on that platform, not a core panic.
4. Small and contained? **PASS** — 1 line, one static helper.
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — same function, same callers, no refactor required.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: **None** (not a device ID, quirk, DT, build, or docs exception). It qualifies as a normal small memory-safety bug fix.
Step 9.4: MAKE YOUR DECISION
This tree contains the buggy helper and can take the one-line terminator fix with essentially no regression risk. Niche hardware lowers the user count; it does not make an OOB stack read + log leak ineligible. The patch meets the stable-rule checklist for **this** 7.3-rc4 tree.
===============================================================
What the commit solves for this tree
===============================================================ipaq_micro_str() fills a 256-byte stack buffer and then treats it as a C string. Without a terminator, kstrdup() → strlen() can read off the end of retstr and copy leftover stack into a heap string that is printed (dev_info) and, for the serial number, passed to add_device_randomness(). Zero-initializing retstr terminates the string inside the array. That is the whole fix.
Risk vs benefit: benefit is limited to Compaq iPAQ H3xxx probe, but the defect is a genuine memory-safety / info-leak bug present since v3.16. Risk of the change is negligible. No series, no extra commits, no backport rework.
===============================================================
Verification
===============================================================
- [Phase 1] Parsed tags: Reported-by sashiko-bot; Assisted-by LLM; SOB Dmitry Torokhov + Lee Jones; Link patch.msgid.link/aintJF4X5tWDW- [email protected]; no Fixes/Cc-stable
- [Phase 2] Diff: 1 line in ipaq_micro_str(): char retstr[256] → = { 0 }
- [Phase 2] kstrdup in mm/util.c uses strlen(s)+1 then memcpy — confirms OOB if unterminated
- [Phase 2] Callers in ipaq_micro_eeprom_dump pass len 10/40/20/10; len is u8 so len/2 <= 127
- [Phase 3] git blame: function from dcc21cc09e3c22 (2014); initializer from da3a98c941753
- [Phase 3] git describe --contains dcc21cc09e3c22 → v3.16-rc1; bug long predates this tree
- [Phase 3] git log -15 --author=Dmitry Torokhov -- drivers/mfd/: this commit is an isolated ipaq-micro change
- [Phase 3] No related follow-up on ipaq_micro_str
- [Phase 4] b4 dig -c da3a98c941753: lore URL found; -a only v1; -w Lee Jones + lkml; -m thread is patch + “Applied, thanks!”
- [Phase 4] WebFetch lore/all and lore/stable: **403** — UNVERIFIED via HTTP
- [Phase 5] grep: only ipaq_micro_eeprom_dump / micro_probe call this helper; __init probe path
- [Phase 6] git describe HEAD / make kernelversion: **v7.3-rc4 / 7.3.0-rc4**
- [Phase 6] git merge-base --is-ancestor da3a98c941753 HEAD: yes (commit is in this checkout; not used as circular “already selected”)
- [Phase 6] Pre-fix snippet from da3a98c941753^ matches the candidate diff exactly
- [Phase 7] Kconfig: MFD_IPAQ_MICRO depends on SA1100_H3600; H3600 not under UNUSED_BOARD_FILES
- [Phase 8] Failure mode: stack OOB + dmesg leak on iPAQ probe, severity HIGH on that platform
- UNVERIFIED: whether anyone discussed this on stable@; whether strlen walking off-stack actually hits a guard page on SA1100
The fix is small, surgical, and meets the stable criteria for this tree.
**YES**
drivers/mfd/ipaq-micro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/ipaq-micro.c +1 -1
@@ -221,7 +221,7 @@ static void ipaq_micro_eeprom_read(struct ipaq_micro *micro,static char *ipaq_micro_str (u8 *wchar,u8 len) { -char retstr[256 ]; +char retstr[256 ] = {0 };u8 i;for (i =0 ; i < len /2 ; i++)
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH AUTOSEL 6.18-5.10] mfd: ipaq-micro: Fix out-of-bounds stack read in ipaq_micro_str
Sashiko has reviewed this patch and found no issues.
Quoted 10 lines
From: Dmitry Torokhov <[email protected]>
[ Upstream commit
da3a98c941753255418616d249e5b40db0927c26]
ipaq_micro_str()decodes a UTF-16LE string into an ASCII string. It copies characters to a stack buffer retstr, but fails to null-terminate it. Whenkstrdup()is called on retstr, it can read past the buffer into uninitialized stack memory, potentially leaking stack contents.
Quoted 8 lines
Fix this by initializing retstr to zero.
Reported-by [email protected]Assisted-by Antigravity:gemini-3.5-flashSigned-off-by Dmitry Torokhov <[email protected]>Signed-off-by Lee Jones <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Sasha Levin
maintainerPATCH 1/1 wifi: mt76: wed: fix kernel panic on non-DBDC MT7986
In reply to Sasha LevinFrom: Zhi-Jun You <[email protected]>
[ Upstream commit 8a177dabeeead47dda4d4f91331282790eed0097 ]
In mt76_wed_init_rx_buf, it's hardcoded to use MT_RXQ_MAIN. But for non-DBDC MT7986 MT_RXQ_BAND1 is used for RX data queue which leads to kernel panic when attaching WED.
Use the correct RX queue by checking WED version and band_idx.
v2 and band 1 -> MT_RXQ_BAND1
Others -> MT_RXQ_MAIN
Kernel panic: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000
Mem abort info:
ESR = 0x0000000096000005
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x05: level 1 translation fault
Data abort info:
ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
Internal error: Oops: 0000000096000005 [#1] SMP CPU: 1 UID: 0 PID: 925 Comm: kmodloader Tainted: G O 6.18.26 #0 NONE Tainted: [O]=OOT_MODULE Hardware name: Acer Connect Vero W6m (DT) pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : page_pool_alloc_frag_netmem+0x1c/0x1bc lr : page_pool_alloc_frag+0xc/0x34
sp : ffffffc081dab660
x29: ffffffc081dab660 x28: ffffffc081dabc60 x27: ffffff80091af040
x26: 0000008000000000 x25: ffffff80091a8898 x24: ffffff80091a5440
x23: 0000000000001000 x22: 0000000140000000 x21: ffffff80091a2040
x20: ffffff8003f1d780 x19: 0000000000000000 x18: 0000000000000020
x17: ffffffbfbf0ac000 x16: ffffffc080ee0000 x15: ffffff80049d47ca
x14: 000000000000037b x13: 000000000000037b x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : ffffff8003f1d7c0 x7 : 0000000000000000 x6 : ffffff8003f1d780 x5 : 0000000000000680 x4 : 0000000000000000 x3 : 0000000000002824 x2 : 0000000000000000 x1 : ffffffc081dab71c x0 : 0000000000000000
Call trace: page_pool_alloc_frag_netmem+0x1c/0x1bc (P) page_pool_alloc_frag+0xc/0x34 mt76_wed_init_rx_buf+0xf8/0x2ac [mt76] mtk_wed_start+0x79c/0x12ac mt7915_dma_start+0x274/0x63c [mt7915e] mt7915_dma_start+0x5b4/0x63c [mt7915e] mt7915_dma_init+0x49c/0x81c [mt7915e] mt7915_register_device+0x24c/0x530 [mt7915e] mt7915_mmio_probe+0x91c/0x1980 [mt7915e] platform_probe+0x58/0xa0 really_probe+0xb8/0x2a8 __driver_probe_device+0x74/0x118 driver_probe_device+0x3c/0xe0 __driver_attach+0x88/0x154 bus_for_each_dev+0x60/0xb0 driver_attach+0x20/0x28 bus_add_driver+0xdc/0x200 driver_register+0x64/0x118 __platform_driver_register+0x20/0x30 init_module+0x74/0x1000 [mt7915e] do_one_initcall+0x4c/0x1f8 do_init_module+0x50/0x210 load_module+0x15f8/0x1b10 __do_sys_init_module+0x1a8/0x260 __arm64_sys_init_module+0x18/0x20 invoke_syscall.constprop.0+0x4c/0xd0 do_el0_svc+0x3c/0xd0 el0_svc+0x18/0x60 el0t_64_sync_handler+0x98/0xdc el0t_64_sync+0x158/0x15c Code: aa0003f3 a9025bf5 a90363f7 d2820017 (b9400000)
---
LLM Generated explanations, may be completely bogus:
This tree is **6.6.157** (pending-6.6). The panic is real here, but the mainline patch has to be rewritten onto mt7915/mmio.c because wed.c does not exist yet.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
Record: [wifi: mt76: wed:] [fix] [kernel panic on non-DBDC MT7986 when attaching WED because RX buf init used the wrong queue]
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- Signed-off-by: Zhi-Jun You <[email protected]> (author)
- `Link:
https://patch.msgid.link/[email protected]` (v2 1/2 of a 2-patch series)
- Signed-off-by: Felix Fietkau <[email protected]> (mt76 maintainer)
- No Fixes: tag (expected for this review)
- No Cc: [email protected] (expected)
- No Reported-by: / Tested-by: / Reviewed-by: / Acked-by:
- Sibling patch 2/2 has the same msgid stem 20260715152113.553-2 and **is already in this 6.6 tree** as 8eae5e5aa09da (`wifi: mt76:
mt7915: fix net_fill_forward_path for non-DBDC mt7986`)
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- **Bug:** mt76_wed_init_rx_buf always uses MT_RXQ_MAIN. Non-DBDC MT7986 uses MT_RXQ_BAND1 for the RX data queue.
- **Symptom:** NULL deref oops while attaching WED, in page_pool_alloc_frag_netmem. Full oops from **Acer Connect Vero W6m**, kernel 6.18.26, PID kmodloader during mt7915e probe.
- **Root cause:** wrong RX queue → uninitialized page_pool (NULL) → fault at page_pool_alloc_frag*.
- **Fix:** wed->version == 2 && dev->phy.band_idx → MT_RXQ_BAND1, else MT_RXQ_MAIN.
- Crash taint includes O (OOT module), but the call trace is in-tree mt76 / mt7915e / mtk_wed_start.
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: Not hidden. Explicit panic fix with a stack trace. Not cleanup/refactor.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
Record:
- File: drivers/net/wireless/mediatek/mt76/wed.c (+6 / −1)
- Function: mt76_wed_init_rx_buf
- Scope: single-file, surgical (~5 lines of logic)
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record:
- **Before:** q = &dev->q_rx[MT_RXQ_MAIN] always, then mt76_get_page_pool_buf(q, ...).
- **After:** pick MT_RXQ_BAND1 for WED v2 + band 1; otherwise MT_RXQ_MAIN.
- Path: WED RX buffer init during mtk_wed_start from mt7915_dma_start (probe / DMA start), not a rare error path.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record:
- Category: **NULL pointer dereference** (memory safety) from **wrong- queue logic**.
- Mechanism: for non-DBDC MT7986, mt7915_band_config sets band_idx = 1 and DMA only allocates q_rx[MT_RXQ_BAND1]. MT_RXQ_MAIN is left with page_pool == NULL. mt76_get_page_pool_buf → page_pool_dev_alloc_frag(NULL) → oops.
**Step 2.4: ASSESS THE FIX QUALITY**
Record:
- Obviously correct given DMA queue allocation in mt7915/dma.c.
- Minimal; no API/locking/refcount changes.
- Regression risk low: DBDC and band-0 devices still use MT_RXQ_MAIN.
- Backport caveat: in 6.6 the same logic lives in mt7915_mmio_wed_init_rx_buf (dev is struct mt7915_dev *), so the condition must use dev->mt76.phy.band_idx (or dev->phy.mt76->band_idx), not dev->phy.band_idx.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Record:
- Hardcoded MT_RXQ_MAIN in 6.6: mt7915/mmio.c:635, from 2f5c3c77fc9b6 (wifi: mt76: switch to page_pool allocator, 2023-02-03). Present in this tree.
- WED RX itself: 4f831d18d12da (wifi: mt76: mt7915: enable WED RX support, 2022-12-01). Present.
- MT7986 one-A-die band_idx = 1: mt7915_band_config in init.c. Present.
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. Bug is the hardcoded MAIN queue vs MT7986 band-1 mapping, present since WED RX + page_pool.
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record:
- wed.c added later by 8a7386e787ef4 (wifi: mt76: move wed common utilities in wed.c, 2024-02-22). **Not in pending-6.6** (git merge- base --is-ancestor → not ancestor).
- Related 6.6 history: WED enable for MT7986, WED RX, page_pool switch, several WED robustness fixes.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record:
- Author is not the mt76 maintainer; maintainer Felix Fietkau signed off.
- Same author, same series date: 8eae5e5aa09da already on pending-6.6 (patch 2/2).
- Felix has many mt7915/WED fixes on this branch.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS** Record:
- Standalone logic; does **not** need the wed.c move.
- Needed in 6.6: wed->version (exists, u8 version in mtk_wed_device), phy.band_idx, MT_RXQ_BAND1, page_pool RX — all present.
- Series 1/2; 2/2 is independent (forward-path queue) and already applied.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- b4 dig on sibling 8eae5e5aa09da matched msgid 20260715152113.553-*.
- RFC (2026-06-13): “single band MT7986”
- v1 (2026-06-30):
https://patch.msgid.link/[email protected] (and 1629-2)
- v2 (2026-07-15, applied):
https://patch.msgid.link/[email protected]
- v2 1/2 is the committed version. Change vs RFC: “single band” → “non- DBDC”.
- lore.kernel.org fetches returned 403; thread text confirmed via ratatoskr mirrors.
- No NAK found. Merged by Felix Fietkau (2026-07-31) as 8a177dabeeead.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record (b4 dig -w on sibling): Zhi-Jun You; Felix Fietkau ([email protected]); Lorenzo Bianconi; Ryder Lee / Shayne Chen / Sean Wang (MediaTek); linux-wireless; linux-mediatek; Benjamin Larsson (Suggested-by on 2/2). Maintainer merged it.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No syzbot/bugzilla. Concrete oops from Acer Connect Vero W6m (MT7986). Real hardware, probe-time crash with WED.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: 2-patch v2 series. 1/2 = this panic. 2/2 = net_fill_forward_path wrong WDMA queue; already in 6.6. Independent; 1/2 is the crash fix.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: lore.kernel.org/stable returned 403. **UNVERIFIED** whether anyone mailed stable@. 2/2 of the same series is already in this 6.6 tree, so the series is treated as 6.6-relevant.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF**
Record: Mainline mt76_wed_init_rx_buf. In this tree:mt7915_mmio_wed_init_rx_buf.
**Step 5.2: TRACE CALLERS**
Record:
- Assigned as wed->wlan.init_rx_buf in mt7915_mmio_wed_init.
- Called from mtk_wed_rx_buffer_alloc → dev->wlan.init_rx_buf(dev, dev->wlan.rx_npkt) (mtk_wed.c).
- That runs from mtk_wed_start ← mt7915_dma_start ← mt7915_dma_init ← mt7915_register_device ← probe.
- Reachable on device probe when WED is attached (wed_enable module param).
**Step 5.3: TRACE CALLEES**
Record: mt76_get_rxwi, mt76_get_page_pool_buf → page_pool_dev_alloc_frag(q->page_pool), mt76_rx_token_consume. First page_pool alloc is the crash site.
**Step 5.4: FOLLOW THE CALL CHAIN**
Record:
``` module load mt7915e → mt7915_mmio_probe / register_device → mt7915_dma_init → mt7915_dma_start → mtk_wed_device_start → mtk_wed_rx_buffer_alloc → mt7915_mmio_wed_init_rx_buf → mt76_get_page_pool_buf(uninitialized MT_RXQ_MAIN) → oops ```
Userspace-reachable via loading the driver (typically root). Not a syscall fuzz path; it is a boot/probe crash on affected hardware.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: mt7915/testmode.c already uses q = phy->mt76->band_idx ? MT_RXQ_BAND1 : MT_RXQ_MAIN. DMA init uses the same band_idx split. Same author’s 2/2 fixes the matching forward-path mistake.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record: **Yes.** Tree is 6.6.157 (pending-6.6). wed.c is absent. Equivalent bug:
```
mt7915_mmio_wed_init_rx_buf:
q = &dev->mt76.q_rx[MT_RXQ_MAIN]; /* mmio.c:635 */
```mt7915_dma.c: allocate MT_RXQ_MAIN only if !dev->phy.mt76->band_idx; allocate MT_RXQ_BAND1 if dbdc_support || band_idx. mt7915_band_config sets band_idx = 1 for MT7986 one-A-die (non-DBDC). Introduced with WED RX + page_pool (2022–2023), well before 6.6.
git merge-base --is-ancestor 8a177dabeeead pending-6.6 → **not present**.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: **Needs a small backport**, not a clean apply. Same if/else in mt7915/mmio.c, with dev->mt76.phy.band_idx / dev->phy.mt76->band_idx. wed->version exists and is set to 2 for non-netsys-v1 (MT7986) in mtk_wed.c. Minor conflict, not a rewrite.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: No equivalent RX-buf queue selection. 2/2 (8eae5e5aa09da) is here and addresses the same hardware mapping, not this NULL deref.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: drivers/net/wireless/mediatek/mt76 + MediaTek WED. **IMPORTANT** (common Filogic/MT7986 WiFi, OpenWrt/embedded), not core mm/VFS.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Mature and actively fixed on 6.6 (WED null-ptr, register mapping, MT7981, chainmask for non-DBDC band 1).
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: Driver-specific: MT7986 (and similar mt798x) **non-DBDC** (single A-die) with CONFIG_NET_MEDIATEK_SOC_WED and wed_enable. Real
product: Acer Connect Vero W6m. Default wed_enable is false, but WED is used on these SoCs.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: Every probe with WED attached on that SKU. Not a race. Needs privilege to load the module; typical as a platform driver at boot.
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: Kernel oops/panic on WiFi/WED attach. **CRITICAL** for those devices (WiFi unusable; can panic the box).
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- **Benefit:** high for MT7986 non-DBDC + WED (prevents probe oops).
- **Risk:** low (5-line queue index; other SKUs unchanged).
- **Ratio:** benefit ≫ risk. Backport must retarget mmio.c.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Documented oops: NULL page_pool in WED RX init.
- Same bug in this tree (mt7915_mmio_wed_init_rx_buf + DMA not allocating MAIN when band_idx == 1).
- Small, obviously correct queue selection.
- mt76 maintainer signed off; RFC → v1 → v2.
- Sibling 2/2 already on 6.6.
- MT7986 + WED RX + page_pool all exist here.
- wed->version and band_idx exist.
AGAINST:
- Patch file wed.c is not in 6.6 (moved in 6.8-era 8a7386e787ef4).
- Needs a few-line context backport.
- WED off by default; subset of MT7986 boards.
- Crash log tainted OOT; still in-tree frames.
UNRESOLVED:
- Stable ML discussion (lore/stable 403).
- Whether every reviewer asked for Cc: stable (not seen on v2 1/2).
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — matches DMA allocation; maintainer merged; oops on real HW.
2. Fixes a real bug that affects users? **PASS** — probe oops on non- DBDC MT7986 + WED.
3. Important issue? **PASS** — kernel oops, severity CRITICAL for that hardware.
4. Small and contained? **PASS** — ~5 lines, one function.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** with a backport to mt7915/mmio.c (stable rule: apply cleanly **or come with a backport**). Not a missing-feature case.
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: None (not a device ID/quirk/DT/build/doc). Ordinary crash fix.
**Step 9.4: MAKE YOUR DECISION**
The 6.6 tree has the same panic path under a pre-wed.c name. Selecting this for 6.6 is justified; apply the same version == 2 && band_idx check in mt7915_mmio_wed_init_rx_buf.
---
**What the commit solves for this tree:** On non-DBDC MT7986, the main phy is band 1, so only MT_RXQ_BAND1 is allocated. WED RX init still pulls from MT_RXQ_MAIN, whose page_pool is NULL, and the kernel oopses in page_pool_alloc_frag during mt7915e probe. That mapping is already in 6.6 init.c/dma.c; only the RX-buf picker is wrong.
**Stable rules:** Real, important crash; tiny logic fix; no new API. File path changed after 6.6, so it needs a short backport, not a NAK.
**Risk vs benefit:** Low risk, high benefit on Filogic devices that enable WED (including the reported Acer Vero W6m class).
**Concerns:** Must edit drivers/net/wireless/mediatek/mt76/mt7915/mmio.c and use dev->mt76.phy.band_idx (or dev->phy.mt76->band_idx) because dev is struct mt7915_dev * here. Do not require 8a7386e787ef4.
Verification:
- [Phase 1] Subject/tags: fix panic; SOB Zhi-Jun You + Felix Fietkau; Link 20260715152113.553-1; no Fixes/Cc-stable
- [Phase 1] Series: v2 1/2; 2/2 already 8eae5e5aa09da on pending-6.6
- [Phase 2] Diff: 6 insertions in mt76_wed_init_rx_buf; queue MAIN vs BAND1
- [Phase 3] Blame on 6.6: q = &dev->mt76.q_rx[MT_RXQ_MAIN] from 2f5c3c77fc9b6 (page_pool); present
- [Phase 3] 8a7386e787ef4 (wed.c split) **not** ancestor of pending-6.6
- [Phase 3] Fix 8a177dabeeead **not** ancestor of pending-6.6
- [Phase 4] b4 dig: RFC → v1 → v2; applied v2; Felix merged 2026-07-31
- [Phase 4] Recipients: mt76 maintainers + linux-wireless/mediatek
- [Phase 4] UNVERIFIED: lore.kernel.org and lore.kernel.org/stable HTTP 403; used ratatoskr mirrors
- [Phase 5] Caller: mtk_wed_rx_buffer_alloc → wlan.init_rx_buf from mtk_wed_start / probe
- [Phase 6] git show pending-6.6:Makefile: VERSION 6 / PATCHLEVEL 6 / SUBLEVEL 157
- [Phase 6] git cat-file pending-6.6 wed.c: path does not exist
- [Phase 6] pending-6.6 mmio.c:635: hardcoded MT_RXQ_MAIN; init.c sets band_idx = 1 for one-A-die MT7986
- [Phase 6] DMA: MAIN allocated only if !band_idx; BAND1 if dbdc_support || band_idx
- [Phase 6] wed->version exists; set to 2 for MT7986-class WED
- [Phase 8] Failure: NULL page_pool deref → oops; CRITICAL for that SKU+WED
- UNVERIFIED: whether an out-of-tree module contributed besides in-tree frames (taint O)
**YES**
drivers/net/wireless/mediatek/mt76/wed.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/mediatek/mt76/wed.c +6 -1
@@ -33,10 +33,15 @@ u32 mt76_wed_init_rx_buf(struct mtk_wed_device *wed, int size) {struct mtk_wed_bm_desc *desc = wed->rx_buf_ring.desc;struct mt76_dev *dev =mt76_wed_to_dev (wed); -struct mt76_queue *q = &dev->q_rx[MT_RXQ_MAIN ];struct mt76_txwi_cache *t =NULL ; +struct mt76_queue *q;int i; +if (wed->version ==2 && dev->phy.band_idx) + q = &dev->q_rx[MT_RXQ_BAND1 ]; +else + q = &dev->q_rx[MT_RXQ_MAIN ]; +for (i =0 ; i < size; i++) {dma_addr_t addr;u32 offset;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 misc: hpilo: validate device queue entries before use
In reply to Sasha LevinFrom: Yousef Alhouseen <[email protected]>
[ Upstream commit 7bf6940d7cf41f1f0330a9bae4b7a886e18fd8e3 ]
ilo_pkt_dequeue() trusts descriptor IDs and lengths read from the shared FIFO entry. A bad entry can select a descriptor outside the allocated queue memory or report a packet length larger than one descriptor.
Reject entries whose descriptor index or packet length exceeds the queue layout before deriving the packet pointer returned to read and write paths.
---
LLM Generated explanations, may be completely bogus:
The local checkout is mainline **v7.3-rc4**. The hpilo driver has been here since 2008, and this is a small bounds check on device-shared FIFO fields used as a pointer and a copy length.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
Record: **[misc: hpilo:] [validate] [reject out-of-range device FIFO descriptor IDs and packet lengths before use]**
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- Signed-off-by: Yousef Alhouseen \<[email protected]\> (author)
- Link: https://patch.msgid.link/20260624190919.3432-1-
[email protected]
- Signed-off-by: Greg Kroah-Hartman \<[email protected]\> (misc maintainer; applied the patch)
- No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked-by:, or Cc:
stable (absence of Fixes/Cc:stable is expected for this review)
- Pipeline markers (Sasha Levin SOB / Upstream commit) are not treated as selection evidence
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- Bug: ilo_pkt_dequeue() uses descriptor ID and length from a FIFO shared with the HP iLO device with no bounds check.
- Symptom/failure mode: a bad ID indexes a descriptor outside the allocated queue; a bad length is larger than one descriptor. Those values feed ilo_read()/ilo_write() copy_to_user/copy_from_user.
- Version info: none in the message. The unvalidated path is from the original 2008 driver.
- Root cause (author): device-provided FIFO fields are trusted; the fix rejects ID ≥ NR_QENTRY or length > one descriptor before forming the packet pointer.
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: Not a disguised cleanup. It is an explicit missing-validation / OOB fix.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
Record:
- File: drivers/misc/hpilo.c (+6 / −1)
- Function: ilo_pkt_dequeue()
- Scope: single-file surgical fix
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record: After a successful fifo_dequeue(), the old code took pkt_id = get_entry_id(entry) and used it as desc + desc_mem_sz(pkt_id), and passed get_entry_len(entry) out as *len. The new code stores the length, returns 0 (dequeue failed) if pkt_id >= NR_QENTRY or `pkt_len
Quoted 1 line
desc_mem_sz(1), and only then fills*id/*len/*pkt`. Normal path
for in-range entries is unchanged.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record: **Memory safety / OOB (category d)** plus **logic correctness (category g)**.
- get_entry_id() is a 12-bit field (0–4095). NR_QENTRY is 4. desc_mem_sz(id) is id << 12, so an ID of 5 already walks off the 4×4KiB descriptor array; 4095 is a ~16MiB miss.
- get_entry_len() is a 10-bit qword count shifted by 3, so up to 8184 bytes. One descriptor is 4096 bytes (L2_QENTRY_SZ 12). Recv descriptors sit at the end of the DMA allocation; a length of 8184 on the last slot reads/writes past dma_size.
- Callers: ilo_read() does copy_to_user(buf, pkt, min(len, pkt_len)); ilo_write() does copy_from_user(pkt, buf, min(len, pkt_len)). That is a host kernel OOB read or write, not just a bad error code.
**Step 2.4: ASSESS THE FIX QUALITY**
Record: The checks match the layout from ilo_ccb_setup() (NR_QENTRY descriptors of desc_mem_sz(1)). Open-time recv enqueue uses desc_mem_sz(1) exactly, and > (not >=) still allows a full 4096-byte packet. Zero-length send packets used at open still pass. Regression risk on working firmware is low: in-range entries are unchanged. One caveat: fifo_dequeue() already advanced the head, so a rejected entry is dropped and not re-queued; that can shrink the 4-slot queue until close/reopen. That is acceptable fail-closed behavior, not a behavior change for valid hardware.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Record: Unvalidated dequeue is from **89bcb05d9bbf8** (“HP iLO driver”, David Altobelli, 2008-07-02). Present since v2.6.27-era. The validation lines are this commit.
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. Not applicable. The introducing commit is the original driver, which is an ancestor of this tree.
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record: Recent drivers/misc/hpilo.c work is device-number, class, DMA API, and blacklist changes. No prerequisite refactor of the FIFO. After this commit only a treewide *_device_id style change (f06bae4ddc70d). Standalone.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record: Author is not the hpilo maintainer (that is Keng-Yu Lin, HPE, MAINTAINERS “Supported”). Same-day misc validation patches include ibmvmc, xilinx_sdfec, bcm-vk, fastrpc — part of a large audit flood. That is a quality-process note, not a substitute for reading this diff. Greg Kroah-Hartman still applied this one.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
Record: Uses existing NR_QENTRY, desc_mem_sz(), get_entry_id(), get_entry_len(). No new helpers. Applies standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record: b4 dig -c 7bf6940d7cf41 →
https://patch.msgid.link/[email protected]
- b4 dig -a: single v1, no later revisions
- lore.kernel.org fetches returned 403; body confirmed via openwall and lkml.iu.edu mirrors
- LKML index for late June 2026 lists the submission and **no** “Re:” for this hpilo patch (no NAK, no Cc: stable suggestion, no review thread)
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record: b4 dig -w recipients: Keng-Yu Lin (hpilo maintainer), Arnd Bergmann, Greg Kroah-Hartman, linux-kernel. No Reviewed-by/Acked-by on the commit. Greg’s SOB is the apply-to-char-misc path.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No Reported-by, syzbot, bugzilla, or CVE in the commit or the submission. Issue is identified by code inspection of the shared FIFO.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: Standalone [PATCH], not n/m. Same-day author flood of similar bounds checks; this patch does not depend on those.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: UNVERIFIED for stable@ lore (HTTP 403). No evidence in the v1 mail that anyone nominated or rejected it for stable.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF**
Record: ilo_pkt_dequeue() only.
**Step 5.2: TRACE CALLERS**
Record (from drivers/misc/hpilo.c):
- ilo_ccb_verify() — open path, SENDQ, uses id only
- ilo_read() — read(2) on /dev/hpilo/dXccbN, RECVQ, uses id, len, pkt
- ilo_write() — write(2), SENDQ, uses id, len, pkt
**Step 5.3: TRACE CALLEES**
Record: fifo_dequeue() (consumes a C-bit entry under fifo_lock), get_entry_id(), get_entry_len(), desc_mem_sz().
**Step 5.4: FOLLOW THE CALL CHAIN**
Record: Userspace read/write on the char device → dequeue → copy. FIFO payload is written by iLO firmware in shared DMA memory, then marked consumed. An unprivileged process cannot poke FIFO fields directly; it needs the device node **and** a bad/malicious iLO entry. On ProLiant this driver is used by host management agents. Reachable in production, not a dead path.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: This is the only dequeue that turns FIFO id/len into a host pointer and copy size. No sibling copy of the same bug in this driver.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record: Yes. Tree is **v7.3-rc4** (7.3.0-rc4, HEAD f0100363d8c37). drivers/misc/hpilo.c/hpilo.h are present. CONFIG_HP_ILO exists. Unvalidated dequeue is from 89bcb05d9bbf8 (2008). git merge-base --is- ancestor 7bf6940d7cf41 HEAD is true — this checkout already contains the fix because it is mainline after the char-misc merge, not because the bug is absent.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: Expected apply: **clean**. ilo_pkt_dequeue() around the dequeue site matches the parent of 7bf6940d7cf41 aside from this hunk. No conflicting local churn.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: No earlier equivalent bounds check. This commit is the fix.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: **drivers/misc/hpilo** — HP iLO CHIF channel on ProLiant.
Criticality: **PERIPHERAL** for generic desktops, **IMPORTANT** for HP enterprise servers that use /dev/hpilo (common on LTS/distro kernels). Not mm/net/fs core.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Mature, low-churn driver (2008), still Supported by HPE. Bug is long-standing, not a brand-new API.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: **driver-specific / config-specific** (CONFIG_HP_ILO, PCI iLO). HP ProLiant hosts running management userspace.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: Dequeue of a FIFO entry whose id or length is out of layout. The device is expected to update recv length; a firmware length bug is the realistic trigger. Malicious/compromised BMC is the security trigger. Not a hot every-syscall path for machines without iLO. Unprivileged users cannot inject FIFO fields without the device and a bad iLO entry.
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: Kernel OOB read (copy_to_user in ilo_read) or OOB write (copy_from_user in ilo_write) → oops, info leak, or memory corruption. **Severity: HIGH** (crash/corruption; security-relevant if firmware is untrusted). Not a guaranteed unprivileged LPE by itself.
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- Benefit: **high for iLO users** — prevents host OOB from a bad FIFO entry on a long-lived production driver.
- Risk: **very low** — 6 lines, fail-closed, no API/lock/structure change; valid packets unaffected.
- Ratio: benefit outweighs risk.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Real missing bounds check on device-shared FIFO id/len used as pointer and copy length (verified in ilo_read/ilo_write).
- Failure mode is kernel OOB, not cosmetic.
- Driver and bug exist in this tree since 2008.
- 6-line, obviously correct check matching NR_QENTRY and desc_mem_sz(1).
- No prerequisites; clean apply.
- Greg KH applied it; HPE maintainer was on Cc.
- HP iLO is real hardware on enterprise stable kernels.
AGAINST:
- No user report, syzbot, or CVE.
- Author is not the subsystem maintainer; patch is from a large same-day “validate X” sweep.
- No mailing-list review comments found.
- Official stable text dislikes unexplained “this could be a problem” issues; trigger depends on firmware producing a bad entry.
- Rejected entries are consumed and not recycled (queue-slot leak until reopen) — only if the device already posted garbage.
UNRESOLVED:
- Full lore.kernel.org / stable@ thread fetch (403).
- Whether Keng-Yu Lin privately acked (no Acked-by on the commit).
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — layout math matches the allocator; Greg merged it. No extra Tested-by.
2. Fixes a real bug that affects users? **PASS** — unchecked device length/index on the read/write path. Not style.
3. Important issue (crash, security, corruption, deadlock)? **PASS** — OOB copy, oops/corruption; HIGH not a soft lockup.
4. Small and contained? **PASS** — +6/−1, one function.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** — same ilo_pkt_dequeue() structure; driver present.
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: None (not a device ID, quirk, DT, build, or doc-only change). Qualifies as a normal small memory-safety fix.
**Step 9.4: MAKE YOUR DECISION**
This tree has the hpilo char device and the long-standing unvalidated dequeue. The patch stops a bad device FIFO entry from becoming a kernel pointer/length for copy_{to,from}_user. That is a real, contained OOB fix with negligible regression risk on working iLO firmware. It meets the stable rules for this checkout.
Verification:
- [Phase 1] Tags: author SOB, Link msgid, Greg KH SOB; no Fixes/Reported-by/Cc:stable
- [Phase 2] Diff: +6/−1 in ilo_pkt_dequeue(); reject pkt_id >= 4 or pkt_len > 4096
- [Phase 2] Callers: ilo_read copy_to_user, ilo_write copy_from_user, ilo_ccb_verify
- [Phase 2] Bitfields: ID 12 bits (0–4095), len up to 8184, descriptor 4096, NR_QENTRY 4
- [Phase 3] git blame: buggy dequeue from 89bcb05d9bbf8 (2008)
- [Phase 3] git log -- drivers/misc/hpilo.c: no FIFO refactor prerequisite; no follow-up fix
- [Phase 3] Author also submitted ibmvmc/xilinx_sdfec/bcm-vk validation patches; not hpilo maintainer
- [Phase 4] b4 dig: v1 only, lore msgid 20260624190919.3432-1; To/Cc includes Keng-Yu Lin, Arnd, Greg
- [Phase 4] openwall + lkml.iu.edu: patch body matches commit; no public
Re: for hpilo
- [Phase 4] lore.kernel.org WebFetch: 403 — UNVERIFIED beyond mirrors
- [Phase 5] Call chain: userspace read/write on /dev/hpilo/dXccbN after device marks FIFO consumed
- [Phase 6] git describe HEAD: v7.3-rc4-27-gf0100363d8c37; kernelversion 7.3.0-rc4
- [Phase 6] merge-base --is-ancestor 7bf6940d7cf41 HEAD: yes (fix already on this mainline checkout)
- [Phase 6] Parent of fix: unvalidated ilo_pkt_dequeue() still in 7bf6940d7cf41^
- [Phase 7] MAINTAINERS: HEWLETT PACKARD ENTERPRISE ILO CHIF DRIVER, Keng-Yu Lin, Supported
- [Phase 8] Failure mode: OOB read/write → oops/corruption, HIGH; trigger is bad iLO FIFO entry
- UNVERIFIED: stable@ mailing list discussion (fetch denied)
The fix is small, matches the queue layout in this tree, and prevents a host OOB from a bad iLO FIFO entry.
**YES**
drivers/misc/hpilo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/misc/hpilo.c +6 -1
@@ -160,11 +160,16 @@ static int ilo_pkt_dequeue(struct ilo_hwinfo *hw, struct ccb *ccb, ret =fifo_dequeue (hw, fifobar, &entry);if (ret) { +int pkt_len; + pkt_id =get_entry_id (entry); + pkt_len =get_entry_len (entry); +if (pkt_id >=NR_QENTRY || pkt_len >desc_mem_sz (1 )) +return 0 ;if (id) *id = pkt_id;if (len) - *len =get_entry_len (entry); + *len = pkt_len;if (pkt) *pkt = (void *)(desc +desc_mem_sz (pkt_id)); }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 bitops: make the *_bit_le functions use unsigned long
In reply to Sasha LevinFrom: Benjamin Marzinski <[email protected]>
[ Upstream commit 1c61b0a6e5c472737619f74f79c390363ee258df ]
The *_bit_le functions use a signed integer for the bit number. However, the *_bit functions can use an unsigned long. This causes problems if there is a large bitmap and a bit number > 0x80000000 is passed in. Since that is a negative int, it will get sign extended to a long when getting passed to the *_bit function, turning it into a huge bit number. This usually ends up with the memory address wrapping around and the function accessing memory before the start of the bitmap.
Avoid this by making the *_bit_le functions take an unsigned long.
This can be triggered by faking an almost 4TB dm-mirror device, which uses bitmaps to track the mirror regions:
$ dmsetup create bigzero --table '0 8589934590 zero' $ dmsetup create mymirror --table '0 8589934590 mirror core 2 2 nosync 2 /dev/mapper/bigzero 0 /dev/mapper/bigzero 0'
This will access memory before the start of the sync_bits bitmap, and likely hit the guard page of the previously allocated clean_bits bitmap, causing a kernel panic with the old code.
I looked and didn't see any crazy code using the signed int to intentionally try and access bits before some address within the bitmap.
---
LLM Generated explanations, may be completely bogus:
## Phase 1: Commit message forensics
**Step 1.1: Subject line**
Record: [bitops] [make] make the *_bit_le helpers take unsigned long instead of signed int
Subsystem is generic bitops. The verb is “make”, but the body is a sign- extension / out-of-bounds panic fix, not an API feature.
**Step 1.2: Tags**
Record:
- Signed-off-by: Benjamin Marzinski \<[email protected]\> (author)
- Signed-off-by: Yury Norov \<[email protected]\> (bitmap maintainer, applied the patch)
- No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked-by:, Link:, or Cc: stable (absence of Fixes:/Cc: stable is expected here)
**Step 1.3: Body**
Record:
- Bug: *_bit_le() takes int nr while *_bit() takes a wider unsigned/long index. A bit number \> 0x80000000 becomes a negative int, then sign-extends to a huge long.
- Symptom: address wrap, access *before* the bitmap, kernel panic (often on the guard page of a prior vmalloc).
- Reproducer: ~4TB dm-zero + dm-mirror with region size 2 (dmsetup create mymirror --table '0 8589934590 mirror core 2 2 nosync ...'), hitting sync_bits before the start of the bitmap.
- Root cause: signed int bit index vs unsigned/long bitops; author found no callers that intentionally used a negative index.
**Step 1.4: Hidden bug fix?**
Record: Not hidden. It is a type-signature change whose purpose is to stop OOB access and a panic. Not cleanup or a new feature.
---
## Phase 2: Diff analysis
**Step 2.1: Inventory**
Record:
- File: include/asm-generic/bitops/le.h — 9 insertions, 9 deletions (parameter type only)
- Functions: test_bit_le, set_bit_le, clear_bit_le, __set_bit_le, __clear_bit_le, test_and_set_bit_le, test_and_clear_bit_le, __test_and_set_bit_le, __test_and_clear_bit_le
- Scope: single-file surgical type fix
**Step 2.2: Flow change**
Record: Before, each helper took int nr and passed nr ^ BITOP_LE_SWIZZLE into test_bit/set_bit/etc. After, nr is unsigned long. Bodies are unchanged. Normal path only; no new control flow.
**Step 2.3: Bug mechanism**
Record: [Type / integer conversion] [Memory safety / OOB]
On 64-bit, unsigned int/unsigned long bit 0x80000000 converted to int is negative, then sign-extends into set_bit(long nr) / _test_bit(unsigned long nr) as 0xffffffff80000000. BIT_WORD(nr) then yields a pointer *before* addr (wrap). Confirmed in generic___set_bit():
```28:33:include/asm-generic/bitops/generic-non-atomic.h
generic___set_bit(unsigned long nr, volatile unsigned long *addr)
{
unsigned long mask = BIT_MASK(nr);
unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
```**Step 2.4: Fix quality**
Record: Obviously correct and minimal. Widening int → unsigned long matches find_*_bit_le() (already unsigned long in include/linux/find.h) and the generic bitops. Negative callers would still sign-extend into unsigned long; the author grepped and found none. Regression risk is very low: inline helpers, no ABI, no locking, no new behavior for in-range bits.
Note: atomic set_bit() in this tree takes long nr (signed), not unsigned long. That does not undo the fix: values in 2^31 .. 2^32-1 fit in 64-bit long after zero-extension. The bug was 32-bit int → 64-bit long sign extension.
---
## Phase 3: Git history
**Step 3.1: Blame**
Record: Signed int nr dates to a56560b3b2332 (“asm-generic: change little-endian bitops to take any pointer types”, 2011-03-23, contained in v2.6.39-rc1). The type was stable for ~15 years. Commit 1c61b0a6e5c47 (2026-07-06, applied 2026-07-22) is the change under review.
**Step 3.2: Fixes: tag**
Record: None. Buggy signature is ancient generic bitops, not a recent regression.
**Step 3.3: File history**
Record: Recent le.h work is old (6b8ecb84f8f64 moved find_*_le to find.h in 2021). No later commits on this file after 1c61b0a6e5c47. Standalone, not patch N/M.
**Step 3.4: Author**
Record: Benjamin Marzinski is a device-mapper contributor (many drivers/md/ commits), not the bitmap maintainer. Yury Norov (BITMAP API maintainer) applied it. Related nearby dm-log work: c20e36b7631d8 (region_count overflow, similar ~4TB mirror reproducer) and 9743132a41f4d (bitset_size overflow on 32-bit). Those are separate bugs; this patch does not depend on them.
**Step 3.5: Prerequisites**
Record: None. Only include/asm-generic/bitops/le.h. No new helpers. git merge-base --is-ancestor 1c61b0a6e5c47 HEAD succeeded (commit is already in this checkout).
---
## Phase 4: Mailing list
**Step 4.1: Original discussion**
Record:
- v1: https://lore.kernel.org/linux-
arch/[email protected]/
- v2 (committed): https://lore.kernel.org/linux-
arch/[email protected]/
- v1→v2: commit message only (wrong “unsigned int” wording; missing reproducer commands). Code unchanged.
- Yury Norov: “Taking the patch in bitmap-for-next.” Asked for a reproducer and whether this is production.
- Benjamin: explicit dmsetup panic reproducer; LVM default region size is 4096 sectors, so default LVM would need ~4PB devices; “I doubt that anyone has hit this on a production system,” but “This will crash the machine without the fix.”
- No NAKs.
**Step 4.2: Recipients (b4 dig -w)**
Record: Yury Norov, Arnd Bergmann, Rasmus Villemoes, linux-arch, linux- kernel. Bitmap maintainer was To: and applied the patch.
**Step 4.3: Bug report**
Record: No syzbot/bugzilla. Author-discovered with a concrete panic reproducer. Not a theoretical-only issue.
**Step 4.4: Series**
Record: Standalone v1/v2. Not part of a multi-patch series. Related dm- log overflow fixes are independent.
**Step 4.5: Stable list**
Record: UNVERIFIED. lore.kernel.org returned 403; gnuweeb /stable/ search 404. linux-arch thread had no Cc: stable and no stable-list discussion.
---
## Phase 5: Call graph / impact
**Step 5.1: Functions**
Record: The nine *_bit_le inlines listed in 2.1.
**Step 5.2: Callers**
Record (verified via git grep):
- drivers/md/dm-log.c — log_test_bit/log_set_bit/log_clear_bit (unsigned int bit); this is the documented panic path
- drivers/md/md-bitmap.c — RAID bitmaps
- virt/kvm/kvm_main.c — set_bit_le(rel_gfn, memslot->dirty_bitmap) with unsigned long rel_gfn
- Filesystems: ext4/ext2/f2fs/ocfs2/exfat/ntfs3/minix (on-disk LE bitmaps)
- Also: RDS congestion, NVDIMM labels, some net drivers
dm-log and KVM are the large-index paths. Filesystem group bitmaps are typically far below 2^31 bits.
**Step 5.3: Callees**
Record:test_bit/set_bit/clear_bit/__set_bit/__clear_bit/test_and_* plus BITOP_LE_SWIZZLE (0 on LE; low-bit swap on BE).
**Step 5.4: Reachability**
Record: Yes. Privileged dmsetup of a large mirror (author’s reproducer) panics. KVM dirty logging with rel_gfn >= 2^31 (memslot ≳ 8TiB at 4K pages) would hit the same conversion. Unprivileged users cannot run dmsetup; a VM tenant does not set host memslot size.
**Step 5.5: Similar patterns**
Record: find_*_bit_le already use unsigned long. This aligns the set/test/clear LE helpers. No other le.h copies; arches include the generic header (x86, arm64, powerpc, s390, …).
---
## Phase 6: This checkout
**Step 6.1: Does the buggy code exist here?**
Record:
- Tree: v7.3-rc4-27-gf0100363d8c37, VERSION=7 PATCHLEVEL=3 SUBLEVEL=0 EXTRAVERSION=-rc4 (7.3.0-rc4)
- Live le.h already has unsigned long nr (this commit is an ancestor, merged via bitmap-for-7.3)
- Pre-fix int nr existed in this lineage from v2.6.39 through the parent of 1c61b0a6e5c47
- Helpers still exist; the bug class is in this codebase’s history, not a post-branch feature
**Step 6.2: Backport difficulty**
Record: Clean apply to any tree whose le.h still has int nr. Same 9-line signature change since 2011. No conflicting local edits.
**Step 6.3: Related fixes already here**
Record: This exact fix is already in HEAD. Independent dm-log overflow fixes (c20e36b7631d8, 9743132a41f4d) do not replace it: they cap region_count / bitset size; they do not stop sign extension for bits in 2^31 .. UINT_MAX-1 (the 8589934590 / region-size-2 case is region_count = 4294967295).
---
## Phase 7: Subsystem context
**Step 7.1**
Record: [bitops / asm-generic] [CORE] — used by filesystems, DM, KVM, networking.
**Step 7.2**
Record: Bitmap API is actively maintained (bitmap-for-7.3 pull). le.h itself is mature; this is a long-standing type bug, not churn from a rewrite.
---
## Phase 8: Impact and risk
**Step 8.1: Who is affected**
Record: Anyone using *_bit_le on a bitmap with index \> INT_MAX.
Concrete: large dm-mirror with tiny region size; theoretically huge KVM dirty bitmaps / large md bitmaps. Not universal.
**Step 8.2: Trigger**
Record: Not every boot. Needs a bitmap \> 256MiB (2^31 bits). Author’s
case: ~4TB device, region size 2 sectors. LVM default 4096-sector regions would need ~4PB. Root/dmsetup required. Timing-independent; deterministic OOB.
**Step 8.3: Failure mode**
Record: [OOB before bitmap → kernel panic] [Severity: CRITICAL if triggered, LOW likelihood in default configs]
**Step 8.4: Risk-benefit**
Record:
- Benefit: medium — real panic with a reproducer; production default configs unlikely; still a memory-safety bug in core helpers
- Risk: very low — 9-line type widen, no logic/locking/API userspace change
- Ratio: favorable. Cheap, correct panic fix in generic bitops
---
## Phase 9: Synthesis
**Step 9.1: Evidence**
For:
- Reproducible kernel panic from OOB before a vmalloc bitmap
- Mechanism is standard 32→64 sign extension; the diff matches it
- 9 lines, one header, no new APIs
- Bitmap maintainer took it; v2 only fixed the commit message
- Matches find_*_bit_le (unsigned long)
- Applies to this tree’s le.h with no prerequisites
- dm-log, md-bitmap, and KVM dirty logging are real callers of large indexes
Against:
- Author doubts production hits with LVM defaults
- Needs a huge device and a tiny region size (or an enormous KVM slot)
- No syzbot, no Cc: stable, no Fixes:
- This 7.3-rc4 checkout already contains the commit
Unresolved:
- Stable mailing list (HTTP 403/404)
- Whether any caller relied on negative int indexes (author searched; not independently exhaustively proven)
**Step 9.2: Stable rules**
1. Obviously correct and tested? **PASS** — type-only; author reproduced panic; maintainer applied it
2. Real bug that affects users? **PASS** — panic on a documented dm- mirror table; also reachable from other large LE bitmaps
3. Important (crash/security/corruption/deadlock)? **PASS** — kernel panic / OOB. Likelihood is low; severity if hit is high
4. Small and contained? **PASS** — 9 lines, one file
5. No new features/APIs? **PASS** — same helpers, wider index type only
6. Can apply to this tree? **PASS** — file and functions exist; identical hunk. (Already applied here; still a clean backport to any tree with int nr.)
**Step 9.3: Exceptions**
Record: Not a device-ID/quirk/DT/docs exception. Ordinary memory-safety panic fix.
**Step 9.4: Decision**
This is a small, obviously correct fix for a real panic: signed int bit indexes sign-extend into the generic bitops and walk off the front of the bitmap. The helpers live in this tree, there are no missing prerequisites, and the change does not add features. Rare default-config exposure does not outweigh a zero-logic-change panic fix in core bitops.
The commit is already in this 7.3-rc4 history; that is not used as a reason to reject it. Technical merit supports taking it on this lineage.
---
## What the commit solves for stable users
On 64-bit, *_bit_le(int nr) turns bit numbers ≥ 2^31 into a negative int, which becomes a huge long in test_bit/set_bit. Address arithmetic wraps and the kernel reads/writes *before* the bitmap, typically panicking (author: dm-mirror sync_bits vs clean_bits guard page).
That matters for large dm-mirror logs (tiny region size on multi-TB devices) and any other LE bitmap with a high index (e.g. KVM dirty_bitmap with unsigned long rel_gfn). The fix is only changing int to unsigned long on nine inlines.
## Risk vs benefit
Benefit is preventing a confirmed panic. Risk is negligible: no control- flow, locking, or userspace ABI change; widening is source-compatible for non-negative callers. Worst case for a negative caller is the old sign-extension behavior, and none were found.
## Concerns
- Trigger is uncommon with LVM’s 4096-sector default.
- No Fixes:/Cc: stable (not a negative by itself).
- Stable-list discussion could not be fetched (403/404).
- Independent dm-log overflow patches are *not* substitutes for this type fix.
## Verification
- [Phase 1] Parsed tags: only author + Yury Norov SOBs; no Fixes:/Reported-by:/Cc: stable
- [Phase 2] Diff: 9 int nr → unsigned long nr in include/asm- generic/bitops/le.h; bodies unchanged
- [Phase 2] generic___set_bit uses BIT_WORD(nr) pointer math — huge nr wraps before addr
- [Phase 2] set_bit takes long nr; _test_bit/___set_bit take unsigned long nr
- [Phase 3] git describe HEAD / Makefile: 7.3.0-rc4 (v7.3-rc4-27-gf0100363d8c37)
- [Phase 3] git merge-base --is-ancestor 1c61b0a6e5c47 HEAD: yes (already in this tree)
- [Phase 3] blame: int nr from a56560b3b2332 (v2.6.39-rc1); fix is 1c61b0a6e5c47
- [Phase 3] git show 1c61b0a6e5c47^:include/asm-generic/bitops/le.h:
confirmed int nr
- [Phase 3] No follow-up commits on le.h after this one
- [Phase 4] b4 dig -c 1c61b0a6e5c47: v1 then v2; v2 is what was committed
- [Phase 4] b4 dig -a/-w: linux-arch; Yury, Arnd, Rasmus CC’d
- [Phase 4] Yury: taking into bitmap-for-next; asked about 256MB bitmaps / production
- [Phase 4] Author: machine crashes without the fix; production with LVM defaults unlikely
- [Phase 5] Callers: dm-log, md-bitmap, kvm mark_page_dirty_in_slot, ext4 macros, others
- [Phase 5] dm-log log_*_bit(..., unsigned int bit) — values ≥ 0x80000000 hit the old conversion
- [Phase 5] Reproducer math: 8589934590 sectors / region 2 → region_count = 4294967295 (UINT_MAX)
- [Phase 6] Current tree already has unsigned long nr; no other le.h copies
- [Phase 6] Arches include asm-generic/bitops/le.h (x86, arm64, etc.)
- [Phase 8] Failure mode: OOB → panic; trigger needs large bitmap
- UNVERIFIED: stable@ discussion (lore 403, gnuweeb stable search 404)
- UNVERIFIED: exhaustive proof no caller passed negative int on purpose (author stated they looked)
**YES**
include/asm-generic/bitops/le.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
include/asm-generic/bitops/le.h +9 -9
@@ -16,47 +16,47 @@#endif -static inline int test_bit_le (int nr,const void *addr) +static inline int test_bit_le (unsigned long nr,const void *addr) {return test_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline void set_bit_le (int nr,void *addr) +static inline void set_bit_le (unsigned long nr,void *addr) {set_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline void clear_bit_le (int nr,void *addr) +static inline void clear_bit_le (unsigned long nr,void *addr) {clear_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline void __set_bit_le (int nr,void *addr) +static inline void __set_bit_le (unsigned long nr,void *addr) {__set_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline void __clear_bit_le (int nr,void *addr) +static inline void __clear_bit_le (unsigned long nr,void *addr) {__clear_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline int test_and_set_bit_le (int nr,void *addr) +static inline int test_and_set_bit_le (unsigned long nr,void *addr) {return test_and_set_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline int test_and_clear_bit_le (int nr,void *addr) +static inline int test_and_clear_bit_le (unsigned long nr,void *addr) {return test_and_clear_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline int __test_and_set_bit_le (int nr,void *addr) +static inline int __test_and_set_bit_le (unsigned long nr,void *addr) {return __test_and_set_bit (nr ^BITOP_LE_SWIZZLE , addr); } -static inline int __test_and_clear_bit_le (int nr,void *addr) +static inline int __test_and_clear_bit_le (unsigned long nr,void *addr) {return __test_and_clear_bit (nr ^BITOP_LE_SWIZZLE , addr); }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 arm64: mm: fix accidental linear mapping of no-map reserved memory
In reply to Sasha LevinFrom: liulhong617 <[email protected]>
[ Upstream commit 7ace06a01efaba1ec585630aa4c98ac39b38452a ]
When reserved-memory regions with the "no-map" property are not page-aligned, the kernel may accidentally map them into the linear mapping, contradicting the no-map semantics.
The root cause is a mismatch between /proc/iomem's address boundaries and the actual page table mapping boundaries:
1. /proc/iomem derives its ranges from memblock via memblock_region_reserved_base_pfn/memblock_region_reserved_end_pfn, which perform PFN rounding so the displayed boundaries are page-aligned. This gives the impression that the no-map region occupies whole pages.
2. However, memblock_mark_nomap() splits memblock.memory regions at exact byte boundaries (memblock_isolate_range preserves raw DT base/size with no alignment). When for_each_mem_range iterates the non-NOMAP regions adjacent to a no-map region, it returns start/end values that are NOT page-aligned — they are the precise byte boundaries from the memblock split.
3. These sub-page-aligned values are passed to
__create_pgd_mapping_locked(), which does:
phys &= PAGE_MASK;
addr = virt & PAGE_MASK;
end = PAGE_ALIGN(virt + size); The downward rounding of phys via PAGE_MASK extends the mapped range backward into the adjacent no-map region, effectively including no-map memory in the linear mapping.
For example, with 64K pages, reserved_region@A2000000 (base=0xA2000000, size=0x8000, no-map) causes for_each_mem_range to return start=0xA2008000 for the next mappable region. After phys &= PAGE_MASK, the actual mapping starts at 0xA2000000 — the entire no-map region is incorrectly mapped.
Fix this by rounding the mappable range inward to PAGE_SIZE boundaries before passing it to __map_memblock: start is rounded UP and end is rounded DOWN. This ensures the mapped area never overlaps with adjacent no-map regions. The cost is at most one page of unmapped gap at each boundary, which is preferable to violating no-map semantics.
---
LLM Generated explanations, may be completely bogus:
This tree is **6.12.111** (pending-6.12). The candidate is 7ace06a01efab (“arm64: mm: fix accidental linear mapping of no-map reserved memory”). It is not in this checkout. The buggy path is, and the original patch was written against this map_mem() shape.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: [arm64: mm:] [fix] [do not linearly map sub-page-aligned DT no- map reserved memory]
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- Signed-off-by: liulhong617 <[email protected]> (author)
- Signed-off-by: Will Deacon <[email protected]> (arm64 maintainer; applied to for-next/mm)
- No Fixes:
- No Reported-by: / Tested-by: / Reviewed-by: / Acked-by: / Link: / Cc: stable
- Absence of Fixes:/Cc: stable is expected for this review and is not a negative signal
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- **Bug:** no-map reserved-memory that is not page-aligned can still land in the arm64 linear map.
- **Symptom:** /proc/iomem looks page-aligned (PFN rounding), but page tables map the no-map bytes because memblock_mark_nomap() splits at byte precision and __create_pgd_mapping_locked() does phys &= PAGE_MASK (start rounded down into the hole).
- **Example:** 64K pages, reserved_region@A2000000 size 0x8000; next mappable start 0xA2008000 becomes mapping start 0xA2000000.
- **Root cause:** byte-precise NOMAP split + PAGE_MASK downward rounding.
- **Fix:** round the mappable range inward (PAGE_ALIGN(start), end & PAGE_MASK) before __map_memblock. Cost: at most one unmapped page per boundary.
- **Version info in message:** none. Mailing-list follow-up (verified) was on v6.1.177-rt, 64K pages.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not hidden. Explicit isolation/correctness fix, not cleanup.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- File: arch/arm64/mm/mmu.c (+14 / −0)
- Function: map_mem() / map_mem(pgd_t *pgdp) in this tree
- Scope: single-file surgical change in the boot-time linear-map loop
Committed hunk (origin/master map_mem(void)):
```
for_each_mem_range(i, &start, &end) {
+ start = PAGE_ALIGN(start);
+ end = end & PAGE_MASK;
+ if (start >= end)
+ continue;
__map_memblock(...);
}
```The mailing-list v1 was against map_mem(pgd_t *pgdp) and kept this tree’s existing if (start >= end) break; before the new inward rounding — that is the 6.12 shape.
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- **Before:** for_each_mem_range skips MEMBLOCK_NOMAP via should_skip_region(), but adjacent ranges keep raw byte boundaries. Those go to __map_memblock → __create_pgd_mapping_locked(), which rounds phys down and end up, pulling no-map bytes into PAGE_KERNEL.
- **After:** start rounded up, end rounded down; empty leftover skipped. Linear map never overlaps the no-map hole.
- Path: boot-time linear map only (paging_init → map_mem).
Step 2.3: IDENTIFY THE BUG MECHANISM
Record:
- **Category:** logic/correctness + hardware isolation (linear-map over- coverage).
- **Mechanism:** unaligned NOMAP split + phys &= PAGE_MASK over-maps. Verified in this tree at arch/arm64/mm/mmu.c:443-445:
phys &= PAGE_MASK; addr = virt & PAGE_MASK; end = PAGE_ALIGN(virt + size);
- DT no-map (this tree, reserved-memory.yaml): OS must not create a standard mapping **and** must not allow speculative access except under the owning driver.
Step 2.4: ASSESS THE FIX QUALITY
Record:
- Obviously correct for the stated failure: inward rounding matches buddy __free_memory_core() (PFN_UP(start) / PFN_DOWN(end) in mm/memblock.c of this tree). Those slivers were never allocator RAM.
- Minimal; comment-only plus three functional lines.
- Regression risk: low. Worst case is one unmapped page at a no-map boundary (memory the buddy already does not own). Ard noted a theoretical firmware hazard if something like initramfs sat in that wasted page; Will still applied it after Ard confirmed for_each_mem_range() coalesces sub-page *mappable* pieces.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record:
- phys &= PAGE_MASK: 9c4e08a3022b6 (Mark Rutland, 2015, “allow sections for unaligned bases”)
- Linear-map bank loop: 98d2e1539b84a (2017) / b10d6bca87204 (for_each_mem_range, 2020)
- This is old code, present long before 6.12.
Step 3.2: FOLLOW THE FIXES: TAG
Record: No Fixes: tag. Bug is the long-standing interaction of NOMAP byte splits + page-table rounding, not a single recent commit.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record:
- This tree: no commit on arch/arm64/mm/mmu.c already doing inward PAGE_ALIGN in map_mem.
- 7ace06a01efab is **not** an ancestor of HEAD (git merge-base --is- ancestor exit 1).
- Upstream later dropped the pgd_t * argument (2e527667a3b9b, 2026-06-02) — **not** in this tree, **not** required for the fix.
- Follow-up fb0f3ef5601a6 (unmap data/bss from linear map) is independent.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Only this arm64 commit on origin/master. Applied by Will Deacon (arm64 maintainer). Ard Biesheuvel reviewed on-list and called it conceptually sound.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: Standalone. Needs for_each_mem_range, __map_memblock, __create_pgd_mapping_locked — all present. The committed diff does not apply byte-for-byte (later map_mem(void) / no if (start >= end) break;); the **original** patch context matches this tree. Backport is a small context adaptation, not a missing-API rewrite.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- b4 dig -c 7ace06a01efab →
https://patch.msgid.link/[email protected]
- Single revision (v1 only). b4 dig -a: only that v1.
- Thread saved to mbox and read in full.
- Will (16 Jul 2026): worried firmware with many tiny adjacent regions could leave pages unmapped; preferred warn-and-do-nothing; asked for practical symptoms.
- Author (27 Jul): 64K pages, debugger showed phys rounded from 0xa2008000 to 0xa2000000.
- Will (4 Aug): not convinced by that reply.
- Ard (4 Aug): change is conceptually sound; for_each_mem_range() coalesces; only sane handling is to round no-map **outward** (i.e. linear map **inward**). Suggested maybe moving rounding into __create_pgd_mapping_locked() later.
- Will (6 Aug): “Aha, that's the part I was missing.” Applied v1: “I can take this patch for now.”
- Apply mail: https://git.kernel.org/arm64/c/7ace06a01efa (for- next/mm).
- Author (9 Aug, after apply): real platform is Cortex-A78AE, **v6.1.177-rt**, 64K pages; two sub-page no-map TEE regions; DStream showed them folded into one PAGE_KERNEL span; cache prefetcher hit TEE and firmware raised “REE accessed secure memory” faults.
- No NAK of the applied patch. No Cc: stable in review.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record (b4 dig -w): To Catalin Marinas, Will Deacon; Cc linux-arm- kernel, linux-kernel. Ard added later. Maintainer applied it.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: No syzbot/bugzilla. Evidence is the author’s debugger dump and firmware faults (mbox, 9 Aug 2026). Severity from reporter: isolation break + spurious secure-memory faults.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: Standalone 1/1. Ard/Will mentioned a possible later rounding cleanup in __create_pgd_mapping_locked(); origin/master still has this loop-local fix only (no follow-up required).
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: lore.kernel.org/stable WebFetch returned 403. UNVERIFIED whether stable@ already discussed it. Not used as a NO reason.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: map_mem() (this tree: static void __init map_mem(pgd_t *pgdp) at arch/arm64/mm/mmu.c:623).
Step 5.2: TRACE CALLERS
Record: paging_init() → map_mem(swapper_pg_dir) (mmu.c:812-814 in this tree). Boot-time, all arm64 configs. Not a syscall path; result is the linear map used by the whole kernel.
Step 5.3: TRACE CALLEES
Record: for_each_mem_range → __next_mem_range / should_skip_region (skips NOMAP unless MEMBLOCK_NOMAP requested). Then __map_memblock → __create_pgd_mapping → __create_pgd_mapping_locked. memblock_mark_nomap → memblock_isolate_range (byte splits, no page align) — verified in mm/memblock.c.
Step 5.4: FOLLOW THE CALL CHAIN
Record: Reachable on every arm64 boot. User/firmware trigger is a sub- page no-map reserved-memory node (common with 16K/64K pages). Unprivileged userspace does not need to do anything after boot; the bad mapping already exists. Speculative CPU access of TEE pages is enough.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: Second for_each_mem_range in this file is validate_bootmem_online() under CONFIG_DEBUG_VM — not page-table creation. No sibling fix already in this tree.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: **Yes.**
- map_mem() loop: mmu.c:660-670 passes raw start/end to __map_memblock.
- Rounding-down: mmu.c:443-445.
- NOMAP skip: should_skip_region() in mm/memblock.c:1081-1083.
- Byte isolate: memblock_isolate_range().
- Introduced: rounding 2015, loop 2017/2020 — well before 6.12.
- 7ace06a01efab not in HEAD.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: **Minor adaptation, not a rewrite.** Committed patch fails git apply --check because this tree still has if (start >= end) break; and map_mem(pgd_t *pgdp). That is exactly v1’s context. Insert the three rounding lines after the existing break. No need for 2e527667a3b9b.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: None. git log --grep="accidental linear mapping" / --grep="no-map" on this file in HEAD does not contain this fix.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: arch/arm64/mm linear map. **CORE for arm64** (every arm64 boot). no-map is how firmware hides TEE/DSP/GPU carveouts.
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: Mature; this file still changes, but the bank-mapping loop has been stable for years in 6.12. Bug is old, not a new-subsystem leftover.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: arm64 systems whose DT/firmware has **sub-page-aligned no-map reserved-memory**. More likely with 16K/64K pages. Author hit it on 6.1.rt; 6.12 has the same mapping logic.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Boot + unaligned no-map region. No extra userspace trigger. Cache prefetch can then touch TEE. Commonness: not every board, but real on 64K TEE/embedded SoCs.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record:
- Isolation break: no-map (including TEE) mapped PAGE_KERNEL.
- Speculative access / firmware “REE accessed secure memory” faults (verified report).
- DT forbids speculative access to no-map.
- Severity: **HIGH** (security isolation + platform faults). Not a universal oops, but it is an important real bug, not a nit.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- **Benefit:** high for affected boards (TEE/firmware faults, linear-map leak of carveouts).
- **Risk:** low (≤1 unused page per boundary; matches buddy PFN rounding; maintainer-acked).
- Ratio favors backport.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Real bug in this tree’s map_mem() / __create_pgd_mapping_locked().
- Hardware report: Cortex-A78AE, 64K, TEE no-map, firmware faults; also seen conceptually on 6.1, so 6.12 is in range.
- DT no-map contract violated (must not map, must not speculate).
- 14-line, single-function, no new API.
- Will applied; Ard endorsed the approach.
- Original patch context matches 6.12 map_mem(pgd_t *pgdp).
- Inward rounding matches __free_memory_core() so it does not unmap buddy-owned pages.
AGAINST:
- Trigger is firmware/DT-dependent (unaligned no-map), not every arm64 box.
- Committed mainline hunk needs a trivial context tweak (break still present here).
- Will first preferred warn-only; that was withdrawn after Ard’s coalescing point, not a standing NAK.
- Theoretical firmware footgun if a needed image lived in the discarded page remainder (Ard); sliver is already not buddy memory.
UNRESOLVED:
- lore.kernel.org/stable search 403; whether stable@ already took it is UNVERIFIED.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? **PASS** — mechanism verified in-tree; debugger + maintainer apply.
2. Fixes a real bug that affects users? **PASS** — TEE/linear-map isolation break and firmware faults.
3. Important issue? **PASS** — security isolation / platform abort, not a log nit.
4. Small and contained? **PASS** — +14 lines, one loop.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** — bug present; v1 context matches; committed diff needs only local map_mem context.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: Not ID/quirk/DT-board/build/docs. Ordinary important bugfix.
Step 9.4: MAKE YOUR DECISION
Backport to this 6.12 tree. The bug is here, the fix is small, and leaving no-map (especially TEE) in the linear map is a real isolation and stability failure on 64K systems.
------------------------------------------------
What the commit solves for stable users
------------------------------------------------
On this 6.12 tree, boot builds the linear map in map_mem() from for_each_mem_range(). NOMAP regions are skipped, but neighbors keep byte-accurate edges. __create_pgd_mapping_locked() then rounds physical start **down** to PAGE_MASK, so a 32KiB no-map hole on a 64K page is mapped as normal RAM. That contradicts DT no-map and can let the CPU speculate into firmware/TEE memory.
Rounding the mapped range inward before __map_memblock stops that overlap. At most one page per boundary stays unmapped; those bytes were already excluded from the buddy allocator.
------------------------------------------------
Stable rules / risk
------------------------------------------------
Surgical, no API, code is in 6.12, original submission matches this map_mem(pgd_t *) loop. Benefit is isolation and avoiding firmware aborts; risk is a conservative hole the allocator already does not use.
------------------------------------------------
Verification
------------------------------------------------
- [Phase 1] git describe HEAD / make kernelversion:
p-6.12-3-g88406e77611c6, **6.12.111**. Tags: author SOB + Will Deacon SOB only.
- [Phase 2] git show 7ace06a01efab: +14 in map_mem; this tree Read/Grep: phys &= PAGE_MASK at mmu.c:443; loop at mmu.c:660-670.
- [Phase 2] reserved-memory.yaml: no-map forbids standard mapping and speculative access.
- [Phase 2] __free_memory_core(): PFN_UP/PFN_DOWN in mm/memblock.c:2153-2158.
- [Phase 3] blame: 9c4e08a3022b6 (2015) PAGE_MASK; 98d2e1539b84a (2017) / b10d6bca87204 (2020) loop.
- [Phase 3] git merge-base --is-ancestor 7ace06a01efab HEAD → not in tree (exit 1).
- [Phase 3] 2e527667a3b9b (drop pgd_t*) not in HEAD; not a prerequisite.
- [Phase 3] git log origin/master --grep="accidental linear mapping" -- arch/arm64/mm/mmu.c: 7ace06a01efab; git describe --contains --match 'v*': v7.3-rc1~...
- [Phase 4] b4 dig -c/-a/-w/-m: v1 only; lore msgid [email protected]; Will + Ard discussion; applied 6 Aug 2026; author follow-up on v6.1.177-rt TEE faults.
- [Phase 4] lore WebFetch 403 on lore.kernel.org/all and /stable — thread recovered via b4 dig -m.
- [Phase 5] paging_init() calls map_mem(swapper_pg_dir); should_skip_region() skips NOMAP.
- [Phase 6] git apply --check of committed diff **fails** (context); 6.12 loop still has if (start >= end) break; matching v1.
- [Phase 6] origin/master map_mem still has PAGE_ALIGN(start) / end & PAGE_MASK.
- [Phase 8] Failure mode from mbox + DT: TEE mapped, prefetcher, firmware abort — HIGH.
- UNVERIFIED: whether stable@ already queued it (HTTP 403).
**YES**
arch/arm64/mm/mmu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm64/mm/mmu.c +14 -0
@@ -1179,6 +1179,20 @@ static void __init map_mem(pgd_t *pgdp)for_each_mem_range (i, &start, &end) {if (start >= end)break ; +/* +* for_each_mem_range may return sub-page-aligned boundaries +* after memblock_mark_nomap() splits regions at byte precision. +* __create_pgd_mapping_locked aligns phys down to PAGE_MASK, +* which could accidentally map no-map memory on the boundary. +* Round the mappable range inward: start UP, end DOWN, so +* that the mapped area never overlaps with adjacent no-map +* regions. The cost is at most one page of unmapped gap at +* each boundary. +*/ + start =PAGE_ALIGN (start); + end = end &PAGE_MASK ; +if (start >= end) +continue ;/* * The linear map must allow allocation tags reading/writing * if MTE is present. Otherwise, it has the same attributes as
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ASoC: codec: max98926: fixup invert setup mask
In reply to Sasha LevinFrom: Kuninori Morimoto <[email protected]>
[ Upstream commit dd0ae9a2e19a24c532c9aa80a44f572b4907bcdf ]
invert might have both WCI/BCI mask, but regmap_update_bits() masks BCI only. It needs both mask. Fixup it.
static int max98926_dai_set_fmt(...)
{
...
switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
case SND_SOC_DAIFMT_NB_NF:
break;
case SND_SOC_DAIFMT_NB_IF:
=> invert = MAX98926_DAI_WCI_MASK;
break; ^^^^^^^^^^^^^^^^^^^^^
case SND_SOC_DAIFMT_IB_NF:
=> invert = MAX98926_DAI_BCI_MASK;
break; ^^^^^^^^^^^^^^^^^^^^^
case SND_SOC_DAIFMT_IB_IF:
=> invert = MAX98926_DAI_BCI_MASK | MAX98926_DAI_WCI_MASK;
break; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
default:
...
}
...
regmap_update_bits(max98926->regmap, MAX98926_FORMAT,
MAX98926_DAI_BCI_MASK, invert);
... ^^^^^^^^^^^^^^^^^^^^^
}---
LLM Generated explanations, may be completely bogus:
This is a **6.12.111** tree (pending-6.12, p-6.12-3-gc504cf0baa3d8). The candidate is dd0ae9a2e19a2 (“ASoC: codec: max98926: fixup invert setup mask”). It is **not** in this checkout; the buggy regmap_update_bits() mask **is**.
---
## PHASE 1: COMMIT MESSAGE FORENSICS
**Step 1.1: PARSE THE SUBJECT LINE**
- Subsystem: ASoC: codec: max98926
- Action verb: fixup
- Claimed intent: correct the invert-mode bit mask written to the MAX98926 FORMAT register
Record: **[ASoC/max98926] [fixup] [WCI invert bit never programmed because update mask is BCI-only]**
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
- Signed-off-by: Kuninori Morimoto <[email protected]> (author)
- `Link: https://patch.msgid.link/87wltomc97.wl-
[email protected]`
- Signed-off-by: Mark Brown <[email protected]> (ASoC maintainer)
- No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked- by:, or Cc: stable (absence of the last two is expected for this review)
Record: **Author + ASoC maintainer SOB; lore Link; no user/syzbot report**
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
The body shows max98926_dai_set_fmt() building invert as:
- NB_IF → MAX98926_DAI_WCI_MASK
- IB_NF → MAX98926_DAI_BCI_MASK
- IB_IF → BCI | WCI
then calling regmap_update_bits(..., MAX98926_DAI_BCI_MASK, invert). regmap_update_bits() only changes bits in the mask, so WCI is never written.
Record: **[Bug: WCI invert bit dropped] [Symptom: inverted frame clock not applied] [No version info] [Root cause: BCI-only mask]**
**Step 1.4: DETECT HIDDEN BUG FIXES**
This is an explicit register-programming bug, not a disguised cleanup.
Record: **Not a hidden fix; it is a real DAI-format bug**
---
## PHASE 2: DIFF ANALYSIS
**Step 2.1: INVENTORY THE CHANGES**
- File: sound/soc/codecs/max98926.c (1 insertion, 1 deletion)
- Function: max98926_dai_set_fmt()
- Scope: single-file, one-line surgical fix
Record: **[max98926.c +1/-1] [max98926_dai_set_fmt] [surgical]**
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Before (this tree, lines 360–363):
```360:364:sound/soc/codecs/max98926.c
regmap_write(max98926->regmap,
MAX98926_FORMAT, MAX98926_DAI_DLY_MASK);
regmap_update_bits(max98926->regmap, MAX98926_FORMAT,
MAX98926_DAI_BCI_MASK, invert);
return 0;
```regmap_write() sets FORMAT to only DAI_DLY_MASK (WCI and BCI cleared). Then update_bits can set BCI, but never WCI.
After: mask is MAX98926_DAI_BCI_MASK | MAX98926_DAI_WCI_MASK, so both invert bits can be set.
Record: **[BCI-only update → BCI|WCI update on DAI set_fmt path]**
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Header bits in this tree:
```525:528:sound/soc/codecs/max98926.h #define MAX98926_DAI_WCI_MASK (1<<3) ... #define MAX98926_DAI_BCI_MASK (1<<2) ```
This is a logic/correctness bug: wrong regmap mask, so advertised invert modes do not take effect.
Record: **[Logic/correctness] [WCI never written for NB_IF/IB_IF]**
**Step 2.4: ASSESS THE FIX QUALITY**
Obviously correct: it matches sibling max98925.c (already uses BCI | WCI). Minimal. No API/locking/refcount change. Regression risk is near
zero: NB_NF still writes 0 into both bits; IB_NF still sets only BCI.
Record: **[Obviously correct, 1-line] [Very low regression risk]**
---
## PHASE 3: GIT HISTORY INVESTIGATION
**Step 3.1: BLAME THE CHANGED LINES**git blame -L 343,363 -- sound/soc/codecs/max98926.c: the buggy mask is from a2e2876aa0bab (“ASoC: Add max98926 codec driver”, Anish Kumar, 2016-01-14). git describe --contains a2e2876aa0bab → v4.6-rc1~.... Present for ~10 years.
Record: **[a2e2876aa0bab, v4.6] [long-standing bug]**
**Step 3.2: FOLLOW THE FIXES: TAG**
No Fixes: tag. The introducing commit is in this tree (git merge-base --is-ancestor a2e2876aa0bab HEAD succeeded).
The **identical** bug in the sibling driver was already treated as stable material:
``` 0b51601d4504f4 ASoC: max98925: Fix mask for setting DAI invert mode ... Cc: [email protected] ```
That 2015 fix is in this tree. max98926 (2016) reintroduced the same mistake.
Record: **[No Fixes tag; sibling max98925 fix was Cc: stable] [Introducing commit is in this 6.12 tree]**
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Recent max98926.c history in this tree is probe/OF/DAI-terminology churn, not invert-mask work. No prerequisite refactor. Standalone 1-line change.
Record: **[No prerequisites] [Standalone]**
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Kuninori Morimoto is a regular ASoC contributor. Nearby work includes alc5623 invert tidyup (different driver, “tidyup” not this bug). This patch is a standalone [PATCH], not patch X/Y.
Record: **[Core ASoC contributor] [Standalone invert-mask fix, not a series]**
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
The hunk matches this tree exactly. git show dd0ae9a2e19a2 | git apply --check → **APPLY_CLEAN**. No new helpers or structs.
Record: **[No dependencies] [Applies standalone and cleanly]**
---
## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**b4 dig -c dd0ae9a2e19a2 → https://patch.msgid.link/87wltomc97.wl-
[email protected]b4 dig -a: single v1, no later revisions.
Mbox (2 messages): submission + Mark Brown “Applied to for-7.3”. No NAK, no review concerns, no Cc: stable request. Included in the “sound fixes for 7.3-rc1” pull.
Record: **[v1 only] [Applied by ASoC maintainer] [No objections] [Treated as a fix in the rc1 pull]**
**Step 4.2: CHECK WHO REVIEWED THE PATCH**b4 dig -w recipients: Jaroslav Kysela, Liam Girdwood, Mark Brown, Takashi Iwai, linux-sound@. Maintainer applied it the same day.
Record: **[ASoC/ALSA maintainers on To; Mark Brown applied]**
**Step 4.3: SEARCH FOR THE BUG REPORT**
No Reported-by / bugzilla / syzbot. Found by code inspection (same class as Axel Lin’s 2015 max98925 fix).
Record: **[No user report; bug is visible from the code and sibling driver]**
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES** Standalone [PATCH]. No follow-ups on all-next after this commit for max98926.c.
Record: **[Standalone; no later superceding patch]**
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Search for this title on lore stable did not find a prior stable discussion (unrelated hits only).
Record: **[No stable-list discussion found]**
---
## PHASE 5: CODE SEMANTIC ANALYSIS
**Step 5.1: IDENTIFY KEY FUNCTIONS**
Record: **[max98926_dai_set_fmt]**
**Step 5.2: TRACE CALLERS**
Wired as .set_fmt in max98926_dai_ops. ASoC core snd_soc_dai_set_fmt() in sound/soc/soc-dai.c calls dai->driver->ops->set_fmt. sound/soc/soc-core.c applies DAI format from the card/DAI link at setup.
Record: **[Called from ASoC DAI format setup, not a hot IRQ path]**
**Step 5.3: TRACE CALLEES**regmap_write / regmap_update_bits on MAX98926_FORMAT.
Record: **[Register programming only]**
**Step 5.4: FOLLOW THE CALL CHAIN**
Reachable when a MAX98926 card configures DAI format (DT dai-format / machine driver). Unprivileged users typically cannot change invert flags, but boot/stream setup hits this. NB_IF / IB_IF are the broken cases (soc-dai.h: inverted frame).
Record: **[Reachable on DAI setup for this codec] [Broken for inverted frame clock]**
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
This tree: only max98926.c still uses BCI-only. max98925.c already uses BCI | WCI.
Record: **[Sibling already fixed; this is the remaining copy of the same bug]**
---
## PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Yes. git merge-base --is-ancestor dd0ae9a2e19a2 HEAD failed (fix not present). Surrounding code in this tree matches the parent of the candidate commit. Introduced in v4.6, still here in 6.12.111.
Record: **[Buggy code present at max98926_dai_set_fmt] [Since v4.6]**
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS** Context is identical; git apply --check is clean.
Record: **[Clean apply]**
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
No invert-mask fix for max98926 in this tree. max98925’s equivalent fix **is** already here.
Record: **[No prior max98926 invert fix; sibling fix already present]**
---
## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY** sound/soc/codecs/max98926.c — Maxim MAX98926 speaker amplifier. CONFIG_SND_SOC_MAX98926 is selected via SND_SOC_ALL_CODECS imply; DT compatible maxim,max98926 exists. No in-tree board file found that hard-codes this codec.
Record: **[ASoC codec driver] [PERIPHERAL, but real hardware]**
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Codec file is mature; little recent functional change.
Record: **[Mature driver; bug is old, not a new-feature regression]**
---
## PHASE 8: IMPACT AND RISK ASSESSMENT
**Step 8.1: DETERMINE WHO IS AFFECTED**
Users of MAX98926 whose DAI link requests inverted word/frame clock (NB_IF or IB_IF). Default NB_NF is unaffected.
Record: **[Driver-specific; only inverted-frame configurations]**
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Triggered at DAI format setup (card bring-up / PCM start). Common I2S is NB_NF (works). Inverted frame is less common but is a documented, handled mode in this function. Not a userspace-triggered security issue.
Record: **[DAI setup] [Uncommon invert modes] [Not unprivileged- exploitable]**
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
WCI never programmed → LRCLK/frame polarity wrong → swapped channels, DAI desync, or unusable playback. Not a panic/UAF/deadlock.
Record: **[Incorrect audio DAI polarity] [Severity: MEDIUM-HIGH for affected devices; not CRITICAL crash]**
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
- Benefit: makes advertised invert modes actually work; same class of fix max98925 already shipped to stable.
- Risk: 1-line mask OR, no API/locking change, applies cleanly.
Record: **[Benefit: medium for this hardware] [Risk: very low] [Favorable]**
---
## PHASE 9: FINAL SYNTHESIS
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Real, obvious register bug: WCI invert is computed then discarded
- One-line, obviously correct; matches max98925
- Identical max98925 fix (0b51601d4504f4) was Cc: stable
- Bug present since v4.6 and in this 6.12 tree
- Applies cleanly; no dependencies or new APIs
- Applied by Mark Brown; landed in a sound **fixes** pull
- User-visible: inverted frame clock does not work
AGAINST:
- Not a crash, UAF, deadlock, or security issue
- Peripheral codec; no in-tree machine driver found
- No Reported-by / Tested-by
- Common NB_NF path already works
UNRESOLVED:
- Direct user reports of broken MAX98926 inverted-frame setups were not found
- lore.kernel.org WebFetch returned 403; discussion recovered via b4 dig -m
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — 1-line mask, sibling precedent, maintainer applied
2. Fixes a real bug that affects users? **PASS** — advertised invert modes do not program WCI
3. Important issue? **PASS** — hardware misconfiguration / broken audio for inverted frame (same bar as the 2015 max98925 stable fix), not a panic
4. Small and contained? **PASS** — 1 line, one function
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — git apply --check clean; context matches
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Not a device-ID/quirk/DT/build/docs exception. It is a normal small driver correctness fix.
**Step 9.4: MAKE YOUR DECISION**
This belongs in **this** 6.12 tree. The buggy code is here, the fix is trivial and already proven on the sibling codec (including an explicit stable nomination there), and the only cost is flipping one register mask bit that the driver already intended to set.
### What the commit solves for stable users
On MAX98926, set_fmt claims to support word-clock invert (NB_IF / IB_IF) but regmap_update_bits() only allows the BCI bit to change, so LRCLK invert never reaches the chip. That is broken DAI polarity for those boards, not a style change.
### Risk vs benefit
Very low risk (one OR into an existing mask) versus a real, long- standing hardware-config bug that already met the stable bar on max98925.
### Concerns
None for this tree: no prerequisites, no conflict, no follow-up needed. Impact is limited to MAX98926 with inverted frame clock.
---
## Verification
- [Phase 1] Parsed tags: author SOB, Mark Brown SOB, lore Link; no Fixes/Reported-by/Cc: stable
- [Phase 2] Diff: 1 line in max98926_dai_set_fmt(); mask BCI → BCI | WCI
- [Phase 2] Header verified: WCI is bit 3, BCI is bit 2 in max98926.h
- [Phase 3] git blame: buggy line from a2e2876aa0bab (2016, v4.6)
- [Phase 3] git merge-base --is-ancestor a2e2876aa0bab HEAD:
introducing commit **is** in this tree
- [Phase 3] Sibling fix 0b51601d4504f4 (“Fix mask for setting DAI invert mode”) had Cc: [email protected] and is in this tree
- [Phase 3] git log on max98926.c: no invert-mask prerequisite
- [Phase 4] b4 dig -c dd0ae9a2e19a2: lore URL 87wltomc97.wl- [email protected]
- [Phase 4] b4 dig -a: v1 only
- [Phase 4] b4 dig -w: Kysela, Girdwood, Brown, Iwai, linux-sound
- [Phase 4] mbox: Mark Brown applied to for-7.3; no NAKs
- [Phase 4] WebFetch lore/msgid: 403; discussion taken from b4 mbox instead
- [Phase 4] Stable lore search: no prior discussion of this patch
- [Phase 5] Callers: snd_soc_dai_set_fmt() → dai ops .set_fmt; used from soc-core.c DAI setup
- [Phase 5] git grep: only max98926 still has BCI-only invert update
- [Phase 6] make kernelversion / Makefile: **6.12.111**; git describe HEAD: p-6.12-3-gc504cf0baa3d8
- [Phase 6] git merge-base --is-ancestor dd0ae9a2e19a2 HEAD: fix **not** in this tree
- [Phase 6] Parent context of candidate matches local max98926.c lines 360–363
- [Phase 6] git apply --check: APPLY_CLEAN
- [Phase 7] No in-tree machine driver hard-coding max98926; DT compatible maxim,max98926 exists
- [Phase 8] Failure mode: WCI not programmed → wrong frame polarity / broken audio; not a crash
- UNVERIFIED: specific MAX98926 products using NB_IF/IB_IF in the field (driver still implements those cases)
**YES**
sound/soc/codecs/max98926.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/max98926.c +1 -1
@@ -360,7 +360,7 @@ static int max98926_dai_set_fmt(struct snd_soc_dai *codec_dai,regmap_write (max98926->regmap,MAX98926_FORMAT ,MAX98926_DAI_DLY_MASK );regmap_update_bits (max98926->regmap,MAX98926_FORMAT , -MAX98926_DAI_BCI_MASK , invert); +MAX98926_DAI_BCI_MASK |MAX98926_DAI_WCI_MASK , invert);return 0 ; }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 HID: Intel-thc-hid: Intel-quicki2c: Fix buffer overflow
In reply to Sasha LevinFrom: Even Xu <[email protected]>
[ Upstream commit 5e5c3b9db1c5910d6a9175c97b76a95566e4dc32 ]
The input and output buffers are used to store complete HID-over-I2C packets, including their protocol headers. However, their sizes are currently calculated from the payload length only.
Allocate enough space for both the payload and the packet header to prevent a buffer overflow when the payload reaches its maximum size.
---
LLM Generated explanations, may be completely bogus:
This is a two-line allocation-size fix for a real HID-over-I2C buffer overflow in a driver that already exists on this 6.18.y tree. It should be backported.
## PHASE 1: COMMIT MESSAGE FORENSICS
**Step 1.1: PARSE THE SUBJECT LINE**
- Record: **[HID / Intel-thc-hid / Intel-quicki2c] [Fix] [buffer overflow]**
- Subsystem prefix: HID: Intel-thc-hid: Intel-quicki2c
- Action verb: **Fix**
- Claimed intent: prevent overflow of HID-over-I2C input/output buffers
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
- Record:
- Signed-off-by: Even Xu <[email protected]> (author; listed maintainer of INTEL THC)
- Signed-off-by: Jiri Kosina <[email protected]> (HID maintainer)
- No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked- by:, Link:, or Cc: stable (absence of those tags is expected for this review)
- Pipeline-only tags ignored per instructions
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
- Record:
- **Bug:** input_buf and report_buf hold complete HID-over-I2C packets (__le16 len + payload), but they are allocated from payload length only (max_input_len / max_output_len, floored at 4K).
- **Symptom/failure mode:** buffer overflow when the payload reaches
that maximum (2 bytes past the end: `HIDI2C_LENGTH_LEN ==
sizeof(__le16)`). - **Version info:** none in the message.
- **Root cause:** allocation size omitted the 2-byte HID-over-I2C length header.
**Step 1.4: DETECT HIDDEN BUG FIXES**
- Record: Not a hidden fix. The subject and body state a buffer overflow and the diff matches that claim.
## PHASE 2: DIFF ANALYSIS - LINE BY LINE
**Step 2.1: INVENTORY THE CHANGES**
- Record:
- File: drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c (+4
/ −2; net +2)
- Function: quicki2c_alloc_report_buf()
- Scope: **single-file surgical fix**
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
- Record:
- **Hunk 1 (input_buf):** devm_kzalloc(..., max_report_len) →
`devm_kzalloc(..., HIDI2C_PACKET_LEN(max_report_len))`
- **Hunk 2 (report_buf):** same change
- Path: probe-time allocation (quicki2c_probe → quicki2c_alloc_report_buf). Runtime use of those buffers is unchanged.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
- Record:
- **Category:** memory safety / buffer overflow (out-of-bounds write)
- **Mechanism:** packets are struct hidi2c_report_packet { __le16 len; u8 data[]; }. HIDI2C_PACKET_LEN(data_len) is (data_len) + HIDI2C_LENGTH_LEN. Allocation used payload size only.
- Verified consumers:
- handle_input_report() DMA-copies into input_buf via thc_rxdma_read() → sg_copy_to_buffer(..., read_buff, mes_len) with **no destination-size argument**.
- quicki2c_get_report() SWDMA-reads into input_buf.
- quicki2c_init_write_buf() / write_cmd_to_txdma() build framed packets in report_buf (length field + payload, plus command bytes).
- This is **not** a lock/refcount/init/API change.
**Step 2.4: ASSESS THE FIX QUALITY**
- Record:
- **Quality:** obviously correct. Uses an existing macro from include/linux/hid-over-i2c.h that this tree already has.
- **Minimal:** two allocation sizes in one function.
- **Regression risk:** very low. Extra 2 bytes per buffer; no API, locking, or control-flow change.
- **Caveat (not a reason to reject):** qcdev->report_len is still set to max_report_len, not HIDI2C_PACKET_LEN(max_report_len). The write-side bound check (if (buf_len > write_buf_len) return -EINVAL) can still reject a max-sized SET_REPORT. That is fail-safe (no overflow), pre-existing, and not a regression. Command framing can need more than +2 bytes; this commit only claims the 2-byte packet length header, which is what HIDI2C_PACKET_LEN adds.
## PHASE 3: GIT HISTORY INVESTIGATION
**Step 3.1: BLAME THE CHANGED LINES**
- Record: buggy allocations introduced by 66b59bfce6d93 (“HID: intel-
thc-hid: intel-quicki2c: Complete THC QuickI2C driver”, Even Xu, 2025-01-06). Present since the driver became functional. Driver
skeleton: 61bb2714dc3a1. First appeared around **v6.13**, so it is in this 6.18 tree.
**Step 3.2: FOLLOW THE FIXES: TAG**
- Record: no Fixes: tag. Not applicable. The introducing commit is in this tree (git merge-base --is-ancestor 66b59bfce6d93 v6.18.57 succeeded).
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
- Record: recent work on this file is driver completion, ACPI, PM, device IDs, WOT. Related but distinct: d08a1049659aa (ACPI u16 truncation, not this overflow). Sibling series patch: `HID: Intel-thc-
hid: Intel-quickspi: Fix buffer overflow` (different file). This commit is **standalone**; it does not need the QuickSPI patch.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
- Record: Even Xu is listed in MAINTAINERS as maintainer of INTEL TOUCH HOST CONTROLLER (THC) DRIVER (drivers/hid/intel-thc-hid/). This is a maintainer fix, not drive-by.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
- Record: HIDI2C_PACKET_LEN was added in 6fc761385bcf6 (“Add HIDI2C protocol implementation”) and is present on **v6.18.57** in include/linux/hid-over-i2c.h. No missing helpers. Patch applies cleanly to the v6.18.57 blob (patch --dry-run exit 0).
## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
- Record:
- b4 dig -c 5e5c3b9db1c5910d6a9175c97b76a95566e4dc32 →
https://patch.msgid.link/[email protected] - Cover: `[PATCH 0/2] HID: Intel-thc-hid: Fix potential buffer overflow` (`20260922024638.932865-1`)
- b4 dig -a: **v1 only** (no v2/v3). Applied as submitted.
- Jiri Kosina (2026-09-23): “Applied to hid.git#for-7.3/upstream- fixes, thanks.” No NAK.
- No human reviewer asked for Cc: stable. An automated review noted report_len not updated and SET_REPORT framing possibly needing more than 2 bytes. HID maintainer applied the series as-is.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
- Record (b4 dig -w): To/Cc [email protected], [email protected], [email protected], [email protected]. HID maintainers were on the original mail. Jiri applied it.
**Step 4.3: SEARCH FOR THE BUG REPORT**
- Record: no Reported-by / syzbot / bugzilla. Author-found from code inspection (“potential buffer overflow”). No user crash log in the thread.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
- Record: 2/2 is the QuickSPI analogue (HIDSPI_INPUT_BODY_SIZE). Independent file; this I2C patch does not depend on it.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
- Record: lore.kernel.org HTTP fetch returned 403. **UNVERIFIED** whether linux-stable discussed this SHA. Decision does not rely on that.
## PHASE 5: CODE SEMANTIC ANALYSIS
**Step 5.1: IDENTIFY KEY FUNCTIONS**
- Record: quicki2c_alloc_report_buf() only.
**Step 5.2: TRACE CALLERS**
- Record: single caller, quicki2c_probe() (after reading the HID- over-I2C device descriptor). Probe of Intel THC I2C-port PCI devices (Lunar Lake, Panther Lake, Wildcat Lake IDs in quicki2c_pci_tbl). Not a hot path, but every successful probe allocates these buffers, then IRQ/DMA/HID traffic uses them.
**Step 5.3: TRACE CALLEES**
- Record: devm_kzalloc(), le16_to_cpu(), HIDI2C_PACKET_LEN(). No new callees.
**Step 5.4: FOLLOW THE CALL CHAIN**
- Record: PCI probe → descriptor read → alloc → DMA init → HID registration → handle_input_report() on IRQ. Reachable on machines with Intel THC + HID-over-I2C touch. Unprivileged HID input does not size the kernel buffer; overflow is on kernel DMA/copy into an undersized input_buf when the device sends a max-sized packet.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
- Record: same author applied the same header-vs-payload fix to QuickSPI. Confirms a systematic off-by-header bug, not a one-off typo.
## PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
- Record: **Yes.** Local tree is **6.18.57** (git describe HEAD → v6.18.57-155-gcdf239ca885b2; Makefile VERSION=6 PATCHLEVEL=18 SUBLEVEL=57).
- On **v6.18.57** (this series’ base), quicki2c_alloc_report_buf() still does:
- input_buf = devm_kzalloc(..., max_report_len)
- report_buf = devm_kzalloc(..., max_report_len)
- HIDI2C_PACKET_LEN already exists in this tree’s header. Driver is CONFIG_INTEL_QUICKI2C under INTEL_THC_HID (X86_64 && PCI && ACPI).
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
- Record: **clean apply** on the v6.18.57 file. Surrounding function matches the patch. No refactor in the way.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
- Record: no other commit on this file in 6.18.y enlarges these two allocations. The 4K floor (max(..., SZ_4K)) is a workaround for devices that under-declare max length; it does **not** add the 2-byte header. When max_input_len/max_output_len is ≥ 4K (HID max buffer is 16K), that floor provides no slack.
## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
- Record: **HID Intel THC QuickI2C** (drivers/hid/intel-thc-hid/). **IMPORTANT** for Intel laptops/tablets with THC touch (LNL/PTL/WCL), not core mm/VFS. Still production input hardware.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
- Record: actively maintained through 6.18 (device IDs, WOT, ACPI advanced features). Bug is in original 2025 driver completion, not brand-new 7.x-only code.
## PHASE 8: IMPACT AND RISK ASSESSMENT
**Step 8.1: DETERMINE WHO IS AFFECTED**
- Record: **driver-specific / config-specific:** CONFIG_INTEL_QUICKI2C on x86_64 with Intel THC HID-over-I2C devices.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
- Record: HID-over-I2C input/feature/output packet whose payload equals the allocated max (max(declared max, 4K)). Typical small touch reports may not hit it; max-sized reports and devices that declare large wMaxInputLength can. Not a userspace-crafted syscall overflow; it is device-facing DMA/copy. Still a kernel memory-safety bug on a standard probe/IRQ path.
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
- Record: **buffer overflow (2 bytes) into heap** via sg_copy_to_buffer / packet construction. **HIGH** (memory corruption; crash or worse). Not a panic on every boot, but it is a real overflow, not a warning.
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
- Record:
- **Benefit:** high for THC HID-over-I2C users — closes a heap overflow the driver author and HID maintainer treated as real.
- **Risk:** very low — +2 bytes on two devm_kzallocs, existing macro, no behavior change except not writing past the buffer.
- **Ratio:** strongly favors backport.
## PHASE 9: FINAL SYNTHESIS
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Real buffer overflow: complete HID-over-I2C packets stored in buffers sized from payload only
- DMA copy into input_buf has no dest-size check
- Small, obviously correct (+2 bytes via existing HIDI2C_PACKET_LEN)
- Driver and macro exist in this 6.18.57 tree; introducing commit is in this tree
- Applies cleanly
- Written by the THC maintainer; applied by HID maintainer
- Same class of bug independently fixed in QuickSPI
AGAINST:
- No public reproducer / syzbot report (author-found “potential”)
- 4K floor hides the overflow for devices with small max_input_len
- report_len not updated; write path may still -EINVAL at max size (fail-safe, not a new bug)
- Affects only Intel THC QuickI2C, not all machines
UNRESOLVED:
- Could not query lore.kernel.org/stable (HTTP 403)
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — two allocation sizes; HID maintainer applied v1; macro already in tree
2. Fixes a real bug that affects users? **PASS** — overflow on max-sized HID-over-I2C packets in a shipping Intel touch driver
3. Important issue? **PASS** — heap buffer overflow / memory corruption (**HIGH**)
4. Small and contained? **PASS** — one function, two sites, ~4 lines
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — clean on v6.18.57; HIDI2C_PACKET_LEN already present
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
- Record: none needed. This is a normal memory-safety bug fix, not a device-ID/quirk/DT/build/docs exception.
**Step 9.4: MAKE YOUR DECISION**
Backport. The bug is in this 6.18.y driver, the fix is surgical, and leaving a 2-byte heap overflow in a HID DMA path is worse than adding two bytes to the buffers.
## What the commit solves for this tree
On 6.18.57, QuickI2C still allocates input_buf/report_buf as max(payload, 4K) and then stores HID-over-I2C packets that include a 2-byte length header. When the payload is that maximum, thc_rxdma_read() / SWDMA copies past the end of the kmalloc buffer. The fix allocates HIDI2C_PACKET_LEN(max_report_len) instead.
That matches stable rules: real overflow, tiny diff, no new API, applies cleanly, no missing prerequisites.
Risk vs benefit: +2 bytes of allocation vs heap corruption on Intel THC HID-over-I2C devices (Lunar Lake / Panther Lake / Wildcat Lake). Benefit dominates. The unfixed report_len bound is conservative, not a regression.
## Verification
- [Phase 1] Parsed subject/body/tags: overflow fix; Even Xu + Jiri Kosina SOBs; no Fixes/Reported-by
- [Phase 2] Diff: two devm_kzalloc sizes in quicki2c_alloc_report_buf() wrap HIDI2C_PACKET_LEN
- [Phase 2] include/linux/hid-over-i2c.h: HIDI2C_PACKET_LEN(data_len) = data_len + sizeof(__le16)
- [Phase 2] handle_input_report() / read_dma_buffer():
sg_copy_to_buffer into input_buf without dest capacity
- [Phase 3] git blame on v6.18.57: allocations from 66b59bfce6d93 (2025-01, driver completion)
- [Phase 3] git merge-base --is-ancestor 66b59bfce6d93 v6.18.57:
introducing commit is in this tree
- [Phase 3] HIDI2C_PACKET_LEN added in 6fc761385bcf6; present on v6.18.57
- [Phase 3] Author Even Xu is MAINTAINERS owner of drivers/hid/intel- thc-hid/
- [Phase 4] b4 dig -c 5e5c3b9db1c5910d6a9175c97b76a95566e4dc32: lore thread found; v1 only
- [Phase 4] mbox: Jiri Kosina applied to hid.git#for-7.3/upstream-fixes; no NAK
- [Phase 4] b4 dig -w: HID maintainers on original To/Cc
- [Phase 4] UNVERIFIED: lore.kernel.org/stable HTTP 403
- [Phase 5] Single caller quicki2c_probe(); PCI IDs LNL/PTL/WCL THC I2C ports
- [Phase 6] git describe HEAD / make kernelversion: 6.18.57
- [Phase 6] git show v6.18.57:drivers/hid/intel-thc-hid/intel- quicki2c/pci-quicki2c.c: buggy sizes still present
- [Phase 6] patch --dry-run of this commit onto the v6.18.57 file:
exit 0
- [Phase 8] Failure mode: 2-byte heap overflow on max-sized HID-over-I2C packets; severity HIGH
**YES**
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c +4 -2
@@ -586,7 +586,8 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev)*/ max_report_len =max (le16_to_cpu (qcdev->dev_desc.max_input_len),SZ_4K ); - qcdev->input_buf =devm_kzalloc (qcdev->dev, max_report_len,GFP_KERNEL ); + qcdev->input_buf =devm_kzalloc (qcdev->dev, +HIDI2C_PACKET_LEN (max_report_len),GFP_KERNEL );if (!qcdev->input_buf)return -ENOMEM ;
@@ -596,7 +597,8 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev) max_report_len =max (le16_to_cpu (qcdev->dev_desc.max_output_len), max_report_len); - qcdev->report_buf =devm_kzalloc (qcdev->dev, max_report_len,GFP_KERNEL ); + qcdev->report_buf =devm_kzalloc (qcdev->dev, +HIDI2C_PACKET_LEN (max_report_len),GFP_KERNEL );if (!qcdev->report_buf)return -ENOMEM ;
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH AUTOSEL 6.18] HID: Intel-thc-hid: Intel-quicki2c: Fix buffer overflow
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] HID: quicki2c: input_buf size mismatch with DMA in quicki2c_alloc_report_buf() - [Medium] HID…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] HID: quicki2c: input_buf size mismatch with DMA in quicki2c_alloc_report_buf()
- [Medium] HID: intel-thc-hid: incomplete report_buf sizing in quicki2c_alloc_report_buf() --
commit 916fd20197b9aebc1d04d169b7d6a4523c3d0a4d
Author: Even Xu <[email protected]>
HID: Intel-thc-hid: Intel-quicki2c: Fix buffer overflow
This commit enlarges the qcdev->input_buf and qcdev->report_buf allocations in quicki2c_alloc_report_buf() by wrapping max_report_len with HIDI2C_PACKET_LEN() to account for the 2-byte HID-over-I2C packet length header.
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev) · line 590
Quoted 11 lines
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c +2
-1@@ -586,7 +586,8 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev)*/ max_report_len =max (le16_to_cpu (qcdev->dev_desc.max_input_len),SZ_4K ); - qcdev->input_buf =devm_kzalloc (qcdev->dev, max_report_len,GFP_KERNEL ); + qcdev->input_buf =devm_kzalloc (qcdev->dev, +HIDI2C_PACKET_LEN (max_report_len),GFP_KERNEL );
[Severity: High]
Can qcdev->input_buf still be overflowed or mismatched with the DMA packet limits when reading reports into it?
In drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c, read_dma_buffer() bounds-checks the incoming DMA transfer only against read_config->max_packet_size before copying into read_buff (qcdev->input_buf):
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dma.c:read_dma_buffer() {
prd_tbl = &read_config->prd_tbls[prd_table_index];
mes_len = calc_message_len(prd_tbl, &nent);
if (mes_len > read_config->max_packet_size) {
...
return -EMSGSIZE;
}
sg = read_config->sgls[prd_table_index];
ret = sg_copy_to_buffer(sg, nent, read_buff, mes_len);
}Meanwhile, quicki2c_dma_init() and quicki2c_dma_adv_enable() in drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c configure the DMA and hardware frame limits using the raw max_input_len and report_desc_len without HIDI2C_PACKET_LEN():
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c:quicki2c_dma_init() {
swdma_max_len = max(le16_to_cpu(qcdev->dev_desc.max_input_len),
le16_to_cpu(qcdev->dev_desc.report_desc_len));
ret = thc_dma_set_max_packet_sizes(qcdev->thc_hw, 0,
le16_to_cpu(qcdev->dev_desc.max_input_len),
le16_to_cpu(qcdev->dev_desc.max_output_len),
swdma_max_len);
}drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c:quicki2c_dma_adv_enable() {
if (qcdev->i2c_max_frame_size_enable) {
if (qcdev->i2c_max_frame_size >=
le16_to_cpu(qcdev->dev_desc.max_input_len)) {
thc_i2c_set_rx_max_size(qcdev->thc_hw,
le16_to_cpu(qcdev->dev_desc.max_input_len));
}Because dma_set_max_packet_size() rounds max_packet_size up with ALIGN(size, SZ_4K), this leaves three mismatches on the quicki2c_irq_thread_handler() -> handle_input_report() -> thc_rxdma_read() and quicki2c_hid_raw_request() -> quicki2c_get_report() -> thc_swdma_read() paths:
1. If report_desc_len is larger than max(max_input_len, SZ_4K) + 2, THC_SWDMA has max_packet_size = ALIGN(report_desc_len, SZ_4K) while qcdev->input_buf is only max(max_input_len, SZ_4K) + 2 bytes, so quicki2c_get_report() calling thc_swdma_read() with prd_tbl_len = NULL can copy past the end of qcdev->input_buf.
2. If max_input_len > SZ_4K and is not within 2 bytes of a 4K multiple (for example, 4100), qcdev->input_buf is 4102 bytes while THC_RXDMA2 and THC_SWDMA have max_packet_size = 8192 bytes, allowing read_dma_buffer() to overflow qcdev->input_buf if a larger DMA transfer arrives.
3. If max_input_len is 4095 or an exact multiple of SZ_4K (such as 4096), passing raw max_input_len to thc_dma_set_max_packet_sizes() and thc_i2c_set_rx_max_size() leaves the DMA buffer and RX max frame size at 4096 or 4095 bytes, whereas a full-size input packet with its 2-byte length header requires 4098 or 4097 bytes.
Should quicki2c_dma_init(), quicki2c_dma_adv_enable(), and the qcdev->input_buf allocation all use consistent packet sizes?
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev) · line 604
Quoted 13 lines
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c +2
-1if (!qcdev->input_buf)return -ENOMEM ;@@ -596,7 +597,8 @@ static int quicki2c_alloc_report_buf(struct quicki2c_device *qcdev) max_report_len =max (le16_to_cpu (qcdev->dev_desc.max_output_len), max_report_len); - qcdev->report_buf =devm_kzalloc (qcdev->dev, max_report_len,GFP_KERNEL ); + qcdev->report_buf =devm_kzalloc (qcdev->dev, +HIDI2C_PACKET_LEN (max_report_len),GFP_KERNEL );if (!qcdev->report_buf)return -ENOMEM ;
[Severity: Medium]
Does enlarging qcdev->report_buf by HIDI2C_PACKET_LEN(max_report_len) allow maximum-length output or feature reports to succeed?
At the end of quicki2c_alloc_report_buf(), qcdev->report_len is still set to max_report_len:
drivers/hid/intel-thc-hid/intel-quicki2c/pci-quicki2c.c:quicki2c_alloc_report_buf() {
qcdev->report_buf = devm_kzalloc(qcdev->dev,
HIDI2C_PACKET_LEN(max_report_len), GFP_KERNEL);
if (!qcdev->report_buf)
return -ENOMEM;
qcdev->report_len = max_report_len;
}When write_cmd_to_txdma() or quicki2c_get_report() in drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c formats a packet into qcdev->report_buf, it passes qcdev->report_len as write_buf_len to quicki2c_init_write_buf():
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c:write_cmd_to_txdma() {
ret = quicki2c_init_write_buf(qcdev, cmd, cmd_len, buf ? true : false, buf,
buf_len, qcdev->report_buf, qcdev->report_len);
}And quicki2c_init_write_buf() prepends cmd_reg (HIDI2C_REG_LEN = 2 bytes), cmd (HIDI2C_CMD_LEN = 2 bytes, or HIDI2C_CMD_LEN_OPT = 3 bytes when report_id >= 15), data_reg (HIDI2C_REG_LEN = 2 bytes), and the packet length header (HIDI2C_LENGTH_LEN = 2 bytes) before checking against write_buf_len:
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-protocol.c:quicki2c_init_write_buf() {
buf_len = HIDI2C_REG_LEN + cmd_len;
if (append_data_reg)
buf_len += HIDI2C_REG_LEN;
if (data && data_len)
buf_len += data_len + HIDI2C_LENGTH_LEN;
if (buf_len > write_buf_len)
return -EINVAL;
}Because qcdev->report_len is left at max_report_len, the extra 2 bytes in qcdev->report_buf cannot be used, and because quicki2c_init_write_buf() writes 8 to 9 bytes of framing ahead of data_len, HIDI2C_PACKET_LEN() (only 2 extra bytes) is still 6 to 7 bytes short for a payload of max_report_len bytes, causing quicki2c_init_write_buf() to return -EINVAL.
Should qcdev->report_buf and qcdev->report_len both be sized to include the full command, register, and packet length headers written by quicki2c_init_write_buf()?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Sasha Levin
maintainerPATCH 1/1 drm/xe: only resume exec queues that were actually suspended
In reply to Sasha LevinFrom: Niranjana Vishwanathapura <[email protected]>
[ Upstream commit 65f40fa5022bcdb90d3a39e4948adf2aa16732a3 ]
A consumer-issued suspend() can fail (e.g. the queue is killed, banned or wedged), leaving the queue un-suspended. The consumer must then not issue the matching resume(): resuming a queue that was never suspended is incorrect.
Add an lr.suspended flag to struct xe_exec_queue that records whether a consumer suspend() succeeded and a matching resume() is still owed. Set it on a successful suspend() in the preempt-fence path, clear it on resume(), and only resume queues that have it set.
In resume_and_reinstall_preempt_fences() also skip queues that have since been reset/killed/banned/wedged: such a queue's suspend may not have completed (suspend_pending can still be set, e.g. a preempt fence signalled with -ENOENT without waiting), so resuming it would trip the !suspend_pending assert in the backend. Leave it marked suspended and let teardown resolve its state.
A queue is only ever suspended by a single consumer at a time (preempt-fence mode and hw engine group fault mode are mutually exclusive), so a single flag is sufficient.
---
LLM Generated explanations, may be completely bogus:
This tree is **v7.3-rc4** (mainline). The Xe preempt-fence path this patch touches is present, and the change is a small, self-contained pairing fix for a real GuC suspend/resume protocol bug.
## Phase 1: Commit message forensics
**Step 1.1: Subject line**
- Record: [drm/xe] [only resume] only resume exec queues that were actually suspended
- Subsystem: Intel Xe DRM. Verb “only resume” is a restriction/guard: do not resume a queue that was never successfully suspended.
**Step 1.2: Tags**
- Record:
- Assisted-by: Github-Copilot:Claude-opus-4.8
- Signed-off-by: Niranjana Vishwanathapura (author)
- Reviewed-by: Matthew Brost (Xe maintainer)
- `Link: https://patch.msgid.link/20260713202317.2187787-9-
[email protected]`
- No Fixes:, Reported-by:, Tested-by:, Cc: stable (absence is expected)
- Ignore any pipeline Signed-off-by: Sasha Levin / [Upstream commit …] markers; none were on the real commit
**Step 1.3: Body**
- Record: [Bug] Consumer suspend() can fail (killed/banned/wedged) leaving the queue un-suspended; the matching resume() was still issued. A second case: suspend started but the preempt fence was signalled -ENOENT without suspend_wait(), so suspend_pending can still be set; resume() then trips the backend !suspend_pending assert.
- [Symptom] Incorrect resume pairing; GuC backend assert; scheduling state left inconsistent.
- [Version] None stated. Series title: “balance exec queue suspend/resume”.
- [Root cause] Resume was unconditional. Fix: lr.suspended set only on successful suspend(), cleared on resume(), and skip reset/killed/banned/wedged queues.
**Step 1.4: Hidden bug fix?**
- Record: Not disguised. Explicit correctness fix. Covering letter also calls the series “fixes and hardens”; this patch is the pairing fix, not a pure cleanup.
## Phase 2: Diff analysis
**Step 2.1: Inventory**
- Record: 3 files, **+36 / -1**
- xe_exec_queue_types.h: add bool lr.suspended (+12)
- xe_preempt_fence.c: preempt_fence_enable_signaling() (+7)
- xe_vm.c: resume_and_reinstall_preempt_fences() (+17 / -1)
- Scope: single-subsystem surgical fix.
**Step 2.2: Code flow**
- Record:
- **Before:** suspend() return stored in pfence->error; resume_and_reinstall_preempt_fences() always called q->ops->resume(q) for every queue on vm->preempt.exec_queues.
- **After:** successful suspend() does `WRITE_ONCE(q->lr.suspended,
true)`; resume only if `READ_ONCE(q->lr.suspended) &&
!q->ops->reset_status(q)`, then clears the flag.- Path: compute/long-running VM rebind worker (preempt-fence mode), not probe/init.
**Step 2.3: Bug mechanism**
- Record: [Logic / state-machine pairing] plus [debug assert]
- At the parent of this commit, GuC resume was:
```2248:2254:drivers/gpu/drm/xe/xe_guc_submit.c // parent: 65f40fa5022bc^ xe_gt_assert(guc_to_gt(guc), !q->guc->suspend_pending); guc_exec_queue_try_add_msg(q, msg, RESUME); ```
- Failed suspend() returns -EINVAL *before* setting suspend_pending. Unconditional resume() still queues a GuC RESUME.
- preempt_fence_work_func() on reset_status() signals -ENOENT without suspend_wait(), so suspend_pending can still be true when resume runs.
- guc_exec_queue_allowed_to_change_state() is !killed/banned/wedged && registered — it does **not** check RESET. A reset-but-not-yet- killed queue can take the resume path and call enable_scheduling().
**Step 2.4: Fix quality**
- Record: Obviously correct pairing (resume only if suspend succeeded and queue is not in reset/kill). Minimal. Adds an internal flag only. WRITE_ONCE/READ_ONCE match the comment that only one consumer suspends at a time (preempt-fence vs hw-engine-group fault mode). Regression
risk: low; skipping resume is limited to queues already failing, which the commit says teardown owns.
## Phase 3: Git history
**Step 3.1: Blame / introduction**
- Record: Unconditional q->ops->resume(q) in resume_and_reinstall_preempt_fences() dates to dd08ebf6c3525 (“drm/xe: Introduce a new DRM driver for Intel GPUs”), i.e. Xe’s introduction (v6.8-era). Long-standing, not last-month code.
**Step 3.2: Fixes: tag**
- Record: No Fixes: tag. Buggy resume site is original Xe code, not a recent regression-only commit.
**Step 3.3: Related file history**
- Record: This is **patch 1/6** of “drm/xe: balance exec queue suspend/resume”. Later commits in this tree that use lr.suspended / continue the series:
- dad2af2da9ead ban on suspend timeout
- 412c885692cad uninterruptible suspend wait
- c373eaaada2fe hw_engine_group propagate suspend failures (sets lr.suspended there)
- 3c316b09072c2 suspend refcount
- 5d5a729cc9780 multi-queue preempt primary
- Patch 1 is standalone for the preempt-fence path. Later patches are not required for this hunk to be correct.
**Step 3.4: Author**
- Record: Niranjana Vishwanathapura, regular Xe contributor. Reviewed by Matthew Brost, Xe maintainer (MAINTAINERS: INTEL DRM XE DRIVER).
**Step 3.5: Dependencies**
- Record: Needs existing q->ops->suspend, resume, reset_status, and struct xe_exec_queue lr — all present here. No new helper from later series patches. Can apply standalone.
## Phase 4: Mailing list / external
**Step 4.1: Original discussion**
- Record: b4 dig -c 65f40fa5022bc → https://patch.msgid.link/202607132
[email protected]
- Revisions: v1 (2026-06-24, 1/5) → v2 → v3 (1/6) → v5 covering letter 2026-07-13. Applied version is v5 1/6.
- Covering letter: consumers issued resume even when suspend never took effect; “with the GuC backend it can trip the !suspend_pending assertion or leave scheduling state inconsistent.”
- No NAKs in the saved thread mbox (series posts only; Reviewed-by was already on the submission).
**Step 4.2: Recipients (b4 dig -w)**
- Record: [email protected], Matthew Brost, Thomas Hellström (both Xe maintainers). Right list and maintainers.
**Step 4.3: Bug report**
- Record: No syzbot, bugzilla, or user Reported-by. Author-driven correctness fix.
**Step 4.4: Series**
- Record: 6 patches. Patch 1 = this commit (preempt-fence pairing). Patch 4 applies the same flag to hw engine group. Patch 6 is multi- queue GuC preempt behavior. This commit does not depend on 2–6.
**Step 4.5: Stable list**
- Record: lore.kernel.org/stable search for this subject did not show a dedicated stable request or rejection (unrelated 7.2/6.18 review mails matched generic words).
## Phase 5: Semantic / call-chain
**Step 5.1: Functions**
- Record: preempt_fence_enable_signaling, resume_and_reinstall_preempt_fences. New field xe_exec_queue.lr.suspended.
**Step 5.2: Callers**
- Record: resume_and_reinstall_preempt_fences() is called once from the preempt rebind worker after arm_preempt_fences() (“point of no return”). preempt_fence_enable_signaling is the dma-fence enable_signaling callback for Xe preempt fences.
**Step 5.3: Callees**
- Record: q->ops->suspend / resume / reset_status (GuC backend is the real one; execlist ops are NIY stubs).
**Step 5.4: Reachability**
- Record: Yes from userspace. xe_vm_in_preempt_fence_mode() is long- running compute VMs (XE_VM_FLAG_LR_MODE and not fault mode). Triggered when the VM rebind worker runs (BO moves, userptr invalidation, eviction) while compute exec queues are attached. Concurrent GPU reset/kill of a queue during that window is the bad path.
**Step 5.5: Similar patterns**
- Record: Same lr.suspended discipline later in xe_hw_engine_group.c (series patch 4). Confirms this is the intended pairing primitive, not a one-off hack.
## Phase 6: This tree
**Step 6.1: Buggy code in this tree?**
- Record: Yes. Tree is v7.3-rc4-27-gf0100363d8c37, VERSION=7 PATCHLEVEL=3 SUBLEVEL=0 EXTRAVERSION=-rc4. Xe files exist. Parent of 65f40fa5022bc still has unconditional q->ops->resume(q). Bug introduced with Xe (dd08ebf6c3525), well before 7.3.
**Step 6.2: Backport difficulty**
- Record: For this tree, the surrounding structs/ops match the diff:
clean apply. (This commit is already an ancestor of HEAD; that is used only to inspect the code, not as a “already selected” reason.)
**Step 6.3: Related fixes already here**
- Record: No earlier alternate fix of this pairing. Later series patches extend the same flag to other callers; they do not replace this preempt-fence fix.
## Phase 7: Subsystem context
**Step 7.1**
- Record: [drivers/gpu/drm/xe] [IMPORTANT] — Intel Xe (Lunar Lake and newer). Not core mm/net, but a supported production GPU driver.
**Step 7.2**
- Record: High activity (many Xe commits in this tree). The bug itself is old pairing, not a brand-new subsystem.
## Phase 8: Impact and risk
**Step 8.1: Who is affected**
- Record: Xe users with long-running/compute exec queues in preempt- fence mode (Intel compute / Level Zero style workloads), during VM rebind plus queue reset/kill/ban/wedge.
**Step 8.2: Trigger**
- Record: Not every boot. Concurrent rebind + queue failure/reset. Userspace-reachable via compute VM + memory movement + hang/reset or queue destroy. Timing-dependent.
**Step 8.3: Failure mode**
- Record: xe_gt_assert is **debug-only** (CONFIG_DRM_XE_DEBUG); production distro kernels will not WARN there. Production still queues GuC RESUME without a completed suspend. For killed queues, allowed_to_change_state makes the resume handler mostly a no-op. For **RESET but not yet killed** queues, resume can enable_scheduling() on a context hang recovery is tearing down — GPU scheduling inconsistency / possible hang of that engine, not a kernel oops.
- Severity: **HIGH** for the reset-window GuC protocol break; **MEDIUM** if only dead queues are poked (mostly no-op + debug WARN).
**Step 8.4: Risk-benefit**
- Record: Benefit: medium-high for Xe compute (prevents illegal resume / enable on reset queues). Risk: low (36 lines, error/teardown path, no UAPI). Ratio favors taking it.
## Phase 9: Synthesis
**Step 9.1: Evidence**
FOR:
- Real pairing bug: resume of never-suspended or still-pending-suspend queues.
- Concrete backend contract: guc_exec_queue_resume() asserts !suspend_pending and (in production) still submits RESUME.
- Reset vs kill mismatch: reset_status includes RESET; allowed_to_change_state does not — so old resume can re-enable a reset context.
- Small, obviously correct, maintainer-reviewed (Matthew Brost).
- Self-contained for preempt-fence; this tree has the code.
- No new userspace API.
AGAINST:
- Series 1/6; later patches continue related hardening (not required here).
- No Reported-by / syzbot.
- Healthy queues on the success path are unchanged; the skip is for already-failing queues.
- Primary wording in the commit is the debug assert.
UNRESOLVED:
- No public user crash report proving a full-device GPU hang in the wild.
- Stable list had no explicit ACK/NAK for this subject.
**Step 9.2: Stable rules**
1. Obviously correct and tested? **PASS** — pairing is straightforward; v1–v5 review; maintainer Reviewed-by.
2. Real bug affecting users? **PASS** — reachable compute rebind + reset/kill path; illegal GuC RESUME.
3. Important (crash/security/corruption/deadlock)? **PASS** — not a kernel oops in production, but GuC protocol violation and enable_scheduling() on a reset queue is a serious GPU-driver failure (hang / inconsistent scheduling), which is in the “etc.” class for driver stability.
4. Small and contained? **PASS** — 36 lines, 3 Xe files.
5. No new features/APIs? **PASS** — internal flag only. (Series patch 6 is a feature; this patch is not.)
6. Can apply to this tree? **PASS** — Xe preempt-fence path and ops exist; hunk is against the local structures.
**Step 9.3: Exception category**
- Record: None (not a device ID, quirk, DT, build, or docs fix). Qualifies as a normal bugfix.
**Step 9.4: Decision**
This is a small, reviewed correctness fix for a real suspend/resume imbalance on a supported Intel GPU compute path. It does not add features, applies to this tree’s Xe code, and the production risk of the bug is illegal GuC resume (including re-enabling a reset context), not merely a debug WARN. That meets stable rules for this checkout.
### What it solves for users of this tree
On Xe long-running (preempt-fence) VMs, the rebind worker always resumed every attached exec queue. If suspend() had failed or the queue was reset before suspend finished, that resume violated the GuC backend contract. This patch records a successful suspend and only resumes those queues, so already-failed queues are left to teardown instead of getting a spurious RESUME.
### Risk vs benefit
Benefit is avoiding GuC protocol errors and possible engine re-enable during reset. Risk is low: one flag, two call sites, no UAPI, skip limited to reset/killed queues.
### Concerns
It is patch 1/6; hw-engine-group pairing is a later commit and is not required for this hunk. No in-the-wild report. Debug asserts are compiled out of production, so the user-visible production issue is the protocol/state bug, not a WARN.
### Verification
- [Phase 1] Parsed commit 65f40fa5022bc: tags as listed; no Fixes/Reported-by/Cc-stable.
- [Phase 2] Diff: +36/-1 in three Xe files; resume became conditional on lr.suspended && !reset_status().
- [Phase 2] Parent guc_exec_queue_suspend returns -EINVAL for killed/banned/wedged without setting suspend_pending; parent guc_exec_queue_resume asserts !suspend_pending then try_add_msg(RESUME).
- [Phase 2] xe_assert.h: xe_gt_assert effective only with CONFIG_DRM_XE_DEBUG.
- [Phase 2] guc_exec_queue_allowed_to_change_state() ignores RESET; guc_exec_queue_reset_status() includes RESET; xe_guc_exec_queue_reset_handler() sets reset then trigger_cleanup — window verified in xe_guc_submit.c.
- [Phase 3] git log -S 'resume_and_reinstall_preempt_fences' -- drivers/gpu/drm/xe/xe_vm.c → dd08ebf6c3525.
- [Phase 3] Series neighbors confirmed via git log --author=Niranjana Vishwanathapura -- drivers/gpu/drm/xe/.
- [Phase 3] git merge-base --is-ancestor 65f40fa5022bc HEAD succeeds (used to inspect, not as a selection argument). git merge-base --is- ancestor 65f40fa5022bc v7.2 fails; present since v7.3-rc1.
- [Phase 4] b4 dig -c 65f40fa5022bc / -a / -w / -m /tmp/xe- suspend.mbox: v5 1/6, maintainers CC’d, covering letter quoted above; mbox had no NAK replies.
- [Phase 4] lore.kernel.org/stable search: no dedicated discussion of this patch.
- [Phase 5] Only caller of resume_and_reinstall_preempt_fences is the rebind worker in xe_vm.c (~line 569).
- [Phase 6] git describe HEAD → v7.3-rc4-27-gf0100363d8c37; make kernelversion → 7.3.0-rc4.
- [Phase 7] MAINTAINERS: Matthew Brost is Xe maintainer; he reviewed the patch.
- [Phase 8] Failure mode: production GuC RESUME without completed suspend; debug WARN only if CONFIG_DRM_XE_DEBUG.
- UNVERIFIED: no public user GPU-hang log for this exact race.
**YES**
drivers/gpu/drm/xe/xe_exec_queue_types.h | 12 ++++++++++++ drivers/gpu/drm/xe/xe_preempt_fence.c | 7 +++++++ drivers/gpu/drm/xe/xe_vm.c | 18 +++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_exec_queue_types.h +12 -0
@@ -139,6 +139,18 @@ struct xe_exec_queue {u32 seqno;/** @lr.link: link into VM's list of exec queues */ struct list_head link; +/** +* @lr.suspended: Tracks whether the consumer-issued suspend() +* succeeded and a matching resume() is still owed. suspend() can +* fail (e.g. killed/banned/wedged), leaving the queue +* un-suspended, so consumers must only resume() queues that were +* actually suspended. Set by the suspend caller on success and +* cleared by the resume caller. A queue is only ever suspended by +* a single consumer at a time (preempt-fence mode and hw engine +* group fault mode are mutually exclusive), so a single flag is +* sufficient. +*/ +bool suspended; } lr;#define XE_EXEC_QUEUE_TLB_INVAL_PRIMARY_GT 0
drivers/gpu/drm/xe/xe_preempt_fence.c +7 -0
@@ -63,6 +63,13 @@ static bool preempt_fence_enable_signaling(struct dma_fence *fence)struct xe_exec_queue *q = pfence->q; pfence->error = q->ops->suspend (q); +/* +* Record a successful suspend so the rebind worker only resumes queues +* that were actually suspended; a failed suspend() leaves the queue +* un-suspended and must not be paired with a resume(). +*/ +if (!pfence->error) +WRITE_ONCE (q->lr.suspended, true);queue_work (q->vm->xe->preempt_fence_wq, &pfence->preempt_work);return true; }
drivers/gpu/drm/xe/xe_vm.c +17 -1
@@ -195,7 +195,23 @@ static void resume_and_reinstall_preempt_fences(struct xe_vm *vm,xe_vm_assert_held (vm);list_for_each_entry (q, &vm->preempt.exec_queues, lr.link) { - q->ops->resume (q); +/* +* Only resume queues whose suspend() actually succeeded. A +* failed suspend() (e.g. killed/banned/wedged) leaves the queue +* un-suspended, so it must not be resumed. +* +* Also skip queues that have since been reset/killed/banned/ +* wedged: their suspend may not have completed (suspend_pending +* can still be set, e.g. a preempt fence signalled with -ENOENT +* without waiting), so resuming would trip the !suspend_pending +* assert in the backend. Such queues are being torn down anyway, +* so leave them marked suspended and let teardown resolve their +* state. +*/ +if (READ_ONCE (q->lr.suspended) && !q->ops->reset_status (q)) { +WRITE_ONCE (q->lr.suspended, false); + q->ops->resume (q); + }drm_gpuvm_resv_add_fence (&vm->gpuvm, exec, q->lr.pfence,DMA_RESV_USAGE_BOOKKEEP ,DMA_RESV_USAGE_BOOKKEEP );
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 riscv, bpf: Add support for BPF_SDIV and BPF_SMOD in RV32 JIT
In reply to Sasha LevinFrom: Kuan-Wei Chiu <[email protected]>
[ Upstream commit 2e0fa2389c50fd3a69bb738efa74e127b7516938 ]
The current rv32 bpf jit compiler incorrectly treats BPF_SDIV and BPF_SMOD as unsigned operations. The BPF instruction set allows signed division and modulo by reusing the BPF_DIV and BPF_MOD opcodes with the instruction offset set to 1.
Update the emit_alu_r32() function to accept an 'is_sdiv' variable and emit the correct div and rem instructions when the offset is 1.
Before this patch:
[ 44.161771] test_bpf: #165 ALU_SDIV_X: -6 / 2 = -3 jited:1 ret 2147483645 != -3 (0x7ffffffd != 0xfffffffd)FAIL (1 times) [ 44.167385] test_bpf: #166 ALU_SDIV_K: -6 / 2 = -3 jited:1 ret 2147483645 != -3 (0x7ffffffd != 0xfffffffd)FAIL (1 times) [ 44.171053] test_bpf: #169 ALU_SMOD_X: -7 % 2 = -1 jited:1 ret 1 != -1 (0x1 != 0xffffffff)FAIL (1 times) [ 44.172081] test_bpf: #170 ALU_SMOD_K: -7 % 2 = -1 jited:1 ret 1 != -1 (0x1 != 0xffffffff)FAIL (1 times)
After this patch:
[ 16.002192] test_bpf: #165 ALU_SDIV_X: -6 / 2 = -3 jited:1 95 PASS [ 16.002983] test_bpf: #166 ALU_SDIV_K: -6 / 2 = -3 jited:1 1059 PASS [ 16.017167] test_bpf: #169 ALU_SMOD_X: -7 % 2 = -1 jited:1 136 PASS [ 16.023002] test_bpf: #170 ALU_SMOD_K: -7 % 2 = -1 jited:1 109 PASS
---
LLM Generated explanations, may be completely bogus:
## Phase 1: Commit message forensics
**Step 1.1 — Subject**
Record: [riscv, bpf] [Add support] Treat BPF_SDIV/BPF_SMOD as signed in the RV32 JIT, not as unsigned DIV/MOD.
**Step 1.2 — Tags**
Record:
- Reviewed-by: Pu Lehui <[email protected]> (RISC-V BPF JIT reviewer; author of the RV64 signed-div JIT)
- Link: https://lore.kernel.org/bpf/20260714002451.4091139-2- [email protected]
- Signed-off-by: Kuan-Wei Chiu (author)
- Signed-off-by: Kumar Kartikeya Dwivedi (BPF maintainer, applied to bpf-next)
- No Fixes:, no Cc: stable, no Reported-by, no Tested-by on the commit itself (Tested-by: Pu Lehui is on the series cover)
- Absence of Fixes/Cc: stable is expected for this review and is not a negative signal
**Step 1.3 — Body**
Record: The RV32 JIT emits divu/remu for BPF_DIV/BPF_MOD even when insn->off == 1 (the BPF encoding for signed div/mod). Symptom is silent wrong results with the program still marked JIT’d (jited:1):-6 / 2 → 2147483645 instead of -3; -7 % 2 → 1 instead of -1. Root cause: offset field ignored. After: those test_bpf cases PASS.
**Step 1.4 — Hidden bug fix?**
Record: Yes. Title says “Add support”, but this is a JIT miscompilation fix. The JIT already handles DIV/MOD; it just uses the unsigned RISC-V ops. Cover-letter v3 dropped a Fixes: tag and retitled the series as enablement; that is framing, not a lack of a bug.
## Phase 2: Diff analysis
**Step 2.1 — Inventory**
Record: One file, arch/riscv/net/bpf_jit_comp32.c, +10/−5. Functions:emit_alu_r32() (signature + DIV/MOD cases), bpf_jit_emit_insn() (two call sites). Surgical, single-file.
**Step 2.2 — Flow**
Record:
- Before: emit_alu_r32(..., u8 op) always emits rv_divu / rv_remu.
- After: it takes const struct bpf_insn *insn, sets is_signed = insn->off == 1, and emits rv_div/rv_rem vs rv_divu/rv_remu.
- Callers pass insn instead of BPF_OP(code). Both register (BPF_X) and immediate (BPF_K) 32-bit DIV/MOD already go through this path (no RISC-V I-type div).
- 64-bit DIV/MOD on RV32 still goto notsupported (interpreter fallback). This patch does not touch that path.
**Step 2.3 — Bug mechanism**
Record: Logic/correctness. Signed vs unsigned opcode selected by insn->off. Not a leak, race, or UAF.
**Step 2.4 — Fix quality**
Record: Obviously correct and minimal. Regression risk is low: unsigned path is unchanged when off == 0; signed ops are the matching RISC-V M-extension instructions. No API or data-structure change. Minor nit:
commit text says an is_sdiv argument; the code uses is_signed from insn->off. Harmless.
## Phase 3: Git history
**Step 3.1 — Blame**
Record: Unsigned rv_divu/rv_remu in emit_alu_r32 come from 5f316b65e99f (“riscv, bpf: Add RV32G eBPF JIT”, 2020-03, **v5.7-rc1**). At that time BPF had no signed div. The encoding (off == 1) landed in ec0e2da95f72d (“bpf: Support new signed div/mod instructions.”, 2023-07, **v6.6-rc1**), which updated the interpreter and x86 JIT only. RV64 JIT followed in 3e18ff4bce9b5 (**v6.6-rc1**). RV32 stayed on unsigned emit until this commit.
**Step 3.2 — Fixes: tag**
Record: None on the landed commit. v1/v2 had a Fixes: tag; v3 removed it. CI bot later suggested Fixes: 5f316b65e99f; Pu Lehui replied that a Fixes tag was not needed. That objection is about blaming the 2020 JIT (which was correct then), not about whether today’s unsigned emit is wrong.
**Step 3.3 — File history / series**
Record: bpf-next v4 1/3 of “signed operations and 32-bit atomics”:
1. this SDIV/SMOD patch (2e0fa2389c50f)
2. BPF_MOVSX (c6a08afdfe3a8)
3. 32-bit atomics (a1b37972efc0b)
This patch does not depend on 2 or 3. Merge: 426a6befd01f9.
**Step 3.4 — Author**
Record: Kuan-Wei Chiu; not the RV32 JIT original author. Nearby work is this series only. Reviewer Pu Lehui is the established RISC-V BPF JIT contributor.
**Step 3.5 — Prerequisites**
Record: Needs rv_div() / rv_rem() in arch/riscv/net/bpf_jit.h (added by 3e18ff4bce9b5, present here). Needs emit_alu_r32 and 32-bit DIV/MOD cases (present since v5.7). Standalone on this tree.
## Phase 4: Mailing list
**Step 4.1 — Original discussion**
Record: Lore from b4 dig:https://patch.msgid.link/[email protected]
Revisions: v3 (2026-07-06) and v4 (2026-07-14). v3 changelog: pass insn into emit_alu_r32; **remove Fixes: tag and update title**. Applied version is v4 (latest). No NAK on this patch. No Cc: stable in the thread.
**Step 4.2 — Recipients**
Record: bpf@vger, linux-riscv, ast, daniel, andrii, eddyz87, memxor, palmer, aou, pulehui, martin.lau, yonghong.song, [email protected]. Right lists and maintainers. Reviewed-by Pu Lehui; applied by Kumar Kartikeya Dwivedi.
**Step 4.3 — Bug report**
Record: No syzbot/bugzilla. Evidence is in-tree test_bpf (#165, #166, #169, #170) plus Pu Lehui Tested-by on the cover. Cover also notes test_bpf.ko going to 0 failures on the author’s setup.
**Step 4.4 — Series**
Record: 1/3 is this fix. 2/3 (MOVSX) and 3/3 (atomics) are separate ISA- coverage patches. 3/3 is closer to a feature (more JIT’d atomics; interpreter already worked). This patch is self-contained.
**Step 4.5 — stable@**
Record: UNVERIFIED. lore.kernel.org returned 403 to HTTP fetch; the saved mboxes have no stable@ nomination.
## Phase 5: Semantic analysis
**Step 5.1 — Functions**
Record: emit_alu_r32, bpf_jit_emit_insn.
**Step 5.2 — Callers**
Record: emit_alu_r32 is only called from bpf_jit_emit_insn (ALU 32-bit X/K DIV/MOD/MUL/shifts, and NEG). bpf_jit_emit_insn is called from arch/riscv/net/bpf_jit_core.c during JIT of a loaded BPF program.
**Step 5.3 — Callees**
Record: bpf_get_reg32 / bpf_put_reg32, rv_div/rv_divu/rv_rem/rv_remu. No new locks or allocations.
**Step 5.4 — Reachability**
Record: Yes, from BPF program load on RV32 with CONFIG_BPF_JIT (HAVE_EBPF_JIT if MMU). Userspace that can load BPF (privileged; or unprivileged if enabled) can hit it. lib/test_bpf.c exercises it directly. With BPF_JIT_ALWAYS_ON, interpreter fallback is gone and a wrong JIT is the only path.
**Step 5.5 — Similar patterns**
Record: RV64 already branched on signed vs unsigned in bpf_jit_comp64.c. Interpreter in kernel/bpf/fixups.c uses insn->off == 1 the same way. ARM32 added 32-bit signed div in 5097faa559a60 (v6.7-rc1). RV32 64-bit SDIV is still not JIT’d (notsupported) — different, safe fallback.
## Phase 6: Local tree (this checkout)
**Step 6.1 — Does the buggy code exist here?**
Record: Local tree is **7.3.0-rc4** (v7.3-rc4-27-gf0100363d8c37). RV32 JIT, signed-div ISA, and rv_div/rv_rem are all present. The unsigned-only emit existed in this lineage from v6.6 until 2e0fa2389c50f (contained in **v7.3-rc1**). Current emit_alu_r32 already has is_signed = insn->off == 1. The bug class is in this tree’s history; the file this patch touches is here.
**Step 6.2 — Backport difficulty**
Record: Clean apply on this code. Pre-image matches the parent of 2e0fa2389c50f. Helpers already exist.
**Step 6.3 — Related fixes already here**
Record: This commit is already an ancestor of HEAD (landed in 7.3-rc1). That is origin-tree presence, not a reason to treat it as “already selected for stable.” No alternate RV32 SDIV fix. Later series patches (MOVSX, atomics) are independent.
## Phase 7: Subsystem context
**Step 7.1**
Record: arch/riscv/net BPF JIT. Criticality: **PERIPHERAL** for hardware (RV32 Linux with MMU), **IMPORTANT** for correctness of JIT’d BPF on that platform. Makefile: bpf_jit_comp32.o only when not CONFIG_ARCH_RV64I.
**Step 7.2**
Record: File is mature (since v5.7) with occasional ISA catch-up. Not a staging driver.
## Phase 8: Impact and risk
**Step 8.1 — Who**
Record: RV32 + BPF JIT users (embedded RISC-V with MMU). Not RV64. Not no-MMU (no eBPF JIT).
**Step 8.2 — Trigger**
Record: Loading/running a BPF program that uses 32-bit signed DIV or MOD (off == 1). Common in test_bpf; less common in production filters, but a valid ISA op since v6.6. Typically requires BPF-load privilege.
**Step 8.3 — Failure mode**
Record: Silent wrong ALU result while still reporting jited:1. Not a panic. Wrong packet/cgroup/seccomp decisions are possible if a program uses signed div. Severity: **HIGH** for correctness, not CRITICAL crash/corruption of kernel memory.
**Step 8.4 — Risk/benefit**
Record: Benefit: correct 32-bit signed div/mod on RV32 JIT; test_bpf failures gone. Risk: very low (~10 lines, ALU emit only, unsigned path unchanged). Ratio: favorable.
## Phase 9: Synthesis
**Evidence FOR**
- JIT emits unsigned ops for a signed encoding; programs get wrong answers and still count as JIT’d.
- Reproduced by test_bpf; reviewed and tested by Pu Lehui.
- Small, obviously correct, no new UAPI.
- Independent of the rest of the series.
- All helpers and call sites exist in this tree.
- Same class of ISA handling RV64 and the interpreter already do.
**Evidence AGAINST**
- Subject/cover are “Add support”; sent to bpf-next, not bpf.
- Maintainer said a Fixes tag was not needed (“not a bugfix”) — aimed at the 2020 JIT commit, which predates signed div.
- RV32 is a small user base; 64-bit SDIV still not JIT’d (safe fallback).
- Not a crash, deadlock, or kernel memory-safety bug.
**Unresolved**
- UNVERIFIED: whether stable@ ever discussed this (lore HTTP 403).
- UNVERIFIED: exact v1/v2 subject/Fixes SHA (v3 changelog confirms a Fixes tag was removed).
**Stable rules**
1. Obviously correct and tested? **PASS** — review + test_bpf before/after + Tested-by.
2. Real bug affecting users? **PASS** — wrong JIT output for a valid insn, not a new opcode.
3. Important? **PASS** — silent miscompilation of ALU; high correctness impact, not a panic.
4. Small and contained? **PASS** — one file, ~10 lines.
5. No new features/APIs? **PASS** — selects existing RISC-V div/rem when off==1; BPF ISA already has this encoding.
6. Applies to this tree? **PASS** — file, helpers, and DIV/MOD path are here.
**Exception category:** none (not an ID/quirk/DT/build/doc patch).
The “add support” wording is leftover from a feature series. Behavior is a JIT bug: the compiler accepts SDIV/SMOD and emits the wrong RISC-V instruction. That is appropriate for this tree.
Verification:
- [Phase 1] Parsed tags: Reviewed-by Pu Lehui; Link to bpf lore; no Fixes/Cc: stable/Reported-by
- [Phase 1] Body documents test_bpf #165/#166/#169/#170 wrong results with jited:1
- [Phase 2] Diff: emit_alu_r32 takes insn; is_signed = insn->off == 1; rv_div/rv_rem vs divu/remu; two call-site updates
- [Phase 2] Confirmed 64-bit DIV/MOD still goto notsupported (no incomplete 64-bit signed path)
- [Phase 3] git blame on parent: unsigned emit from 5f316b65e99f (v5.7-rc1)
- [Phase 3] ec0e2da95f72d added signed div ISA in v6.6-rc1; RV64 JIT 3e18ff4bce9b5 same cycle
- [Phase 3] git describe --contains 2e0fa2389c50f → v7.3-rc1~...; git merge-base --is-ancestor confirms it is in HEAD
- [Phase 3] Series 2/3 and 3/3 are independent; no prerequisite besides rv_div/rv_rem (present)
- [Phase 4] b4 dig -c 2e0fa2389c50f: patch-id match; v3 and v4; applied v4 1/3
- [Phase 4] b4 dig -w: bpf + linux-riscv + BPF/RISC-V maintainers
- [Phase 4] v3 mbox: CI suggested Fixes: 5f316b65e99f; Pu Lehui: “not need to add fixes tag, as this not a bugfix”; Pu Reviewed-by on the code
- [Phase 4] Cover: “Remove the Fixes: tag and update title”; Tested-by Pu Lehui
- [Phase 4] WebFetch lore: 403 Forbidden — discussion taken from b4 mboxes instead
- [Phase 5] Callers: only bpf_jit_emit_insn; JIT compile path from bpf_jit_core.c
- [Phase 5] lib/test_bpf.c has ALU_SDIV_* / ALU_SMOD_* cases matching the commit
- [Phase 6] make kernelversion / git describe HEAD: 7.3.0-rc4 / v7.3-rc4-27-gf0100363d8c37
- [Phase 6] arch/riscv/net/Makefile: comp32 used when not RV64I; HAVE_EBPF_JIT if MMU
- [Phase 6] Current file already has the signed emit (commit ancestor of HEAD)
- [Phase 8] Failure mode: wrong 32-bit signed div/mod in JIT’d BPF; severity HIGH correctness
- UNVERIFIED: stable@ mailing list history (lore 403)
The patch is a small, tested JIT correctness fix for a real miscompile on RV32. It meets stable rules for this tree.
**YES**
arch/riscv/net/bpf_jit_comp32.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
arch/riscv/net/bpf_jit_comp32.c +10 -5
@@ -509,12 +509,15 @@ static void emit_alu_r64(const s8 *dst, const s8 *src, }static void emit_alu_r32 (const s8 *dst,const s8 *src, -struct rv_jit_context *ctx,const u8 op) +struct rv_jit_context *ctx, +const struct bpf_insn *insn) {const s8 *tmp1 = bpf2rv32[TMP_REG_1 ];const s8 *tmp2 = bpf2rv32[TMP_REG_2 ];const s8 *rd =bpf_get_reg32 (dst, tmp1, ctx);const s8 *rs =bpf_get_reg32 (src, tmp2, ctx); +u8 op =BPF_OP (insn->code); +bool is_signed = insn->off ==1 ;switch (op) {case BPF_MOV :
@@ -539,10 +542,12 @@ static void emit_alu_r32(const s8 *dst, const s8 *src,emit (rv_mul (lo (rd),lo (rd),lo (rs)), ctx);break ;case BPF_DIV : -emit (rv_divu (lo (rd),lo (rd),lo (rs)), ctx); +emit (is_signed ?rv_div (lo (rd),lo (rd),lo (rs)) : +rv_divu (lo (rd),lo (rd),lo (rs)), ctx);break ;case BPF_MOD : -emit (rv_remu (lo (rd),lo (rd),lo (rs)), ctx); +emit (is_signed ?rv_rem (lo (rd),lo (rd),lo (rs)) : +rv_remu (lo (rd),lo (rd),lo (rs)), ctx);break ;case BPF_LSH :emit (rv_sll (lo (rd),lo (rd),lo (rs)), ctx);
@@ -1041,7 +1046,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,emit_imm32 (tmp2, imm, ctx); src = tmp2; } -emit_alu_r32 (dst, src, ctx,BPF_OP (code)); +emit_alu_r32 (dst, src, ctx, insn);break ;case BPF_ALU |BPF_MOV |BPF_K :
@@ -1065,7 +1070,7 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn, struct rv_jit_context *ctx,* src is ignored---choose tmp2 as a dummy register since it * is not on the stack. */ -emit_alu_r32 (dst, tmp2, ctx,BPF_OP (code)); +emit_alu_r32 (dst, tmp2, ctx, insn);break ;case BPF_ALU |BPF_END |BPF_FROM_LE :
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 tpm: tpm_tis_spi: fix nodef CR50 tpm_tis_spi_resume is null
In reply to Sasha LevinFrom: Li Jun <[email protected]>
[ Upstream commit b4d1adc70471d0752bba674552d19971ed9fa869 ]
if no define CONFIG_TCG_TIS_SPI_CR50 in config,
the add of tpm_tis_spi_resume is null, this cause the tpm chip to fail to resume.
---
LLM Generated explanations, may be completely bogus:
Local tree is **6.12.111** (p-6.12-3-gc504cf0baa3d8). The SPI TPM header still defines tpm_tis_spi_resume as NULL unless CR50 is built, so this resume bug is present here.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: **[tpm / tpm_tis_spi] [fix] CR50 not defined leaves tpm_tis_spi_resume NULL**
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- **Fixes:** none (expected; not a negative signal)
- **Reported-by:** none
- **Tested-by:** none
- **Reviewed-by:** Jarkko Sakkinen <[email protected]> (TPM maintainer)
- **Acked-by:** none
- **Link:** https://lore.kernel.org/r/20260812100914.3540149-1- [email protected]
- **Cc: stable:** none (expected)
- **Signed-off-by:** Li Jun <[email protected]> (author); Jarkko Sakkinen (maintainer)
- Ignore pipeline-added Sasha Levin SOB / Upstream-commit markers if present
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- **Bug:** Without CONFIG_TCG_TIS_SPI_CR50, tpm_tis_spi_resume is #defined to NULL.
- **Symptom/failure mode:** SPI TPM chip fails to resume after system sleep.
- **Version info:** none in the message.
- **Root cause:** Resume callback is compiled in only for CR50, but SIMPLE_DEV_PM_OPS in tpm_tis_spi_main.c always uses tpm_tis_spi_resume for every SPI TIS device.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not hidden. This is an explicit resume-path bug fix. The wording is poor English, but the claimed failure is concrete.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- **File:** drivers/char/tpm/tpm_tis_spi.h only (~+6 / −2)
- **Functions:** none; preprocessor selection of the resume callback
- **Scope:** single-file surgical header change
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- **Before:** #if CONFIG_PM_SLEEP && CONFIG_TCG_TIS_SPI_CR50 → extern tpm_tis_spi_resume; else → #define tpm_tis_spi_resume NULL.
- **After:**
- CONFIG_PM_SLEEP && CR50 → CR50 tpm_tis_spi_resume (resets wake_after, then tpm_tis_resume)
- CONFIG_PM_SLEEP && !CR50 → #define tpm_tis_spi_resume tpm_tis_resume
- !CONFIG_PM_SLEEP → still NULL
- **Path:** system sleep resume for tpm_tis_spi (SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_spi_resume)).
Step 2.3: IDENTIFY THE BUG MECHANISM
Record:
- **Category:** logic / PM correctness (missing resume callback)
- **Mechanism:** tpm_pm_suspend() sets TPM_CHIP_FLAG_SUSPENDED. With a NULL .resume, that flag is never cleared. tpm_try_get_ops() then returns -EIO (rc starts as -EIO and the SUSPENDED branch jumps to out_lock without starting the chip). TPM 1.2 self-test / IRQ re- enable in tpm_tis_resume() are skipped as well.
- **Fix:** restore the pre-CR50 callback (tpm_tis_resume), which Infineon/ST/Atmel SPI TIS used before 797c0113c9a48.
Step 2.4: ASSESS THE FIX QUALITY
Record:
- Obviously correct: aliases the existing exported tpm_tis_resume already used by tpm_tis.c and tpm_tis_i2c.c.
- tpm_tis_spi.h includes tpm_tis_core.h, which declares tpm_tis_resume under CONFIG_PM_SLEEP — same gate as the new #define.
- Nested #if indentation is ugly kernel style, not a functional risk. Jarkko accepted it as-is.
- **Regression risk:** very low. CR50 path unchanged. Non-CR50 path restored to the historical, still-current TIS resume helper.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record:
- Introduced by **797c0113c9a48** (tpm: tpm_tis_spi: Support cr50 devices, Andrey Pronin / Stephen Boyd, 2019-11-12).
- git blame -L 43,47 drivers/char/tpm/tpm_tis_spi.h attributes the #if ... && CR50 / #define ... NULL block entirely to that commit.
- Present since v5.5-era CR50 support; long-lived in this 6.12 tree.
Step 3.2: FOLLOW THE FIXES: TAG
Record: No Fixes: tag. The introducing commit is 797c0113c9a48. git merge-base --is-ancestor 797c0113c9a48 HEAD succeeded — it is in this tree. Before that commit, tpm_tis_spi.c used SIMPLE_DEV_PM_OPS(..., tpm_tis_resume) (verified with git show 797c0113c9a48^:drivers/char/tpm/tpm_tis_spi.c).
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record:
- git log --oneline -S tpm_tis_spi_resume -- drivers/char/tpm/ only shows 797c0113c9a48. No later rewrite of this symbol in this tree.
- Header history besides that is unrelated (6422cbd3c52de phy_ops cleanup).
- Standalone; not patch X/Y.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: git log --author='Li Jun' -- drivers/char/tpm/ is empty in this tree. Author is an outside contributor. Weight comes from **Reviewed-by / Signed-off-by Jarkko Sakkinen**, TPM DEVICE DRIVER maintainer.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: None. The #define uses tpm_tis_resume, present since **41a5e1cf1fe15** (2016, tpm/tpm_tis: Split tpm_tis driver into a core...). Can apply standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- b4 mbox [email protected] saved a 2-message thread (lore WebFetch returned 403; b4 succeeded).
- Submission: Li Jun, 12 Aug 2026, [PATCH] tpm: tpm_tis_spi: fix nodef CR50 tpm_tis_spi_resume is null
- Reply: Jarkko Sakkinen, 21 Aug 2026: **Reviewed-by: Jarkko Sakkinen** — no NAK, no requested changes, no extra revisions.
- b4 dig -a on the CR50 introducer was attempted; lore search from b4 returned a server error. Not needed for this candidate (the 2026 thread was retrieved directly).
- No Cc: stable in the thread.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record: Recipients were [email protected], [email protected], [email protected], [email protected] — the TPM maintainer set. Jarkko reviewed.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: No syzbot/bugzilla. The report is the patch itself: Kylinos hit resume failure with CR50 disabled. Severity from author: TPM chip fails to resume.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: Standalone [PATCH], not a series. No follow-up in that thread.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: WebSearch of lore.kernel.org/stable for this subject found no prior stable discussion. Nothing indicating it was rejected.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: No function body edited. Symbols involved: tpm_tis_spi_resume (header), used as resume callback; fallback tpm_tis_resume.
Step 5.2: TRACE CALLERS
Record:
- Only caller: drivers/char/tpm/tpm_tis_spi_main.c:310 static SIMPLE_DEV_PM_OPS(tpm_tis_pm, tpm_pm_suspend, tpm_tis_spi_resume);
- Wired as .pm = &tpm_tis_pm on tpm_tis_spi_driver.
- Invoked by the PM core on system suspend/resume/hibernation (.suspend/.resume/.freeze/.thaw/.poweroff/.restore via SYSTEM_SLEEP_PM_OPS).
- Context: process context, PM not IRQ.
Step 5.3: TRACE CALLEES
Record:
- CR50 tpm_tis_spi_resume: reset phy->wake_after = jiffies, then tpm_tis_resume(dev).
- tpm_tis_resume: tpm_chip_start → optional IRQ re-enable → TPM 1.2 tpm1_do_selftest → tpm_chip_stop → tpm_pm_resume (clears TPM_CHIP_FLAG_SUSPENDED).
- Generic fallback after this patch is exactly tpm_tis_resume.
Step 5.4: FOLLOW THE CALL CHAIN
Record: Userspace/system suspend (echo mem > /sys/power/state, systemd suspend, etc.) → PM core → tpm_pm_suspend (always registered) → later resume callback. Reachable on any board with CONFIG_TCG_TIS_SPI + CONFIG_PM_SLEEP and no CR50. After the broken resume, /dev/tpm0, hwrng, and key operations fail via tpm_try_get_ops() → -EIO.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: Sibling TIS phys already use tpm_tis_resume (tpm_tis.c:249, tpm_tis_i2c.c:322, tpm_tis_synquacer.c:110). Only SPI TIS lost that callback when CR50 was optional. The header already stubs cr50_spi_probe with -ENODEV when CR50 is off; resume was not stubbed equivalently.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: **Yes.** drivers/char/tpm/tpm_tis_spi.h:43-47 is the exact pre-patch #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_TCG_TIS_SPI_CR50) / #define tpm_tis_spi_resume NULL block. Bug since 797c0113c9a48 (2019). Candidate is **not** already in this tree (git log --grep='fix nodef CR50' / 'tpm_tis_spi_resume is null' empty).
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: **Clean apply.** Current header matches the patch’s old side. No later refactor of this #ifdef in 6.12.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: No alternate resume fix. Recent TPM SPI change here is unrelated (bb63a0530e8e6 wait_woken).
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: **TPM character driver** (drivers/char/tpm/). **IMPORTANT** — not core mm/VFS, but security hardware used for measured boot, keys, hwrng. SPI TIS is the usual driver for discrete TPMs on embedded boards (SLB9670, ST33HTPM, ATTPM20P).
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: Actively maintained (many 6.12 TPM stable-style fixes). The buggy #ifdef itself has been untouched since 2019.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: **Driver-specific / config-specific.** Users with CONFIG_TCG_TIS_SPI=y/m, CONFIG_PM_SLEEP=y, and **CONFIG_TCG_TIS_SPI_CR50 unset** (Kconfig bool, default n). Chromebooks with CR50 enabled are unaffected. Infineon/ST/Atmel SPI TPM boards (common on ARM/embedded) are the hit.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Any system sleep/hibernation of that SPI TPM. Common on laptops/SBCs that suspend. Unprivileged users typically cannot suspend; after resume, any user of /dev/tpm0 sees failures. Not a race.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record:
- **Failure mode:** TPM stays TPM_CHIP_FLAG_SUSPENDED; ops return -EIO. Device does not come back after suspend. TPM 1.2 also skips resume self-test.
- **Severity: HIGH** (device dead after suspend; security hardware). Not a panic, but a hard functional break of the TPM until reboot.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- **Benefit: high** for SPI TPM + suspend without CR50 — restores post- resume TPM.
- **Risk: very low** — 6-line header, CR50 path unchanged, fallback is the same function other TIS drivers already use.
- **Ratio:** strongly favors backport.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Real user-visible bug: SPI TPM does not resume unless CR50 is compiled in.
- Regression vs pre-2019 tpm_tis_resume usage, introduced by optional CR50 support.
- Bug and introducing commit are in this 6.12 tree.
- Tiny, obviously correct, applies cleanly.
- TPM maintainer Reviewed-by.
- Failure is -EIO on all TPM ops after suspend (verified in tpm_try_get_ops).
AGAINST:
- Commit message is terse / no Fixes:/stable tags (not a reason to reject).
- Nested #if style is non-idiomatic (no runtime risk).
- Not a crash/UAF; “only” a device that stays unusable after suspend.
- Affects a subset of TPM users (SPI, no CR50).
UNRESOLVED:
- Could not WebFetch lore (403); thread was recovered with b4 mbox.
- No independent bugzilla/syzbot report.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? **PASS** — alias to existing helper; maintainer reviewed.
2. Fixes a real bug that affects users? **PASS** — author reports TPM resume failure; code confirms NULL resume + sticky SUSPENDED.
3. Important issue? **PASS** — HIGH: TPM unusable after suspend (security device / -EIO on all ops).
4. Small and contained? **PASS** — one header, ~6 lines.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** — exact match, no prereqs.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: Not an ID/quirk/DT/build/docs exception. Ordinary small bugfix.
Step 9.4: MAKE YOUR DECISION
This belongs in 6.12. The driver suspends the TPM, then installs a NULL resume whenever CR50 is off, so the chip never leaves TPM_CHIP_FLAG_SUSPENDED. The patch restores tpm_tis_resume for that config, which is what this driver used before CR50 and what sibling TIS drivers still use.
**What it solves for stable users:** After suspend, SPI TPMs (SLB9670 and similar) work again without requiring CONFIG_TCG_TIS_SPI_CR50.
**Rules:** Small, correct, real functional/security-device bug, no new API, clean apply.
**Risk vs benefit:** Very low risk, high benefit for the affected config.
**Concerns:** None that block backport. Style of nested #if is cosmetic.
Verification:
- [Phase 1] Tags: Reviewed-by Jarkko Sakkinen; Link lore Message-ID [email protected]; no Fixes/Reported- by/Cc:stable
- [Phase 2] Diff: tpm_tis_spi.h only; #define tpm_tis_spi_resume tpm_tis_resume when PM_SLEEP && !CR50
- [Phase 2] tpm_tis_spi_main.c:310 SIMPLE_DEV_PM_OPS(..., tpm_tis_spi_resume) verified
- [Phase 2] tpm_try_get_ops() returns -EIO if TPM_CHIP_FLAG_SUSPENDED (tpm-chip.c:159-174)
- [Phase 2] tpm_pm_suspend sets that flag; tpm_pm_resume/tpm_tis_resume clear it
- [Phase 3] blame: 797c0113c9a48 (2019); git merge-base --is-ancestor confirms it is in this tree
- [Phase 3] pre-CR50 file used tpm_tis_resume in SIMPLE_DEV_PM_OPS
- [Phase 3] candidate not in this tree (git log --grep empty)
- [Phase 4] b4 mbox: 2-message thread; Jarkko Reviewed-by; no NAK
- [Phase 4] lore WebFetch 403 — UNVERIFIED via HTTP, recovered via b4
- [Phase 4] no stable-list discussion found
- [Phase 5] callers: only tpm_tis_spi PM ops; siblings already use tpm_tis_resume
- [Phase 6] git describe HEAD → p-6.12-3-gc504cf0baa3d8; make kernelversion → 6.12.111; buggy #ifdef present; patch old-side matches
- [Phase 7] TPM DEVICE DRIVER, maintainer Jarkko
- [Phase 8] Failure: TPM dead after suspend (-EIO), severity HIGH; risk very low
- UNVERIFIED: whether linus/master already contains a later stylistic rewrite of this header (GitHub search snippet still showed the old #ifdef; does not affect this 6.12 checkout)
**YES**
drivers/char/tpm/tpm_tis_spi.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_tis_spi.h +6 -2
@@ -40,8 +40,12 @@ static inline int cr50_spi_probe(struct spi_device *spi) }#endif -#if defined(CONFIG_PM_SLEEP ) && defined(CONFIG_TCG_TIS_SPI_CR50 ) -extern int tpm_tis_spi_resume (struct device *dev); +#if defined(CONFIG_PM_SLEEP ) +#if defined(CONFIG_TCG_TIS_SPI_CR50 ) +extern int tpm_tis_spi_resume (struct device *dev); +#else +#define tpm_tis_spi_resume tpm_tis_resume +#endif #else #define tpm_tis_spi_resume NULL#endif
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 KVM: x86/xen: Prevent runstate times from becoming negative
In reply to Sasha LevinFrom: David Woodhouse <[email protected]>
[ Upstream commit 36a85200643e62d20a91f0bc1a811187b59f7762 ]
When kvm_xen_update_runstate() is invoked to set a vCPU's runstate, the time spent in the previous runstate is accounted. This is based on the delta between the current KVM clock time, and the previous value stored in vcpu->arch.xen.runstate_entry_time.
If the KVM clock goes backwards, that delta will be negative. Or, since it's an unsigned 64-bit integer, very *large*. Linux guests deal with that particularly badly, reporting 100% steal time for ever more (well, for *centuries* at least, until the delta has been consumed).
So when a negative delta is detected, just refrain from updating the runstate times until the KVM clock catches up with runstate_entry_time again.
Also clamp steal_ns to delta_ns to prevent steal time from exceeding the total elapsed time, and handle negative steal_ns (which can happen if run_delay goes backwards across a scheduler update).
The userspace APIs for setting the runstate times do not allow them to be set past the current KVM clock, but userspace can still adjust the KVM clock *after* setting the runstate times, which would cause this situation to occur.
---
LLM Generated explanations, may be completely bogus:
The local tree is **6.18.53** (pending-6.18). The buggy unsigned runstate math is in this checkout; the candidate fix is not. This is a small, self-contained guest steal-time wraparound fix and should be backported here.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
- Subsystem: KVM: x86/xen
- Action verb: **Prevent**
- Claimed intent: stop Xen runstate accounting from wrapping when kvmclock or steal time goes backwards
Record: [KVM x86/xen] [prevent] [runstate times wrapping to huge unsigned values / 100% guest steal]
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
- Fixes: none (expected for this review pipeline)
- Reported-by: none
- Tested-by: none
- Reviewed-by: Paul Durrant <[email protected]> (Xen maintainer)
- Acked-by: none
- Link: https://patch.msgid.link/20260728144954.355376-21- [email protected]
- Cc: stable: none (expected)
- Signed-off-by: David Woodhouse <[email protected]> (author; KVM Xen author)
- Signed-off-by: Sean Christopherson <[email protected]> (KVM x86 maintainer; applied)
- Ignore: any pipeline “Upstream commit” / Sasha Levin SOB if present
Record: Reviewed by Xen maintainer, applied by KVM x86 maintainer. Link shows **v7 20/36** of “Cleaning up the KVM clock mess”. No syzbot, no user Reported-by.
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Bug: kvm_xen_update_runstate() accounts time as now - runstate_entry_time in a u64. If kvmclock goes backwards, that delta wraps to ~2^64 ns. Linux guests then show **100% steal time for centuries**.
Triggers described:
1. kvmclock going backwards
2. userspace KVM_SET_CLOCK after runstate times were set (the SET_ATTR APIs reject entry_time in the future, but clock can be moved afterwards)
3. steal_ns negative if sched_info.run_delay goes backwards
Fix: treat deltas as signed; skip time accounting while delta is negative (leave runstate_entry_time so a later positive delta covers the gap); clamp steal to elapsed time; ignore negative steal.
Record: [unsigned wrap of runstate/steal] [guest 100% steal forever] [no version pin] [root cause: unsigned kvmclock/run_delay subtraction]
**Step 1.4: DETECT HIDDEN BUG FIXES**
Not disguised. Explicit correctness fix for wraparound.
Record: [Not a hidden fix; it is a stated wraparound/steal-time bug fix]
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
- File: arch/x86/kvm/xen.c only
- Scope: ~22 insertions / ~6 deletions in one function
- Function: kvm_xen_update_runstate()
- Classification: single-file surgical fix
Record: [xen.c +22/-6] [kvm_xen_update_runstate] [surgical]
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Before (this tree, lines 587–616):
```c u64 delta_ns = now - vx->runstate_entry_time; ... u64 steal_ns = run_delay - vx->last_steal; delta_ns -= steal_ns; vx->runstate_times[RUNSTATE_runnable] += steal_ns; vx->runstate_times[vx->current_runstate] += delta_ns; vx->runstate_entry_time = now; ```
Any now < entry_time or run_delay < last_steal wraps and adds a huge value.
After:
- s64 delta_ns, s64 steal_ns
- delta_ns < 0 → update current runstate + last_steal only; do not touch times or entry_time
- steal applied only if steal_ns > 0, and clamped to delta_ns
- last_steal always updated (even on the skip path)
Record: [unsigned wrap → skip/clamp signed accounting; guest cache still updated]
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Category: **logic / type (unsigned wrap) + guest-visible accounting corruption**
Mechanism:
- u64 subtraction underflows to ~2^64 ns
- Guest xen_steal_clock() is runnable + offline (drivers/xen/time.c)
- Huge runnable/offline → 100% steal until that delta is “consumed”
Record: [unsigned wrap] [skip negative kvmclock delta; clamp/ignore bad steal_ns]
**Step 2.4: ASSESS THE FIX QUALITY**
Obviously correct: steal cannot exceed elapsed time; negative elapsed time must not be accounted. Minimal. No API/struct change. Regression risk is low: a backward clock window is not accounted until kvmclock catches up, then one positive delta covers it. Neighboring kvm_xen_inject_vcpu_vector() in the posted context uses a 3-arg kvm_irq_delivery_to_apic; this tree has a 4th NULL — that function is **not** in the changed hunk.
Record: [high quality, surgical] [low regression risk]
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Entire function blamed to 5ec3289b31ab9 (“Compatibility fixes for shared runstate area”, 2022-11-18), originally added in 30b5c851af799 (“Add support for vCPU runstate information”, 2021-03-01, **v5.12-rc2**).
Record: [30b5c851af799 / 5ec3289b31ab9] [first appeared v5.12; this shape since v6.2]
**Step 3.2: FOLLOW THE FIXES: TAG**
No Fixes: tag.
Record: [N/A — no Fixes: tag] [introducer is in this tree]
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES** Recent xen.c commits are unrelated (schedop poll, event channels, timers). No later runstate accounting rewrite in this tree.
Record: [no conflicting local rework] [standalone vs local xen.c history]
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
David Woodhouse is the author of KVM Xen runstate (Amazon). Related history is the original runstate feature and later Xen timer/deadlock fixes. This is a maintainer-area fix.
Record: [primary KVM Xen runstate author] [this is a follow-on to his 2021 accounting]
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS** Posted as **v7 20/36** of the kvmclock cleanup series. Cover letter (verified): fixes/cleanups are ordered **not** to depend on the later new uAPI. Cover-letter stat for xen.c is 28 +-, matching **only this patch**. Later patches do not change this function. Local function body matches the patch “before” exactly.
Record: [no code prerequisites in this tree] [can apply standalone]
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
- b4 dig -c on the candidate SHA failed: 36a85200643e is **not** in this object store (git merge-base --is-ancestor exit 1)
- Found via search: [PATCH v7 20/36] on LKML/Patchew
- Cover letter: https://lkml.iu.edu/2607.3/08309.html — “Cleaning up the KVM clock mess”
- Patch: https://lkml.iu.edu/2607.3/08399.html
- kvm-x86 commit: 36a85200643e62d20a91f0bc1a811187b59f7762
- lore.kernel.org fetches returned 403; used LKML/Patchew mirrors
v7 vs v6: same runstate hunk (v6 was 26/36; v7 reordered). No NAK on this patch in the retrieved pages. Reviewed-by: Paul Durrant already on the submission.
Record: [lore msgid 20260728144954.355376-21] [v6→v7 reorder, same diff] [no NAK found] [no reviewer Cc: stable on this patch]
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Paul Durrant (Xen). Sean Christopherson applied. Series was on kvm/xen lists (from msgid/patchew).
Record: [Paul Durrant review; Sean applied]
**Step 4.3: SEARCH FOR THE BUG REPORT**
No syzbot/bugzilla. Bug is described from Xen-on-KVM steal accounting (author is the feature owner). Guest symptom matches xen_steal_clock().
Record: [no public user bugzilla] [author-described production-style steal blow-up]
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Series problem statement includes kvmclock **discontinuities** (masterclock re-snapshot yanking guest time) and imprecise KVM_SET_CLOCK migration. Patch 36 is a Xen runstate migration selftest. This hunk is the only xen.c change and does not need the new KVM_[GS]ET_CLOCK_GUEST API.
Record: [thematic series; this patch is standalone] [do not need the other 35 patches for this tree]
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
lore.kernel.org/stable returned 403.
Record: [UNVERIFIED: no stable@ thread retrieved]
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF**
Record: [kvm_xen_update_runstate]
**Step 5.2: TRACE CALLERS**
- kvm_xen_runstate_set_running() ← record_steal_time() in arch/x86/kvm/x86.c when kvm_xen_msr_enabled() (vCPU enter)
- kvm_xen_runstate_set_preempted() ← kvm_arch_vcpu_put() (preempt path)
- kvm_xen_vcpu_set_attr() KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT and ..._ADJUST (VMM ioctl)
Hot path for Xen-enabled KVM guests, plus userspace restore.
Record: [vCPU enter/put + Xen runstate ioctls]
**Step 5.3: TRACE CALLEES**get_kvmclock_ns(), kvm_xen_update_runstate_guest() (writes guest runstate area). No new locks/allocs.
Record: [kvmclock read + optional guest shared-area update]
**Step 5.4: FOLLOW THE CALL CHAIN**
Reachable from normal vCPU run when CONFIG_KVM_XEN and Xen MSR/hypercall page are enabled. Userspace can also move kvmclock via KVM_SET_CLOCK (kvm_vm_ioctl_set_clock in this tree). The REALTIME flag tries to avoid stepping backwards, but a plain KVM_SET_CLOCK still sets kvmclock_offset = data.clock - now_raw_ns with no monotonicity check.
Record: [reachable from VMM + guest vCPU run] [KVM_SET_CLOCK can move clock back]
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Guest steal: drivers/xen/time.c xen_steal_clock() = runnable + offline. Same wrap on steal_ns would inflate runnable. This tree already rejects SET_ATTR runstate entry_time **after** current kvmclock (lines 1039–1043, 1080–1085) but not clock changes afterwards.
Record: [guest steal uses runnable+offline] [SET_ATTR future-time check exists; SET_CLOCK hole remains]
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Yes. arch/x86/kvm/xen.c kvm_xen_update_runstate() still uses u64 delta_ns / u64 steal_ns.
- Tree: pending-6.18, make kernelversion = **6.18.53**
- Introducer 30b5c851af799 is an ancestor
- Candidate 36a85200643e is **not** an ancestor
Record: [buggy code present at xen.c:587–616] [since v5.12]
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Function text matches the patch before-image. Expected **clean apply**.
Record: [clean apply]
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
No “Prevent runstate times” commit. kvmclock cleanup series not in this tree (git log --grep empty). 6.18 still has the masterclock discontinuity issue that series describes.
Record: [no substitute fix present]
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY** arch/x86/kvm/xen.c — KVM Xen PV ABI emulation. **IMPORTANT** for Xen- on-KVM (cloud/QEMU), not core mm/vfs. CONFIG_KVM_XEN defaults to “If in doubt, N” but is a real production option (author is Amazon; header copyright Amazon/Oracle).
Record: [KVM Xen] [IMPORTANT, config-specific]
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Mature feature (v5.12+), ongoing Xen timer/evtchn fixes. Not staging.
Record: [mature, still maintained]
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Xen-ABI KVM guests with runstate/steal enabled (CONFIG_KVM_XEN + VMM setup). Not all KVM users.
Record: [config/driver-specific: KVM Xen guests]
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
1. KVM_SET_CLOCK (live migration/snapshot) after runstate SET_ATTR — documented, exists in this tree
2. kvmclock discontinuities from masterclock re-snapshot — still present here; the rest of the series is **not**
3. run_delay < last_steal unsigned wrap (ioctl uses VMM current; vCPU path uses the vCPU task)
Unprivileged guest cannot call KVM_SET_CLOCK; the VMM can. Guest then sees broken steal forever.
Record: [migration/SET_CLOCK and steal wrap] [realistic in production Xen-on-KVM] [VMM-triggered, guest-visible]
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Not a host oops. Guest scheduler steal accounting becomes permanently wrong (100% steal for ~centuries). That breaks guest CPU accounting, load, and can stall workloads/watchdogs. **HIGH** for those guests (not host CRITICAL).
Record: [guest steal corruption / apparent 100% steal] [HIGH]
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Benefit: stops a permanent guest-visible accounting failure on a path used in migration. Risk: ~20 lines, no locking/API change, skip- accounting is conservative.
Record: [high benefit for Xen-on-KVM] [very low risk] [favorable]
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
FOR:
- Real wraparound; guest xen_steal_clock() turns it into 100% steal for centuries
- Buggy u64 math is in this 6.18.53 tree since v5.12
- Trigger exists here: KVM_SET_CLOCK after runstate setup; masterclock yanks; steal_ns wrap
- Small, obviously correct, applies cleanly
- Reviewed by Paul Durrant; applied by Sean Christopherson
- Standalone; series cover letter says these cleanups do not depend on later uAPI
- This tree does **not** have the rest of the kvmclock series, so discontinuities remain
AGAINST:
- Part of a 36-patch series (subject 20/36) — but verified independent
- No Fixes:/Cc: stable (not a negative per rules)
- No crash/CVE; Xen-specific
- No public multi-user Reported-by
- CONFIG_KVM_XEN is optional
UNRESOLVED:
- Direct lore.kernel.org and stable@ search 403
- b4 dig could not use a local candidate SHA
- Did not independently reproduce 100% steal (author claim + guest steal formula are consistent)
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — signed math + clamp; reviewed; in kvm-x86
2. Fixes a real bug that affects users? **PASS** — guest steal blow-up on kvmclock/steal wrap
3. Important issue? **PASS** — permanent 100% steal is a serious guest functional failure (HIGH, not host panic)
4. Small and contained? **PASS** — one function, ~28 lines
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — buggy code present, before- image matches
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Not a device-ID/quirk/DT/build/doc exception. Ordinary correctness fix.
**Step 9.4: DECISION**
Backport to **this** 6.18.53 tree. The series around it is not needed; the bug and the trigger are here.
------------------------------------------------
Detailed explanation
------------------------------------------------
**Problem:** Xen runstate times are accumulated with unsigned kvmclock and run_delay deltas. A backward step wraps to ~2^64 ns. Linux guests use runnable+offline as steal, so they can show 100% steal for centuries. That is a live-migration/KVM_SET_CLOCK class bug, not a theoretical one, and 6.18 still allows KVM_SET_CLOCK to move the clock back.
**Stable rules:** Small, obviously correct, no new API, real guest- visible failure, applies cleanly to this checkout.
**Risk vs benefit:** Benefit is preventing unusable guest steal accounting on Xen-on-KVM. Risk is skipping a short accounting window until kvmclock catches up — the intended recovery.
**Concerns:** Do not pull the rest of the kvmclock series. This hunk is sufficient. No extra 6.18-specific rework expected.
Verification:
- [Phase 1] Parsed tags: Reviewed-by Paul Durrant; Link msgid 20260728144954.355376-21; SOB Woodhouse + Sean; no Fixes/Reported- by/Cc:stable
- [Phase 1] Subject verb “Prevent”; body describes unsigned wrap → 100% steal
- [Phase 2] Diff: only kvm_xen_update_runstate() in arch/x86/kvm/xen.c; signed delta/steal, skip if delta_ns < 0, clamp steal
- [Phase 3] git blame 587–616 → 5ec3289b31ab9; introducer 30b5c851af799 contained in **v5.12-rc2**
- [Phase 3] git merge-base --is-ancestor 30b5c851af799 HEAD → yes; 36a85200643e → no
- [Phase 3] Author is original runstate implementer
- [Phase 4] Cover letter LKML: series reordered so fixes do not depend on new uAPI; xen.c 28 +- is this patch only
- [Phase 4] Patch text on lkml.iu.edu/patchew matches the candidate diff
- [Phase 4] UNVERIFIED: lore.kernel.org 403; b4 dig no local SHA; stable@ search 403
- [Phase 5] Callers: record_steal_time / kvm_arch_vcpu_put / Xen SET_ATTR; guest steal in drivers/xen/time.c:145-150
- [Phase 5] kvm_vm_ioctl_set_clock can set kvmclock_offset without a general “no backwards” check
- [Phase 6] git describe HEAD p-6.18-1-g03b85e06ca9bf; make kernelversion 6.18.53; local function still unsigned
- [Phase 6] Local function body identical to patch before-image → clean apply
- [Phase 7] CONFIG_KVM_XEN in arch/x86/kvm/Kconfig
- [Phase 8] Failure mode: guest 100% steal, severity HIGH; risk very low
- UNVERIFIED: could not reproduce steal blow-up at runtime; relied on code + author description
**YES**
arch/x86/kvm/xen.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-)
arch/x86/kvm/xen.c +22 -6
@@ -588,29 +588,45 @@ void kvm_xen_update_runstate(struct kvm_vcpu *v, int state) {struct kvm_vcpu_xen *vx = &v->arch.xen;u64 now =get_kvmclock_ns (v->kvm); -u64 delta_ns = now - vx->runstate_entry_time;u64 run_delay = current->sched_info.run_delay; +s64 delta_ns = now - vx->runstate_entry_time; +s64 steal_ns = run_delay - vx->last_steal; +/* +* If the vCPU was never run before, its prior state should +* be considered RUNSTATE_offline. +*/ if (unlikely (!vx->runstate_entry_time)) vx->current_runstate = RUNSTATE_offline; +/* +* If KVM clock went backwards, just update the current runstate +* but don't account any time. Leave entry_time unchanged so the +* next positive delta covers the full period once the clock +* catches up. Update last_steal every time so stolen time only +* reflects the interval since the most recent call. +*/ +if (delta_ns <0 ) + goto update_guest; +/* * Time waiting for the scheduler isn't "stolen" if the * vCPU wasn't running anyway. */ -if (vx->current_runstate == RUNSTATE_running) { -u64 steal_ns = run_delay - vx->last_steal; +if (vx->current_runstate == RUNSTATE_running && steal_ns >0 ) { +if (steal_ns > delta_ns) + steal_ns = delta_ns; delta_ns -= steal_ns; - vx->runstate_times[RUNSTATE_runnable] += steal_ns; } - vx->last_steal = run_delay; vx->runstate_times[vx->current_runstate] += delta_ns; - vx->current_runstate = state; vx->runstate_entry_time = now; + update_guest: + vx->current_runstate = state; + vx->last_steal = run_delay;if (vx->runstate_cache.active)kvm_xen_update_runstate_guest (v, state == RUNSTATE_runnable); }
Signature · 1 line
2.53.0
Sean Christopherson
reviewerRe: [PATCH AUTOSEL 6.18-6.6] KVM: x86/xen: Prevent runstate times from becoming negative
Quoted 33 lines · Sasha Levin
From: David Woodhouse <[email protected]>
[ Upstream commit
36a85200643e62d20a91f0bc1a811187b59f7762]When
kvm_xen_update_runstate()is invoked to set a vCPU's runstate, the time spent in the previous runstate is accounted. This is based on the delta between the current KVM clock time, and the previous value stored invcpu->arch.xen.runstate_entry_time.If the KVM clock goes backwards, that delta will be negative. Or, since it's an unsigned 64-bit integer, very *large*. Linux guests deal with that particularly badly, reporting 100% steal time for ever more (well, for *centuries* at least, until the delta has been consumed).
So when a negative delta is detected, just refrain from updating the runstate times until the KVM clock catches up with
runstate_entry_timeagain.Also clamp
steal_nstodelta_nsto prevent steal time from exceeding the total elapsed time, and handle negativesteal_ns(which can happen ifrun_delaygoes backwards across a scheduler update).The userspace APIs for setting the runstate times do not allow them to be set past the current KVM clock, but userspace can still adjust the KVM clock *after* setting the runstate times, which would cause this situation to occur.
Signed-off-by David Woodhouse <[email protected]>Reviewed-by Paul Durrant <[email protected]>Signed-off-by Sean Christopherson <[email protected]>Signed-off-by Sasha Levin <[email protected]>---
...
Quoted 26 lines
**Step 8.1: DETERMINE WHO IS AFFECTED**
Xen-ABI KVM guests with runstate/steal enabled (CONFIG_KVM_XEN+ VMM setup). Not all KVM users.Record: [config/driver-specific: KVM Xen guests]
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
1.KVM_SET_CLOCK(live migration/snapshot) after runstateSET_ATTR— documented, exists in this tree
2. kvmclock discontinuities from masterclock re-snapshot — still present here; the rest of the series is **not**
3.run_delay < last_stealunsigned wrap (ioctl uses VMMcurrent; vCPU path uses the vCPU task)Unprivileged guest cannot call
KVM_SET_CLOCK; the VMM can. Guest then sees broken steal forever.Record: [migration/SET_CLOCK and steal wrap] [realistic in production Xen-on-KVM] [VMM-triggered, guest-visible]
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Not a host oops. Guest scheduler steal accounting becomes permanently wrong (100% steal for ~centuries). That breaks guest CPU accounting, load, and can stall workloads/watchdogs. **HIGH** for those guests (not host CRITICAL).
Quoted 8 lines
Record: [guest steal corruption / apparent 100% steal] [HIGH]
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Benefit: stops a permanent guest-visible accounting failure on a path used in migration. Risk: ~20 lines, no locking/API change, skip- accounting is conservative.Record: [high benefit for Xen-on-KVM] [very low risk] [favorable]
Two questions: do we care abou this specific flaw, and does anyone run Xen guests with KVM using an LTS kernel? I agree with AI's assessment that this is low risk, but unless this will actually benefit someone, I don't see the point.
Re: [PATCH AUTOSEL 6.18-6.6] KVM: x86/xen: Prevent runstate times from becoming negative
Quoted 5 lines · Sean Christopherson
Two questions: do we care abou this specific flaw, and does anyone run Xen guests with KVM using an LTS kernel? I agree with AI's assessment that this is low risk, but unless this will actually benefit someone, I don't see the point.
I concur. Nobody runs KVM and expects steal time and clocks not to be entirely hosed once you start caring deeply about the details — even in upstream. You want this stuff to work, you carefully curate the kernel you're running.
Backporting this one to LTS kernels doesn't help anyone. The risk is low, but the benefit is lower.
Those who care will already have it backported to 6.18 anyway.
Sasha Levin
maintainerRe: [PATCH AUTOSEL 6.18-6.6] KVM: x86/xen: Prevent runstate times from becoming negative
Quoted 2 lines · David Woodhouse
Backporting this one to LTS kernels doesn't help anyone. The risk is low, but the benefit is lower.
Dropped, thanks.
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 1/1 powercap: intel_rapl: Fix kernel panic during PMU unbind
In reply to Sasha LevinFrom: Sumeet Pawnikar <[email protected]>
[ Upstream commit 916b61abba586d950a4d8264e2841cc5ccfa4df1 ]
rapl_package_add_pmu() fails internally at perf_pmu_register(), and rapl_pmu_update() leaves the global rapl_pmu.pmu structure zero-initialized via memset and returns an error. But any previously probed packages retain has_pmu = true.
When the driver is subsequently unbound or removed, rapl_package_remove_pmu_locked() sees has_pmu == true and unconditionally calls perf_pmu_unregister(&rapl_pmu.pmu) on the zeroed-out structure. This attempts a list_del_rcu() on a NULL list head, immediately causing a kernel panic.
Fix this by checking if the PMU is actually registered before attempting to unregister it.
---
LLM Generated explanations, may be completely bogus:
The local tree is **6.12.111** (pending-6.12). The panic path is present here; only the later _locked wrapper is missing, so the same two-line check belongs in rapl_package_remove_pmu.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
Record: **[powercap: intel_rapl:] [Fix] [kernel panic during PMU unbind]**
Subsystem powercap / Intel RAPL. Verb is explicitly **fix**. Claimed
intent: stop a panic when the RAPL perf PMU is unbound after a failed registration.
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- **Reviewed-by:** Abel Vesa <[email protected]>
- **Link:** https://patch.msgid.link/20260822094657.12489-1- [email protected]
- **Signed-off-by:** Sumeet Pawnikar (author); Rafael J. Wysocki (PM maintainer)
- **Ignored (pipeline):** Signed-off-by: Sasha Levin (not present on this candidate text, but would be ignored)
- **No Fixes:** tag (expected)
- **No Cc: stable** (expected)
- **No Reported-by / Tested-by / syzbot**
Notable: PM subsystem maintainer applied it; one external Reviewed-by.
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- **Bug:** rapl_pmu_update() can fail at perf_pmu_register() after memset of rapl_pmu.pmu. Packages that already succeeded keep has_pmu = true.
- **Symptom:** On unbind/remove, rapl_package_remove_pmu*() sees has_pmu and calls perf_pmu_unregister() on a PMU whose list_head is NULL → list_del_rcu() NULL deref → **kernel panic**.
- **Root cause:** Unregister is gated only on rp->has_pmu, not on whether the global PMU is actually registered.
- **Version info in message:** none. Introduced with RAPL PMU APIs (verified in Phase 3 as v6.11).
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: **Not hidden.** This is an explicit panic fix, not cleanup disguised as a fix.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
Record:
- **File:** drivers/powercap/intel_rapl_common.c
- **Scope:** 2 insertions, 1 deletion (plus blank line from rjw)
- **Function (upstream):** rapl_package_remove_pmu_locked()
- **Classification:** single-file surgical fix
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record:
- **Before:** If this package has has_pmu and no other package still needs the PMU, always perf_pmu_unregister(&rapl_pmu.pmu) then memset the global rapl_pmu.
- **After:** Same, but unregister only if rapl_pmu.registered.
- **Path:** driver remove / unbind / (later kernels) CPU-hotplug teardown — error-recovery path after a failed PMU (re)register.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record: **[NULL deref / invalid list_del on unregistered PMU]**
In this tree, rapl_pmu_update() (unchanged since 575024a8aa7cf):
```1996:2024:drivers/powercap/intel_rapl_common.c
/* Unregister previous registered PMU */
if (rapl_pmu.registered)
perf_pmu_unregister(&rapl_pmu.pmu);
rapl_pmu.registered = false;
rapl_pmu.domain_map |= rp->domain_map;
memset(&rapl_pmu.pmu, 0, sizeof(struct pmu));
/* ... fill callbacks ... */
ret = perf_pmu_register(&rapl_pmu.pmu, "power", -1);
if (ret) {
pr_info("Failed to register PMU\n");
return ret; /* does NOT set rp->has_pmu; does NOT
restore prior PMU */
}
rapl_pmu.registered = true;
end:
rp->has_pmu = true;
```If package A already registered, then package B needs extra domains (documented dual-package Psys case): previous PMU is unregistered, pmu.entry is zeroed, re-register fails. Package A still has has_pmu == true. Remove of A then hits:
```2104:2105:drivers/powercap/intel_rapl_common.c
perf_pmu_unregister(&rapl_pmu.pmu);
memset(&rapl_pmu, 0, sizeof(struct rapl_pmu));
```perf_pmu_unregister() does list_del_rcu(&pmu->entry). A zeroed list_head has next = prev = NULL. __list_del(entry->prev, entry->next) writes through NULL → oops.
**Step 2.4: ASSESS THE FIX QUALITY**
Record: **Obviously correct.** rapl_pmu.registered is already maintained in this file (set true only after successful perf_pmu_register(), cleared before re-register). Skipping unregister when it is false cannot skip a still-registered PMU. Regression risk is very low. No API/data-structure change.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Record: Unconditional perf_pmu_unregister in rapl_package_remove_pmu() is from **575024a8aa7cf** (“powercap:intel_rapl: Introduce APIs for PMU support”, Zhang Rui, 2024-04-28). git describe --contains → **v6.11**. Present in this 6.12 tree (git merge-base --is-ancestor 575024a8aa7cf HEAD succeeded).
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. The introducing commit is 575024a8aa7cf; TPMI started calling it in **963a9ad3c589** (“Enable PMU support”), also in this tree (v6.11).
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record:
- **35cf088430978** already in this tree (v6.12.110): “Handle PMU registration failure during probe”. That only logs rapl_package_add_pmu() failure; probe still succeeds; remove still calls rapl_package_remove_pmu(). It does **not** fix the panic.
- No remove_pmu_locked commits here.
- Standalone logic; not patch X/Y of a series that 6.12 needs.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record: Sumeet Pawnikar has several powercap fixes in this tree, including 35cf088 (already backported). Not the RAPL maintainer; Zhang Rui / Rafael Wysocki own the subsystem. Rafael applied this patch as 7.3-rc material.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
Record: Upstream applies the check in rapl_package_remove_pmu_locked(), added later (~6.19) by “Fix possible recursive lock warning” (dcd0b625) together with MSR RAPL PMU. **git merge-base --is-ancestor dcd0b625… HEAD failed** — that refactor is **not** in 6.12. It is **not required**: 6.12 already has rapl_pmu.registered and the same unregister in rapl_package_remove_pmu(). Standalone one-line semantic backport.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- b4 dig -c cannot be used on this SHA (commit is not in the checkout). Related commit 35cf088 was found as v3 on lore.
- Original: 2026-07-26 (linux-pm). Resend: 2026-08-22, msgid [email protected].
- URLs: https://lists.openwall.net/linux-kernel/2026/08/22/310 and
https://lkml.iu.edu/2608.2/11624.html
- Abel Vesa: “Looks OK to me” + Reviewed-by. Rafael: “Applied as 7.3-rc material, thanks!”
- No NAKs. Same 3-line diff from v1 through resend. No reviewer request for Cc: stable.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record: To/Cc: Rafael J. Wysocki, linux-pm, linux-kernel. Reviewer Abel Vesa. Applied by the PM maintainer. Appropriate audience.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No syzbot/bugzilla. Mechanism is explained in the commit (list_del_rcu on NULL). Author of the sibling probe-failure patch, so this is from the same investigation, not theoretical cleanup.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: Sibling **35cf088** already in 6.12.110. This panic fix is the missing half of that failure handling. Not a multi-patch series that 6.12 lacks.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: lore.kernel.org/stable returned 403. Open web search found no stable-list rejection. **UNVERIFIED:** whether anyone already asked for this on stable@ (does not change the technical verdict).
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF**
Record: Upstream: rapl_package_remove_pmu_locked. This tree:rapl_package_remove_pmu. Related: rapl_pmu_update, rapl_package_add_pmu.
**Step 5.2: TRACE CALLERS**
Record:
- intel_rapl_tpmi_remove() → rapl_package_remove_pmu() (only caller in 6.12; MSR driver does **not** use these APIs here).
- intel_rapl_tpmi_probe() → rapl_package_add_pmu() → rapl_pmu_update(). Probe **continues** if add_pmu fails (after 35cf088, still return 0).
- Remove runs on unbind, rmmod, or TPMI device teardown — process context, not IRQ.
**Step 5.3: TRACE CALLEES**
Record: perf_pmu_unregister() → list_del_rcu(&pmu->entry) under pmus_lock, then synchronize_srcu / synchronize_rcu, sysfs teardown. list_add_rcu(&pmu->entry, &pmus) happens only at the **end** of successful perf_pmu_register(). Failed register never links entry.
**Step 5.4: FOLLOW THE CALL CHAIN**
Record: Reachable on Intel TPMI RAPL (CONFIG_INTEL_RAPL_TPMI + CONFIG_PERF_EVENTS): Meteor Lake / Lunar Lake / Arrow Lake class platforms that 6.12 actually ships on. Trigger: successful PMU add, then a later package’s rapl_pmu_update() re-register fails, then driver remove. Unprivileged users typically cannot unbind, but rmmod/unbind/hot-unplug and failed second-package probe are real admin/boot paths. Documented dual-package Psys re-register is exactly this update path.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: Same file already checks rapl_pmu.registered before unregister **inside** rapl_pmu_update(). Remove path is the missing twin of that check. No other RAPL unregister site in 6.12.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record: **Yes.** drivers/powercap/intel_rapl_common.c lines 2089–2106:rapl_package_remove_pmu() still calls perf_pmu_unregister with only a has_pmu guard. struct rapl_pmu { … bool registered; } exists at 1574–1579. Bug since **v6.11** (575024a8aa7cf + 963a9ad3c589).
Local tree: git describe HEAD = p-6.12-3-gc504cf0baa3d8, make kernelversion = **6.12.111**, branch pending-6.12.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: **Minor context rework, not a semantic rewrite.**
- Function name: rapl_package_remove_pmu vs upstream _locked
- Extra guard(cpus_read_lock)() still in the 6.12 function
- EXPORT_SYMBOL_GPL vs EXPORT_SYMBOL_NS_GPL
The two-line if (rapl_pmu.registered) change applies in place. registered already exists.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: 35cf088 is here and only adds a dev_info. **This panic is not already fixed.** git log --grep='panic during PMU' on this path is empty.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: **drivers/powercap (Intel RAPL)** — **IMPORTANT** for Intel platforms with TPMI RAPL + perf, not core-mm/VFS. Panic still takes down the machine.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Mature driver; PMU APIs added in v6.11. Moderate churn (platform IDs, locking, leak fixes). This is a leftover hole in the v6.11 PMU feature, not a brand-new 7.x path.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: **Config/driver-specific:** CONFIG_INTEL_RAPL_TPMI + CONFIG_PERF_EVENTS on Intel TPMI RAPL hardware (client MTL/LNL/ARL and any TPMI Xeon). Not universal, not staging.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: (1) At least one package successfully added the PMU (has_pmu=true, registered=true). (2) A later package causes unregister + memset(&rapl_pmu.pmu) + failed perf_pmu_register (registered stays false; prior packages keep has_pmu). (3) Last has_pmu package is removed. Dual-package extra-domain update is documented in-tree. First-package-only register failure is already safe (has_pmu not set). Commonness: uncommon; severity when hit: panic.
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: **Kernel oops/panic** via NULL deref in list_del_rcu / __list_del. **Severity: CRITICAL.**
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- **Benefit:** Prevents a real panic on TPMI RAPL unbind after a failed PMU update. Complements the probe-failure log already in 6.12.110.
- **Risk:** Very low — one boolean already used on the add path; skip unregister only when the PMU is not on the perf list.
- **Ratio:** Strongly favors backport. Needs a 2-line context-adjusted backport, not the later _locked API.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
**FOR:**
- Real kernel panic (list_del_rcu on a zeroed pmu->entry)
- Buggy code and rapl_pmu.registered both exist in 6.12.111
- Bug present since v6.11
- 2-line, obviously correct
- Reviewed and applied by Rafael Wysocki
- Sibling PMU-failure handling already backported here (35cf088)
- No new feature/API
**AGAINST:**
- Exact hunk targets rapl_package_remove_pmu_locked() (post-6.12 split) — needs a tiny backport
- Trigger needs a failed re-register after a successful one (not every boot)
- TPMI-only in this tree
- No syzbot / no Fixes tag (expected)
**UNRESOLVED:**
- Stable@ discussion (lore 403)
- Whether a later mainline rapl_pmu_update() memsets the whole rapl_pmu on error (6.12 path is still panic-capable as shown)
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — flag already tracks registration; maintainer applied it.
2. Fixes a real bug that affects users? **PASS** — panic on RAPL TPMI unbind after failed PMU update.
3. Important issue? **PASS** — kernel panic, CRITICAL.
4. Small and contained? **PASS** — 2 lines, one function.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** (with trivial rename/context:
same check in rapl_package_remove_pmu).
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: Not a device-ID/quirk/DT/build/docs exception. It is a straight crash fix.
**Step 9.4: MAKE YOUR DECISION**
This is a small, obviously correct panic fix for code that 6.12 has had since v6.11. The _locked wrapper is not a dependency. Backport the same if (rapl_pmu.registered) guard into rapl_package_remove_pmu().
Verification:
- [Phase 1] Parsed tags: Reviewed-by Abel Vesa; Link msgid 20260822094657; Rafael SOB; no Fixes/Cc:stable/syzbot
- [Phase 1] Body describes list_del_rcu on NULL after failed register + leftover has_pmu
- [Phase 2] Diff: 2 lines in remove path; add if (rapl_pmu.registered) before perf_pmu_unregister
- [Phase 2] Local rapl_pmu_update() confirmed: memset pmu, set registered=false, return on register failure without clearing other packages’ has_pmu
- [Phase 2] perf_pmu_unregister → list_del_rcu(&pmu->entry); list_add_rcu only after successful register
- [Phase 3] git blame: 575024a8aa7cf (v6.11) introduced the bug; ancestor of HEAD
- [Phase 3] 963a9ad3c589 TPMI Enable PMU support is in this tree
- [Phase 3] 35cf088430978 already in v6.12.110; does not fix unregister panic
- [Phase 3] dcd0b625 _locked split is NOT an ancestor of HEAD
- [Phase 4] Original 2026-07-26; resend 2026-08-22; Abel Reviewed-by; Rafael applied as 7.3-rc; no NAK
- [Phase 4] b4 dig on this SHA N/A (commit not in tree); b4 dig on 35cf088 found v3 lore thread
- [Phase 4] lore.kernel.org/stable fetch 403 — UNVERIFIED stable-list history
- [Phase 5] Only 6.12 caller: intel_rapl_tpmi_remove; probe ignores add_pmu errors
- [Phase 6] git describe HEAD: p-6.12-3-gc504cf0baa3d8; kernelversion 6.12.111; buggy unregister at intel_rapl_common.c:2104
- [Phase 6] rapl_pmu.registered exists; patch needs function-name context tweak
- [Phase 8] Failure mode: NULL deref / oops on unbind, severity CRITICAL
- UNVERIFIED: whether anyone nominated this on stable@
The fix is small, surgical, and meets the stable criteria for this 6.12 tree.
**YES**
drivers/powercap/intel_rapl_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/powercap/intel_rapl_common.c +3 -1
@@ -2106,7 +2106,9 @@ void rapl_package_remove_pmu(struct rapl_package *rp)return ; } -perf_pmu_unregister (&rapl_pmu.pmu); +if (rapl_pmu.registered) +perf_pmu_unregister (&rapl_pmu.pmu); +memset (&rapl_pmu,0 ,sizeof (struct rapl_pmu )); }EXPORT_SYMBOL_GPL (rapl_package_remove_pmu);
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 drm/amd: Add DCN6 register headers
In reply to Sasha LevinFrom: Aurabindo Pillai <[email protected]>
[ Upstream commit fe219bd7d9783a6cb9249bc333546cb58d2c2723 ]
Add new headers for:
- dcn 6.0.0
- dpcs 6.0.0
- mmhub 5.0.1
---
LLM Generated explanations, may be completely bogus:
The background lookup finished: **linux-6.18.y does not have this ftype fix yet**. It already has the sibling xfs: fix replaying dirent removals into the temporary directory, so that dependency is not a blocker.
The backport decision stands: **YES**.
.../include/asic_reg/dcn/dcn_6_0_0_offset.h | 15799 +++++ .../include/asic_reg/dcn/dcn_6_0_0_sh_mask.h | 58556 ++++++++++++++++ .../include/asic_reg/dpcs/dpcs_6_0_0_offset.h | 47 + .../asic_reg/dpcs/dpcs_6_0_0_sh_mask.h | 55 + .../asic_reg/mmhub/mmhub_5_0_1_offset.h | 17 + .../asic_reg/mmhub/mmhub_5_0_1_sh_mask.h | 17 + 6 files changed, 74491 insertions(+) create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_sh_mask.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_sh_mask.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_offset.h create mode 100644 drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_sh_mask.h
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_offset.h new file +15799 -0
@@ -0,0 +1,15799 @@ +// SPDX-License-Identifier: MIT +// +// Copyright 2026 Advanced Micro Devices, Inc. + +#ifndef _dcn_6_0_0_OFFSET_HEADER +#define _dcn_6_0_0_OFFSET_HEADER + + + +// addressBlock: dce_dc_hda_azcontroller_azdec +// base address: 0x1300000 +#define regGLOBAL_CAPABILITIES 0x4acc00 +#define regGLOBAL_CAPABILITIES_BASE_IDX 4 +#define regMINOR_VERSION 0x4acc00 +#define regMINOR_VERSION_BASE_IDX 4 +#define regMAJOR_VERSION 0x4acc00 +#define regMAJOR_VERSION_BASE_IDX 4 +#define regOUTPUT_PAYLOAD_CAPABILITY 0x4acc01 +#define regOUTPUT_PAYLOAD_CAPABILITY_BASE_IDX 4 +#define regINPUT_PAYLOAD_CAPABILITY 0x4acc01 +#define regINPUT_PAYLOAD_CAPABILITY_BASE_IDX 4 +#define regGLOBAL_CONTROL 0x4acc02 +#define regGLOBAL_CONTROL_BASE_IDX 4 +#define regWAKE_ENABLE 0x4acc03 +#define regWAKE_ENABLE_BASE_IDX 4 +#define regSTATE_CHANGE_STATUS 0x4acc03 +#define regSTATE_CHANGE_STATUS_BASE_IDX 4 +#define regGLOBAL_STATUS 0x4acc04 +#define regGLOBAL_STATUS_BASE_IDX 4 +#define regOUTPUT_STREAM_PAYLOAD_CAPABILITY 0x4acc06 +#define regOUTPUT_STREAM_PAYLOAD_CAPABILITY_BASE_IDX 4 +#define regINPUT_STREAM_PAYLOAD_CAPABILITY 0x4acc06 +#define regINPUT_STREAM_PAYLOAD_CAPABILITY_BASE_IDX 4 +#define regINTERRUPT_CONTROL 0x4acc08 +#define regINTERRUPT_CONTROL_BASE_IDX 4 +#define regINTERRUPT_STATUS 0x4acc09 +#define regINTERRUPT_STATUS_BASE_IDX 4 +#define regWALL_CLOCK_COUNTER 0x4acc0c +#define regWALL_CLOCK_COUNTER_BASE_IDX 4 +#define regSTREAM_SYNCHRONIZATION 0x4acc0e +#define regSTREAM_SYNCHRONIZATION_BASE_IDX 4 +#define regCORB_LOWER_BASE_ADDRESS 0x4acc10 +#define regCORB_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regCORB_UPPER_BASE_ADDRESS 0x4acc11 +#define regCORB_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZCONTROLLER0_CORB_WRITE_POINTER 0x4acc12 +#define regAZCONTROLLER0_CORB_WRITE_POINTER_BASE_IDX 4 +#define regAZCONTROLLER0_CORB_READ_POINTER 0x4acc12 +#define regAZCONTROLLER0_CORB_READ_POINTER_BASE_IDX 4 +#define regAZCONTROLLER0_CORB_CONTROL 0x4acc13 +#define regAZCONTROLLER0_CORB_CONTROL_BASE_IDX 4 +#define regAZCONTROLLER0_CORB_STATUS 0x4acc13 +#define regAZCONTROLLER0_CORB_STATUS_BASE_IDX 4 +#define regAZCONTROLLER0_CORB_SIZE 0x4acc13 +#define regAZCONTROLLER0_CORB_SIZE_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_LOWER_BASE_ADDRESS 0x4acc14 +#define regAZCONTROLLER0_RIRB_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_UPPER_BASE_ADDRESS 0x4acc15 +#define regAZCONTROLLER0_RIRB_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_WRITE_POINTER 0x4acc16 +#define regAZCONTROLLER0_RIRB_WRITE_POINTER_BASE_IDX 4 +#define regAZCONTROLLER0_RESPONSE_INTERRUPT_COUNT 0x4acc16 +#define regAZCONTROLLER0_RESPONSE_INTERRUPT_COUNT_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_CONTROL 0x4acc17 +#define regAZCONTROLLER0_RIRB_CONTROL_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_STATUS 0x4acc17 +#define regAZCONTROLLER0_RIRB_STATUS_BASE_IDX 4 +#define regAZCONTROLLER0_RIRB_SIZE 0x4acc17 +#define regAZCONTROLLER0_RIRB_SIZE_BASE_IDX 4 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE 0x4acc18 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_BASE_IDX 4 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x4acc18 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 4 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x4acc18 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 4 +#define regAZCONTROLLER0_IMMEDIATE_RESPONSE_INPUT_INTERFACE 0x4acc19 +#define regAZCONTROLLER0_IMMEDIATE_RESPONSE_INPUT_INTERFACE_BASE_IDX 4 +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_STATUS 0x4acc1a +#define regAZCONTROLLER0_IMMEDIATE_COMMAND_STATUS_BASE_IDX 4 +#define regAZCONTROLLER0_DMA_POSITION_LOWER_BASE_ADDRESS 0x4acc1c +#define regAZCONTROLLER0_DMA_POSITION_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZCONTROLLER0_DMA_POSITION_UPPER_BASE_ADDRESS 0x4acc1d +#define regAZCONTROLLER0_DMA_POSITION_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZCONTROLLER0_WALL_CLOCK_COUNTER_ALIAS 0x4ad40c +#define regAZCONTROLLER0_WALL_CLOCK_COUNTER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azendpoint_azdec +// base address: 0x1300000 +#define regAZENDPOINT0_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x4acc18 +#define regAZENDPOINT0_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 4 +#define regAZENDPOINT0_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x4acc18 +#define regAZENDPOINT0_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azroot_azdec +// base address: 0x1300000 +#define regAZROOT0_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x4acc18 +#define regAZROOT0_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 4 +#define regAZROOT0_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x4acc18 +#define regAZROOT0_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream0_azdec +// base address: 0x1300000 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc20 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc21 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc22 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc23 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc24 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc24 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc26 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc27 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad421 +#define regAZSTREAM0_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream1_azdec +// base address: 0x1300020 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc28 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc29 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc2a +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc2b +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc2c +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc2c +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc2e +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc2f +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad429 +#define regAZSTREAM1_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream2_azdec +// base address: 0x1300040 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc30 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc31 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc32 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc33 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc34 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc34 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc36 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc37 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad431 +#define regAZSTREAM2_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream3_azdec +// base address: 0x1300060 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc38 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc39 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc3a +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc3b +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc3c +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc3c +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc3e +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc3f +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad439 +#define regAZSTREAM3_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream4_azdec +// base address: 0x1300080 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc40 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc41 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc42 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc43 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc44 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc44 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc46 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc47 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad441 +#define regAZSTREAM4_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream5_azdec +// base address: 0x13000a0 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc48 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc49 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc4a +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc4b +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc4c +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc4c +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc4e +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc4f +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad449 +#define regAZSTREAM5_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream6_azdec +// base address: 0x13000c0 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc50 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc51 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc52 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc53 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc54 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc54 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc56 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc57 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad451 +#define regAZSTREAM6_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_dc_hda_azstream7_azdec +// base address: 0x13000e0 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x4acc58 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x4acc59 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x4acc5a +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x4acc5b +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x4acc5c +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x4acc5c +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x4acc5e +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x4acc5f +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 4 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x4ad459 +#define regAZSTREAM7_0_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 4 + + +// addressBlock: dce_rsmu_dmu_rsmu_dmu_RsmuMmiopubDmuDec +// base address: 0x900f000 +#define regRSMU_MEM_POWER_CTRL2_DMU 0x0000 +#define regRSMU_MEM_POWER_CTRL2_DMU_BASE_IDX 5 +#define regRSMU_HARD_RESETB_DMU 0x0002 +#define regRSMU_HARD_RESETB_DMU_BASE_IDX 5 +#define regRSMU_MEM_POWER_CTRL_DMU 0x0006 +#define regRSMU_MEM_POWER_CTRL_DMU_BASE_IDX 5 +#define regRSMU_STRAP_CONTROL_DMU 0x000d +#define regRSMU_STRAP_CONTROL_DMU_BASE_IDX 5 +#define regRSMU_COUNTER_0_DMU 0x0077 +#define regRSMU_COUNTER_0_DMU_BASE_IDX 5 +#define regRSMU_COUNTER_1_DMU 0x0078 +#define regRSMU_COUNTER_1_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_ENABLE_P0_DMU 0x0079 +#define regRSMU_PWRMGT_INTR_ENABLE_P0_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_ENABLE_P1_DMU 0x007a +#define regRSMU_PWRMGT_INTR_ENABLE_P1_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_ENABLE_P2_DMU 0x007b +#define regRSMU_PWRMGT_INTR_ENABLE_P2_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P0_DMU 0x007c +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P0_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P1_DMU 0x007d +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P1_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P2_DMU 0x007e +#define regRSMU_PWRMGT_INTR_TARGET_ADDR_P2_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_CONFIG_P0_DMU 0x007f +#define regRSMU_PWRMGT_INTR_CONFIG_P0_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_CONFIG_P1_DMU 0x0080 +#define regRSMU_PWRMGT_INTR_CONFIG_P1_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_CONFIG_P2_DMU 0x0081 +#define regRSMU_PWRMGT_INTR_CONFIG_P2_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_STATUS_DMU 0x0082 +#define regRSMU_PWRMGT_INTR_STATUS_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_PENDING_P0_DMU 0x0083 +#define regRSMU_PWRMGT_INTR_PENDING_P0_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_PENDING_P1_DMU 0x0084 +#define regRSMU_PWRMGT_INTR_PENDING_P1_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_PENDING_P2_DMU 0x0085 +#define regRSMU_PWRMGT_INTR_PENDING_P2_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_TYPE_DMU 0x0086 +#define regRSMU_PWRMGT_INTR_TYPE_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_INTERCEPT_DMU 0x0087 +#define regRSMU_PWRMGT_INTR_INTERCEPT_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_CLEAR_DMU 0x0088 +#define regRSMU_PWRMGT_INTR_CLEAR_DMU_BASE_IDX 5 +#define regRSMU_MMIOPUB_SCRATCH_REG_0_DMU 0x008a +#define regRSMU_MMIOPUB_SCRATCH_REG_0_DMU_BASE_IDX 5 +#define regRSMU_VF_ENABLE_DMU 0x008b +#define regRSMU_VF_ENABLE_DMU_BASE_IDX 5 +#define regRSMU_MGCG_CONTROL_DMU 0x008c +#define regRSMU_MGCG_CONTROL_DMU_BASE_IDX 5 +#define regRSMU_AXI_MASTER_QOS_CNTL_DMU 0x008e +#define regRSMU_AXI_MASTER_QOS_CNTL_DMU_BASE_IDX 5 +#define regRSMU_MASTER_ERROR_COUNTER_DMU 0x008f +#define regRSMU_MASTER_ERROR_COUNTER_DMU_BASE_IDX 5 +#define regRSMU_SLAVE_TIMEOUT_VALUE_DMU 0x0090 +#define regRSMU_SLAVE_TIMEOUT_VALUE_DMU_BASE_IDX 5 +#define regRSMU_RESET_TIMEOUT_CONTROL_DMU 0x0091 +#define regRSMU_RESET_TIMEOUT_CONTROL_DMU_BASE_IDX 5 +#define regRSMU_SLAVE_ERROR_COUNTER_DMU 0x0092 +#define regRSMU_SLAVE_ERROR_COUNTER_DMU_BASE_IDX 5 +#define regRSMU_DBG_MUX_CONTROL_DMU 0x0093 +#define regRSMU_DBG_MUX_CONTROL_DMU_BASE_IDX 5 +#define regRSMU_IH_RESET_CNTL_DMU 0x00ba +#define regRSMU_IH_RESET_CNTL_DMU_BASE_IDX 5 +#define regRSMU_GOLDEN_COUNTER_0_DMU 0x00bc +#define regRSMU_GOLDEN_COUNTER_0_DMU_BASE_IDX 5 +#define regRSMU_GOLDEN_COUNTER_1_DMU 0x00bd +#define regRSMU_GOLDEN_COUNTER_1_DMU_BASE_IDX 5 +#define regRSMU_IP_CLOCK_GATE_CNTL_DMU 0x00be +#define regRSMU_IP_CLOCK_GATE_CNTL_DMU_BASE_IDX 5 +#define regRSMU_MSMU_FETCH_FUSE_DMU 0x00ef +#define regRSMU_MSMU_FETCH_FUSE_DMU_BASE_IDX 5 +#define regRSMU_STRAP_STATUS_DMU 0x00f1 +#define regRSMU_STRAP_STATUS_DMU_BASE_IDX 5 +#define regRSMU_SMS_FUSE_CLEAR_SET0_DMU 0x00f2 +#define regRSMU_SMS_FUSE_CLEAR_SET0_DMU_BASE_IDX 5 +#define regRSMU_PWRMGT_INTR_MCM_ADDR_DMU 0x0118 +#define regRSMU_PWRMGT_INTR_MCM_ADDR_DMU_BASE_IDX 5 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_DMU 0x0119 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_DMU_BASE_IDX 5 +#define regRSMU_XBAR_CG_MISC_DMU 0x011b +#define regRSMU_XBAR_CG_MISC_DMU_BASE_IDX 5 +#define regRSMU_XBAR_CG_CTRL_DMU 0x011c +#define regRSMU_XBAR_CG_CTRL_DMU_BASE_IDX 5 +#define regRSMU_IH_MCM_ADDR_DMU 0x011d +#define regRSMU_IH_MCM_ADDR_DMU_BASE_IDX 5 + + +// addressBlock: dce_rsmu_dmu_rsmu_dmu_RsmuMmioextDmuDec +// base address: 0x900f780 +#define regRSMU_SOFT_RESETB_DMU 0x01e0 +#define regRSMU_SOFT_RESETB_DMU_BASE_IDX 5 +#define regRSMU_IH_CREDIT_DMU 0x01e5 +#define regRSMU_IH_CREDIT_DMU_BASE_IDX 5 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_DMU 0x01e7 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_DMU_BASE_IDX 5 +#define regRSMU_TIMEOUT_ERROR_LOG_REG_DMU 0x01ee +#define regRSMU_TIMEOUT_ERROR_LOG_REG_DMU_BASE_IDX 5 +#define regRSMU_IP_MASTER_STATUS_DMU 0x01ef +#define regRSMU_IP_MASTER_STATUS_DMU_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_DMU 0x01f0 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_DMU_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_DMU 0x01f1 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_DMU_BASE_IDX 5 +#define regRSMU_VERSION_DMU 0x01f5 +#define regRSMU_VERSION_DMU_BASE_IDX 5 +#define regRSMU_IH_COOKIE_WRITE_ADDR_DMU 0x01ff +#define regRSMU_IH_COOKIE_WRITE_ADDR_DMU_BASE_IDX 5 + + +// addressBlock: dce_rsmu_dmu_rsmu_dmu_RsmuMmiosecDmuDec +// base address: 0x900f800 +#define regRSMU_AEB_OVERRIDE_0_DMU 0x0202 +#define regRSMU_AEB_OVERRIDE_0_DMU_BASE_IDX 5 +#define regRSMU_AEB_OVERRIDE_1_DMU 0x0203 +#define regRSMU_AEB_OVERRIDE_1_DMU_BASE_IDX 5 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_DMU 0x0371 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_DMU_BASE_IDX 5 +#define regRSMU_AEB_VALUE_0_DMU 0x0373 +#define regRSMU_AEB_VALUE_0_DMU_BASE_IDX 5 +#define regRSMU_AEB_VALUE_1_DMU 0x0374 +#define regRSMU_AEB_VALUE_1_DMU_BASE_IDX 5 + + +// addressBlock: dce_rsmu_dio_rsmu_dio_RsmuMmiopubDioDec +// base address: 0x9010000 +#define regRSMU_MEM_POWER_CTRL2_DIO 0x0400 +#define regRSMU_MEM_POWER_CTRL2_DIO_BASE_IDX 5 +#define regRSMU_HARD_RESETB_DIO 0x0402 +#define regRSMU_HARD_RESETB_DIO_BASE_IDX 5 +#define regRSMU_PUB_FUSE_ADDR_DIO 0x0403 +#define regRSMU_PUB_FUSE_ADDR_DIO_BASE_IDX 5 +#define regRSMU_ROM_ADDR_DIO 0x0405 +#define regRSMU_ROM_ADDR_DIO_BASE_IDX 5 +#define regRSMU_MEM_POWER_CTRL_DIO 0x0406 +#define regRSMU_MEM_POWER_CTRL_DIO_BASE_IDX 5 +#define regRSMU_MP0_STRAPRX_ADDR_DIO 0x0407 +#define regRSMU_MP0_STRAPRX_ADDR_DIO_BASE_IDX 5 +#define regRSMU_MP0_STRAPRX_DATA_DIO 0x0408 +#define regRSMU_MP0_STRAPRX_DATA_DIO_BASE_IDX 5 +#define regRSMU_PIN_STRAP_DATA_DIO 0x0409 +#define regRSMU_PIN_STRAP_DATA_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_CFG_DIO 0x040a +#define regRSMU_SMS_FUSE_CFG_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_BASE_DIO 0x040b +#define regRSMU_SMS_FUSE_ADDR_BASE_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_DIO 0x040c +#define regRSMU_SMS_FUSE_ADDR_OFFSET_DIO_BASE_IDX 5 +#define regRSMU_STRAP_CONTROL_DIO 0x040d +#define regRSMU_STRAP_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET1_DIO 0x040e +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET1_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET2_DIO 0x040f +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET2_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET3_DIO 0x0410 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET3_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_CNTL_SET_NONE_DEFAULT_DIO 0x0411 +#define regRSMU_SMS_FUSE_CNTL_SET_NONE_DEFAULT_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_STATUS_SET_NONE_DEFAULT_DIO 0x0412 +#define regRSMU_SMS_FUSE_STATUS_SET_NONE_DEFAULT_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET4_DIO 0x0413 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET4_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET5_DIO 0x0414 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET5_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET6_DIO 0x0415 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET6_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET7_DIO 0x0416 +#define regRSMU_SMS_FUSE_ADDR_OFFSET_GRP_SET7_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_STATUS_SET_NONE_DEFAULT1_DIO 0x0417 +#define regRSMU_SMS_FUSE_STATUS_SET_NONE_DEFAULT1_DIO_BASE_IDX 5 +#define regRSMU_CAC_CONTROL_DIO 0x0450 +#define regRSMU_CAC_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_MASK_LO_DIO 0x0451 +#define regRSMU_CAC_ACC_MASK_LO_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_0_DIO 0x0452 +#define regRSMU_CAC_WEIGHT_0_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_1_DIO 0x0453 +#define regRSMU_CAC_WEIGHT_1_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_2_DIO 0x0454 +#define regRSMU_CAC_WEIGHT_2_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_3_DIO 0x0455 +#define regRSMU_CAC_WEIGHT_3_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_4_DIO 0x0456 +#define regRSMU_CAC_WEIGHT_4_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_5_DIO 0x0457 +#define regRSMU_CAC_WEIGHT_5_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_6_DIO 0x0458 +#define regRSMU_CAC_WEIGHT_6_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_7_DIO 0x0459 +#define regRSMU_CAC_WEIGHT_7_DIO_BASE_IDX 5 +#define regRSMU_CAC_WEIGHT_8_DIO 0x045a +#define regRSMU_CAC_WEIGHT_8_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_MASK_HI_DIO 0x046c +#define regRSMU_CAC_ACC_MASK_HI_DIO_BASE_IDX 5 +#define regRSMU_MMIOPUB_SCRATCH_REG_0_DIO 0x048a +#define regRSMU_MMIOPUB_SCRATCH_REG_0_DIO_BASE_IDX 5 +#define regRSMU_VF_ENABLE_DIO 0x048b +#define regRSMU_VF_ENABLE_DIO_BASE_IDX 5 +#define regRSMU_MGCG_CONTROL_DIO 0x048c +#define regRSMU_MGCG_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_AXI_MASTER_QOS_CNTL_DIO 0x048e +#define regRSMU_AXI_MASTER_QOS_CNTL_DIO_BASE_IDX 5 +#define regRSMU_MASTER_ERROR_COUNTER_DIO 0x048f +#define regRSMU_MASTER_ERROR_COUNTER_DIO_BASE_IDX 5 +#define regRSMU_SLAVE_TIMEOUT_VALUE_DIO 0x0490 +#define regRSMU_SLAVE_TIMEOUT_VALUE_DIO_BASE_IDX 5 +#define regRSMU_RESET_TIMEOUT_CONTROL_DIO 0x0491 +#define regRSMU_RESET_TIMEOUT_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_SLAVE_ERROR_COUNTER_DIO 0x0492 +#define regRSMU_SLAVE_ERROR_COUNTER_DIO_BASE_IDX 5 +#define regRSMU_DBG_MUX_CONTROL_DIO 0x0493 +#define regRSMU_DBG_MUX_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_IP_CLOCK_GATE_CNTL_DIO 0x04be +#define regRSMU_IP_CLOCK_GATE_CNTL_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_0_DIO 0x04bf +#define regRSMU_CAC_ACC_0_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_1_DIO 0x04c0 +#define regRSMU_CAC_ACC_1_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_2_DIO 0x04c1 +#define regRSMU_CAC_ACC_2_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_3_DIO 0x04c2 +#define regRSMU_CAC_ACC_3_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_4_DIO 0x04c3 +#define regRSMU_CAC_ACC_4_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_5_DIO 0x04c4 +#define regRSMU_CAC_ACC_5_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_6_DIO 0x04c5 +#define regRSMU_CAC_ACC_6_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_7_DIO 0x04c6 +#define regRSMU_CAC_ACC_7_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_8_DIO 0x04c7 +#define regRSMU_CAC_ACC_8_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_9_DIO 0x04c8 +#define regRSMU_CAC_ACC_9_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_10_DIO 0x04c9 +#define regRSMU_CAC_ACC_10_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_11_DIO 0x04ca +#define regRSMU_CAC_ACC_11_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_12_DIO 0x04cb +#define regRSMU_CAC_ACC_12_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_13_DIO 0x04cc +#define regRSMU_CAC_ACC_13_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_14_DIO 0x04cd +#define regRSMU_CAC_ACC_14_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_15_DIO 0x04ce +#define regRSMU_CAC_ACC_15_DIO_BASE_IDX 5 +#define regRSMU_CAC_ACC_16_DIO 0x04cf +#define regRSMU_CAC_ACC_16_DIO_BASE_IDX 5 +#define regRSMU_MSMU_FETCH_FUSE_DIO 0x04ef +#define regRSMU_MSMU_FETCH_FUSE_DIO_BASE_IDX 5 +#define regRSMU_MSMU_FETCH_ROM_DIO 0x04f0 +#define regRSMU_MSMU_FETCH_ROM_DIO_BASE_IDX 5 +#define regRSMU_STRAP_STATUS_DIO 0x04f1 +#define regRSMU_STRAP_STATUS_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_CLEAR_SET0_DIO 0x04f2 +#define regRSMU_SMS_FUSE_CLEAR_SET0_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_0_DIO 0x04f3 +#define regRSMU_SMS_FUSE_DATA_GRP_0_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_1_DIO 0x04f4 +#define regRSMU_SMS_FUSE_DATA_GRP_1_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_2_DIO 0x04f5 +#define regRSMU_SMS_FUSE_DATA_GRP_2_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_3_DIO 0x04f6 +#define regRSMU_SMS_FUSE_DATA_GRP_3_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_4_DIO 0x04f7 +#define regRSMU_SMS_FUSE_DATA_GRP_4_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_5_DIO 0x04f8 +#define regRSMU_SMS_FUSE_DATA_GRP_5_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_6_DIO 0x04f9 +#define regRSMU_SMS_FUSE_DATA_GRP_6_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_7_DIO 0x04fa +#define regRSMU_SMS_FUSE_DATA_GRP_7_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_8_DIO 0x04fb +#define regRSMU_SMS_FUSE_DATA_GRP_8_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_9_DIO 0x04fc +#define regRSMU_SMS_FUSE_DATA_GRP_9_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_DATA_GRP_10_DIO 0x04fd +#define regRSMU_SMS_FUSE_DATA_GRP_10_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_FIFO_EMPTY_DIO 0x0513 +#define regRSMU_SMS_FUSE_FIFO_EMPTY_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_FIFO_FULL_DIO 0x0514 +#define regRSMU_SMS_FUSE_FIFO_FULL_DIO_BASE_IDX 5 +#define regRSMU_ASP_FUSE_ADDR_DIO 0x0515 +#define regRSMU_ASP_FUSE_ADDR_DIO_BASE_IDX 5 +#define regRSMU_ASP_FUSE_DATA_DIO 0x0516 +#define regRSMU_ASP_FUSE_DATA_DIO_BASE_IDX 5 +#define regRSMU_ASP_STRAP_CONTROL_DIO 0x0517 +#define regRSMU_ASP_STRAP_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_DIO 0x0519 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_DIO_BASE_IDX 5 +#define regRSMU_XBAR_CG_MISC_DIO 0x051b +#define regRSMU_XBAR_CG_MISC_DIO_BASE_IDX 5 +#define regRSMU_XBAR_CG_CTRL_DIO 0x051c +#define regRSMU_XBAR_CG_CTRL_DIO_BASE_IDX 5 + + +// addressBlock: dce_rsmu_dio_rsmu_dio_RsmuMmioextDioDec +// base address: 0x9010780 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_DIO 0x05e7 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_DIO_BASE_IDX 5 +#define regRSMU_SW_STRAPRX_ADDR_DIO 0x05eb +#define regRSMU_SW_STRAPRX_ADDR_DIO_BASE_IDX 5 +#define regRSMU_SW_STRAPRX_DATA_DIO 0x05ec +#define regRSMU_SW_STRAPRX_DATA_DIO_BASE_IDX 5 +#define regRSMU_SW_STRAP_CONTROL_DIO 0x05ed +#define regRSMU_SW_STRAP_CONTROL_DIO_BASE_IDX 5 +#define regRSMU_TIMEOUT_ERROR_LOG_REG_DIO 0x05ee +#define regRSMU_TIMEOUT_ERROR_LOG_REG_DIO_BASE_IDX 5 +#define regRSMU_IP_MASTER_STATUS_DIO 0x05ef +#define regRSMU_IP_MASTER_STATUS_DIO_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_DIO 0x05f0 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_DIO_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_DIO 0x05f1 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_DIO_BASE_IDX 5 +#define regRSMU_VERSION_DIO 0x05f5 +#define regRSMU_VERSION_DIO_BASE_IDX 5 + + +// addressBlock: dce_rsmu_dio_rsmu_dio_RsmuMmiosecDioDec +// base address: 0x9010800 +#define regRSMU_AEB_OVERRIDE_0_DIO 0x0602 +#define regRSMU_AEB_OVERRIDE_0_DIO_BASE_IDX 5 +#define regRSMU_AEB_OVERRIDE_1_DIO 0x0603 +#define regRSMU_AEB_OVERRIDE_1_DIO_BASE_IDX 5 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_DIO 0x0771 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_DIO_BASE_IDX 5 +#define regRSMU_AEB_VALUE_0_DIO 0x0773 +#define regRSMU_AEB_VALUE_0_DIO_BASE_IDX 5 +#define regRSMU_AEB_VALUE_1_DIO 0x0774 +#define regRSMU_AEB_VALUE_1_DIO_BASE_IDX 5 + + +// addressBlock: dce_rsmu_hda_rsmu_hda_RsmuMmiopubHdaDec +// base address: 0x9012000 +#define regRSMU_MEM_POWER_CTRL2_HDA 0x0c00 +#define regRSMU_MEM_POWER_CTRL2_HDA_BASE_IDX 5 +#define regRSMU_HARD_RESETB_HDA 0x0c02 +#define regRSMU_HARD_RESETB_HDA_BASE_IDX 5 +#define regRSMU_MEM_POWER_CTRL_HDA 0x0c06 +#define regRSMU_MEM_POWER_CTRL_HDA_BASE_IDX 5 +#define regRSMU_STRAP_CONTROL_HDA 0x0c0d +#define regRSMU_STRAP_CONTROL_HDA_BASE_IDX 5 +#define regRSMU_MMIOPUB_SCRATCH_REG_0_HDA 0x0c8a +#define regRSMU_MMIOPUB_SCRATCH_REG_0_HDA_BASE_IDX 5 +#define regRSMU_VF_ENABLE_HDA 0x0c8b +#define regRSMU_VF_ENABLE_HDA_BASE_IDX 5 +#define regRSMU_MGCG_CONTROL_HDA 0x0c8c +#define regRSMU_MGCG_CONTROL_HDA_BASE_IDX 5 +#define regRSMU_AXI_MASTER_QOS_CNTL_HDA 0x0c8e +#define regRSMU_AXI_MASTER_QOS_CNTL_HDA_BASE_IDX 5 +#define regRSMU_MASTER_ERROR_COUNTER_HDA 0x0c8f +#define regRSMU_MASTER_ERROR_COUNTER_HDA_BASE_IDX 5 +#define regRSMU_SLAVE_TIMEOUT_VALUE_HDA 0x0c90 +#define regRSMU_SLAVE_TIMEOUT_VALUE_HDA_BASE_IDX 5 +#define regRSMU_RESET_TIMEOUT_CONTROL_HDA 0x0c91 +#define regRSMU_RESET_TIMEOUT_CONTROL_HDA_BASE_IDX 5 +#define regRSMU_SLAVE_ERROR_COUNTER_HDA 0x0c92 +#define regRSMU_SLAVE_ERROR_COUNTER_HDA_BASE_IDX 5 +#define regRSMU_DBG_MUX_CONTROL_HDA 0x0c93 +#define regRSMU_DBG_MUX_CONTROL_HDA_BASE_IDX 5 +#define regRSMU_IP_CLOCK_GATE_CNTL_HDA 0x0cbe +#define regRSMU_IP_CLOCK_GATE_CNTL_HDA_BASE_IDX 5 +#define regRSMU_MSMU_FETCH_FUSE_HDA 0x0cef +#define regRSMU_MSMU_FETCH_FUSE_HDA_BASE_IDX 5 +#define regRSMU_STRAP_STATUS_HDA 0x0cf1 +#define regRSMU_STRAP_STATUS_HDA_BASE_IDX 5 +#define regRSMU_SMS_FUSE_CLEAR_SET0_HDA 0x0cf2 +#define regRSMU_SMS_FUSE_CLEAR_SET0_HDA_BASE_IDX 5 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_HDA 0x0d19 +#define regRSMU_SMS_FUSE_RETRIGGER_SET0_HDA_BASE_IDX 5 +#define regRSMU_XBAR_CG_MISC_HDA 0x0d1b +#define regRSMU_XBAR_CG_MISC_HDA_BASE_IDX 5 +#define regRSMU_XBAR_CG_CTRL_HDA 0x0d1c +#define regRSMU_XBAR_CG_CTRL_HDA_BASE_IDX 5 + + +// addressBlock: dce_rsmu_hda_rsmu_hda_RsmuMmioextHdaDec +// base address: 0x9012780 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_HDA 0x0de7 +#define regRSMU_TIMEOUT_ERROR_LOG_REG1_HDA_BASE_IDX 5 +#define regRSMU_TIMEOUT_ERROR_LOG_REG_HDA 0x0dee +#define regRSMU_TIMEOUT_ERROR_LOG_REG_HDA_BASE_IDX 5 +#define regRSMU_IP_MASTER_STATUS_HDA 0x0def +#define regRSMU_IP_MASTER_STATUS_HDA_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_HDA 0x0df0 +#define regRSMU_MMIOEXT_SCRATCH_REG_0_HDA_BASE_IDX 5 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_HDA 0x0df1 +#define regRSMU_MMIOEXT_SCRATCH_REG_1_HDA_BASE_IDX 5 +#define regRSMU_VERSION_HDA 0x0df5 +#define regRSMU_VERSION_HDA_BASE_IDX 5 + + +// addressBlock: dce_rsmu_hda_rsmu_hda_RsmuMmiosecHdaDec +// base address: 0x9012800 +#define regRSMU_AEB_OVERRIDE_0_HDA 0x0e02 +#define regRSMU_AEB_OVERRIDE_0_HDA_BASE_IDX 5 +#define regRSMU_AEB_OVERRIDE_1_HDA 0x0e03 +#define regRSMU_AEB_OVERRIDE_1_HDA_BASE_IDX 5 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_HDA 0x0f71 +#define regRSMU_MMIOSEC_SCRATCH_REG_0_HDA_BASE_IDX 5 +#define regRSMU_AEB_VALUE_0_HDA 0x0f73 +#define regRSMU_AEB_VALUE_0_HDA_BASE_IDX 5 +#define regRSMU_AEB_VALUE_1_HDA 0x0f74 +#define regRSMU_AEB_VALUE_1_HDA_BASE_IDX 5 + + +// addressBlock: dce_dc_hda_azcontroller_azdec +// base address: 0x0 +#define regAZCONTROLLER1_CORB_WRITE_POINTER 0x0000 +#define regAZCONTROLLER1_CORB_WRITE_POINTER_BASE_IDX 0 +#define regAZCONTROLLER1_CORB_READ_POINTER 0x0000 +#define regAZCONTROLLER1_CORB_READ_POINTER_BASE_IDX 0 +#define regAZCONTROLLER1_CORB_CONTROL 0x0001 +#define regAZCONTROLLER1_CORB_CONTROL_BASE_IDX 0 +#define regAZCONTROLLER1_CORB_STATUS 0x0001 +#define regAZCONTROLLER1_CORB_STATUS_BASE_IDX 0 +#define regAZCONTROLLER1_CORB_SIZE 0x0001 +#define regAZCONTROLLER1_CORB_SIZE_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_LOWER_BASE_ADDRESS 0x0002 +#define regAZCONTROLLER1_RIRB_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_UPPER_BASE_ADDRESS 0x0003 +#define regAZCONTROLLER1_RIRB_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_WRITE_POINTER 0x0004 +#define regAZCONTROLLER1_RIRB_WRITE_POINTER_BASE_IDX 0 +#define regAZCONTROLLER1_RESPONSE_INTERRUPT_COUNT 0x0004 +#define regAZCONTROLLER1_RESPONSE_INTERRUPT_COUNT_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_CONTROL 0x0005 +#define regAZCONTROLLER1_RIRB_CONTROL_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_STATUS 0x0005 +#define regAZCONTROLLER1_RIRB_STATUS_BASE_IDX 0 +#define regAZCONTROLLER1_RIRB_SIZE 0x0005 +#define regAZCONTROLLER1_RIRB_SIZE_BASE_IDX 0 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE 0x0006 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_BASE_IDX 0 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x0006 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 0 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x0006 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 0 +#define regAZCONTROLLER1_IMMEDIATE_RESPONSE_INPUT_INTERFACE 0x0007 +#define regAZCONTROLLER1_IMMEDIATE_RESPONSE_INPUT_INTERFACE_BASE_IDX 0 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_STATUS 0x0008 +#define regAZCONTROLLER1_IMMEDIATE_COMMAND_STATUS_BASE_IDX 0 +#define regAZCONTROLLER1_DMA_POSITION_LOWER_BASE_ADDRESS 0x000a +#define regAZCONTROLLER1_DMA_POSITION_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZCONTROLLER1_DMA_POSITION_UPPER_BASE_ADDRESS 0x000b +#define regAZCONTROLLER1_DMA_POSITION_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZCONTROLLER1_WALL_CLOCK_COUNTER_ALIAS 0x074c +#define regAZCONTROLLER1_WALL_CLOCK_COUNTER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azendpoint_azdec +// base address: 0x0 +#define regAZENDPOINT1_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x0006 +#define regAZENDPOINT1_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 0 +#define regAZENDPOINT1_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x0006 +#define regAZENDPOINT1_AZENDPOINT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 0 + + +// addressBlock: dce_dc_hda_azroot_azdec +// base address: 0x0 +#define regAZROOT1_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA 0x0006 +#define regAZROOT1_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_DATA_BASE_IDX 0 +#define regAZROOT1_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX 0x0006 +#define regAZROOT1_AZROOT_IMMEDIATE_COMMAND_OUTPUT_INTERFACE_INDEX_BASE_IDX 0 + + +// addressBlock: dce_dc_hda_azstream0_azdec +// base address: 0x0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x000e +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x000f +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0010 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0011 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x0012 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x0012 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x0014 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x0015 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0761 +#define regAZSTREAM0_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream1_azdec +// base address: 0x20 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x0016 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x0017 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0018 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0019 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x001a +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x001a +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x001c +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x001d +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0769 +#define regAZSTREAM1_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream2_azdec +// base address: 0x40 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x001e +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x001f +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0020 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0021 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x0022 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x0022 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x0024 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x0025 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0771 +#define regAZSTREAM2_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream3_azdec +// base address: 0x60 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x0026 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x0027 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0028 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0029 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x002a +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x002a +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x002c +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x002d +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0779 +#define regAZSTREAM3_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream4_azdec +// base address: 0x80 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x002e +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x002f +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0030 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0031 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x0032 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x0032 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x0034 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x0035 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0781 +#define regAZSTREAM4_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream5_azdec +// base address: 0xa0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x0036 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x0037 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0038 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0039 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x003a +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x003a +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x003c +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x003d +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0789 +#define regAZSTREAM5_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream6_azdec +// base address: 0xc0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x003e +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x003f +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0040 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0041 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x0042 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x0042 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x0044 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x0045 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0791 +#define regAZSTREAM6_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_hda_azstream7_azdec +// base address: 0xe0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS 0x0046 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_CONTROL_AND_STATUS_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER 0x0047 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH 0x0048 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_CYCLIC_BUFFER_LENGTH_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX 0x0049 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LAST_VALID_INDEX_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE 0x004a +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_FIFO_SIZE_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT 0x004a +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_FORMAT_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS 0x004c +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_LOWER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS 0x004d +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_BDL_POINTER_UPPER_BASE_ADDRESS_BASE_IDX 0 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS 0x0799 +#define regAZSTREAM7_1_OUTPUT_STREAM_DESCRIPTOR_LINK_POSITION_IN_CURRENT_BUFFER_ALIAS_BASE_IDX 1 + + +// addressBlock: dce_dc_dccg_dccg_dispdec +// base address: 0x0 +#define regPHYPLLA_PIXCLK_RESYNC_CNTL 0x0040 +#define regPHYPLLA_PIXCLK_RESYNC_CNTL_BASE_IDX 1 +#define regPHYPLLB_PIXCLK_RESYNC_CNTL 0x0041 +#define regPHYPLLB_PIXCLK_RESYNC_CNTL_BASE_IDX 1 +#define regPHYPLLC_PIXCLK_RESYNC_CNTL 0x0042 +#define regPHYPLLC_PIXCLK_RESYNC_CNTL_BASE_IDX 1 +#define regPHYPLLD_PIXCLK_RESYNC_CNTL 0x0043 +#define regPHYPLLD_PIXCLK_RESYNC_CNTL_BASE_IDX 1 +#define regDP_DTO_DBUF_EN 0x0044 +#define regDP_DTO_DBUF_EN_BASE_IDX 1 +#define regDSCCLK3_DTO_PARAM 0x0045 +#define regDSCCLK3_DTO_PARAM_BASE_IDX 1 +#define regDPREFCLK_CGTT_BLK_CTRL_REG 0x0048 +#define regDPREFCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL4 0x0049 +#define regDCCG_GATE_DISABLE_CNTL4_BASE_IDX 1 +#define regDPSTREAMCLK_CNTL 0x004a +#define regDPSTREAMCLK_CNTL_BASE_IDX 1 +#define regREFCLK_CGTT_BLK_CTRL_REG 0x004b +#define regREFCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regDCCG_GLOBAL_FGCG_REP_CNTL 0x0050 +#define regDCCG_GLOBAL_FGCG_REP_CNTL_BASE_IDX 1 +#define regOTG_ADD_DROP_PIXEL_CNTL 0x0056 +#define regOTG_ADD_DROP_PIXEL_CNTL_BASE_IDX 1 +#define regDIO_DME_MEM_RCLK_CNTL 0x0061 +#define regDIO_DME_MEM_RCLK_CNTL_BASE_IDX 1 +#define regHPO_DME_MEM_RCLK_CNTL 0x0062 +#define regHPO_DME_MEM_RCLK_CNTL_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL7 0x0063 +#define regDCCG_GATE_DISABLE_CNTL7_BASE_IDX 1 +#define regSYMCLK32_SE_CNTL 0x0065 +#define regSYMCLK32_SE_CNTL_BASE_IDX 1 +#define regSYMCLK32_LE_CNTL 0x0066 +#define regSYMCLK32_LE_CNTL_BASE_IDX 1 +#define regDTBCLK_P_CNTL 0x0068 +#define regDTBCLK_P_CNTL_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL5 0x0069 +#define regDCCG_GATE_DISABLE_CNTL5_BASE_IDX 1 +#define regDSCCLK0_DTO_PARAM 0x006c +#define regDSCCLK0_DTO_PARAM_BASE_IDX 1 +#define regDSCCLK1_DTO_PARAM 0x006d +#define regDSCCLK1_DTO_PARAM_BASE_IDX 1 +#define regDSCCLK2_DTO_PARAM 0x006e +#define regDSCCLK2_DTO_PARAM_BASE_IDX 1 +#define regOTG_PIXEL_RATE_DIV 0x006f +#define regOTG_PIXEL_RATE_DIV_BASE_IDX 1 +#define regMILLISECOND_TIME_BASE_DIV 0x0070 +#define regMILLISECOND_TIME_BASE_DIV_BASE_IDX 1 +#define regDISPCLK_FREQ_CHANGE_CNTL 0x0071 +#define regDISPCLK_FREQ_CHANGE_CNTL_BASE_IDX 1 +#define regDC_MEM_GLOBAL_PWR_REQ_CNTL 0x0072 +#define regDC_MEM_GLOBAL_PWR_REQ_CNTL_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL 0x0074 +#define regDCCG_GATE_DISABLE_CNTL_BASE_IDX 1 +#define regDISPCLK_CGTT_BLK_CTRL_REG 0x0075 +#define regDISPCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regSOCCLK_CGTT_BLK_CTRL_REG 0x0076 +#define regSOCCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regMICROSECOND_TIME_BASE_DIV 0x007b +#define regMICROSECOND_TIME_BASE_DIV_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL2 0x007c +#define regDCCG_GATE_DISABLE_CNTL2_BASE_IDX 1 +#define regSYMCLK_CGTT_BLK_CTRL_REG 0x007d +#define regSYMCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regOTG0_PIXEL_RATE_CNTL 0x0080 +#define regOTG0_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regDP_DTO0_PHASE 0x0081 +#define regDP_DTO0_PHASE_BASE_IDX 1 +#define regDP_DTO0_MODULO 0x0082 +#define regDP_DTO0_MODULO_BASE_IDX 1 +#define regOTG0_PHYPLL_PIXEL_RATE_CNTL 0x0083 +#define regOTG0_PHYPLL_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regOTG1_PIXEL_RATE_CNTL 0x0084 +#define regOTG1_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regDP_DTO1_PHASE 0x0085 +#define regDP_DTO1_PHASE_BASE_IDX 1 +#define regDP_DTO1_MODULO 0x0086 +#define regDP_DTO1_MODULO_BASE_IDX 1 +#define regOTG1_PHYPLL_PIXEL_RATE_CNTL 0x0087 +#define regOTG1_PHYPLL_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regOTG2_PIXEL_RATE_CNTL 0x0088 +#define regOTG2_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regDP_DTO2_PHASE 0x0089 +#define regDP_DTO2_PHASE_BASE_IDX 1 +#define regDP_DTO2_MODULO 0x008a +#define regDP_DTO2_MODULO_BASE_IDX 1 +#define regOTG2_PHYPLL_PIXEL_RATE_CNTL 0x008b +#define regOTG2_PHYPLL_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regOTG3_PIXEL_RATE_CNTL 0x008c +#define regOTG3_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regDP_DTO3_PHASE 0x008d +#define regDP_DTO3_PHASE_BASE_IDX 1 +#define regDP_DTO3_MODULO 0x008e +#define regDP_DTO3_MODULO_BASE_IDX 1 +#define regOTG3_PHYPLL_PIXEL_RATE_CNTL 0x008f +#define regOTG3_PHYPLL_PIXEL_RATE_CNTL_BASE_IDX 1 +#define regDPPCLK_CGTT_BLK_CTRL_REG 0x0098 +#define regDPPCLK_CGTT_BLK_CTRL_REG_BASE_IDX 1 +#define regDPPCLK0_DTO_PARAM 0x0099 +#define regDPPCLK0_DTO_PARAM_BASE_IDX 1 +#define regDPPCLK1_DTO_PARAM 0x009a +#define regDPPCLK1_DTO_PARAM_BASE_IDX 1 +#define regDPPCLK2_DTO_PARAM 0x009b +#define regDPPCLK2_DTO_PARAM_BASE_IDX 1 +#define regDPPCLK3_DTO_PARAM 0x009c +#define regDPPCLK3_DTO_PARAM_BASE_IDX 1 +#define regSYMCLKA_CLOCK_ENABLE 0x00a0 +#define regSYMCLKA_CLOCK_ENABLE_BASE_IDX 1 +#define regSYMCLKB_CLOCK_ENABLE 0x00a1 +#define regSYMCLKB_CLOCK_ENABLE_BASE_IDX 1 +#define regSYMCLKC_CLOCK_ENABLE 0x00a2 +#define regSYMCLKC_CLOCK_ENABLE_BASE_IDX 1 +#define regSYMCLKD_CLOCK_ENABLE 0x00a3 +#define regSYMCLKD_CLOCK_ENABLE_BASE_IDX 1 +#define regDCCG_SOFT_RESET 0x00a6 +#define regDCCG_SOFT_RESET_BASE_IDX 1 +#define regDSCCLK_DTO_CTRL 0x00a7 +#define regDSCCLK_DTO_CTRL_BASE_IDX 1 +#define regDPPCLK_CTRL 0x00a8 +#define regDPPCLK_CTRL_BASE_IDX 1 +#define regDCCG_GATE_DISABLE_CNTL6 0x00a9 +#define regDCCG_GATE_DISABLE_CNTL6_BASE_IDX 1 +#define regSYMCLK_PSP_CNTL 0x00aa +#define regSYMCLK_PSP_CNTL_BASE_IDX 1 +#define regDCCG_AUDIO_DTO_SOURCE 0x00ab +#define regDCCG_AUDIO_DTO_SOURCE_BASE_IDX 1 +#define regDCCG_AUDIO_DTO0_PHASE 0x00ac +#define regDCCG_AUDIO_DTO0_PHASE_BASE_IDX 1 +#define regDCCG_AUDIO_DTO0_MODULE 0x00ad +#define regDCCG_AUDIO_DTO0_MODULE_BASE_IDX 1 +#define regDCCG_AUDIO_DTO1_PHASE 0x00ae +#define regDCCG_AUDIO_DTO1_PHASE_BASE_IDX 1 +#define regDCCG_AUDIO_DTO1_MODULE 0x00af +#define regDCCG_AUDIO_DTO1_MODULE_BASE_IDX 1 +#define regDPPCLK_DTO_CTRL 0x00b6 +#define regDPPCLK_DTO_CTRL_BASE_IDX 1 +#define regDCCG_TEST_DEBUG_INDEX 0x00bc +#define regDCCG_TEST_DEBUG_INDEX_BASE_IDX 1 +#define regDCCG_TEST_DEBUG_DATA 0x00bd +#define regDCCG_TEST_DEBUG_DATA_BASE_IDX 1 +#define regHDMICHARCLK0_CLOCK_CNTL 0x004a +#define regHDMICHARCLK0_CLOCK_CNTL_BASE_IDX 2 +#define regPHYASYMCLK_CLOCK_CNTL 0x0052 +#define regPHYASYMCLK_CLOCK_CNTL_BASE_IDX 2 +#define regPHYBSYMCLK_CLOCK_CNTL 0x0053 +#define regPHYBSYMCLK_CLOCK_CNTL_BASE_IDX 2 +#define regPHYCSYMCLK_CLOCK_CNTL 0x0054 +#define regPHYCSYMCLK_CLOCK_CNTL_BASE_IDX 2 +#define regPHYDSYMCLK_CLOCK_CNTL 0x0055 +#define regPHYDSYMCLK_CLOCK_CNTL_BASE_IDX 2 +#define regHDMISTREAMCLK_CNTL 0x0059 +#define regHDMISTREAMCLK_CNTL_BASE_IDX 2 +#define regDCCG_GATE_DISABLE_CNTL3 0x005a +#define regDCCG_GATE_DISABLE_CNTL3_BASE_IDX 2 +#define regHDMISTREAMCLK0_DTO_PARAM 0x005b +#define regHDMISTREAMCLK0_DTO_PARAM_BASE_IDX 2 +#define regDSCCLK_SRC_SEL 0x0060 +#define regDSCCLK_SRC_SEL_BASE_IDX 2 + + +// addressBlock: dce_dc_dccg_dccg_dcperfmon0_dc_perfmon_dispdec +// base address: 0x0 +#define regDC_PERFMON0_PERFCOUNTER_CNTL 0x0000 +#define regDC_PERFMON0_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON0_PERFCOUNTER_CNTL2 0x0001 +#define regDC_PERFMON0_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON0_PERFCOUNTER_STATE 0x0002 +#define regDC_PERFMON0_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_CNTL 0x0003 +#define regDC_PERFMON0_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_CNTL2 0x0004 +#define regDC_PERFMON0_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_CVALUE_INT_MISC 0x0005 +#define regDC_PERFMON0_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_CVALUE_LOW 0x0006 +#define regDC_PERFMON0_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_HI 0x0007 +#define regDC_PERFMON0_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_LOW 0x0008 +#define regDC_PERFMON0_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_TEST_DEBUG_INDEX 0x0009 +#define regDC_PERFMON0_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON0_PERFMON_TEST_DEBUG_DATA 0x000a +#define regDC_PERFMON0_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dccg_dccg_dcperfmon1_dc_perfmon_dispdec +// base address: 0x30 +#define regDC_PERFMON1_PERFCOUNTER_CNTL 0x000c +#define regDC_PERFMON1_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON1_PERFCOUNTER_CNTL2 0x000d +#define regDC_PERFMON1_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON1_PERFCOUNTER_STATE 0x000e +#define regDC_PERFMON1_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_CNTL 0x000f +#define regDC_PERFMON1_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_CNTL2 0x0010 +#define regDC_PERFMON1_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_CVALUE_INT_MISC 0x0011 +#define regDC_PERFMON1_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_CVALUE_LOW 0x0012 +#define regDC_PERFMON1_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_HI 0x0013 +#define regDC_PERFMON1_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_LOW 0x0014 +#define regDC_PERFMON1_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_TEST_DEBUG_INDEX 0x0015 +#define regDC_PERFMON1_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON1_PERFMON_TEST_DEBUG_DATA 0x0016 +#define regDC_PERFMON1_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_fgsec_dispdec +// base address: 0x0 +#define regSECURE_CHECK_CONFIG 0x016e +#define regSECURE_CHECK_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP0_CONFIG 0x016f +#define regSECURE_GROUP0_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP1_CONFIG 0x0170 +#define regSECURE_GROUP1_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP2_CONFIG 0x0171 +#define regSECURE_GROUP2_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP3_CONFIG 0x0172 +#define regSECURE_GROUP3_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP4_CONFIG 0x0173 +#define regSECURE_GROUP4_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP5_CONFIG 0x0174 +#define regSECURE_GROUP5_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP6_CONFIG 0x0175 +#define regSECURE_GROUP6_CONFIG_BASE_IDX 2 +#define regSECURE_GROUP7_CONFIG 0x0176 +#define regSECURE_GROUP7_CONFIG_BASE_IDX 2 +#define regSECURE_INTERRUPT0_INFO0 0x0177 +#define regSECURE_INTERRUPT0_INFO0_BASE_IDX 2 +#define regSECURE_INTERRUPT0_INFO1 0x0178 +#define regSECURE_INTERRUPT0_INFO1_BASE_IDX 2 +#define regDMCUB_RBBMIF_SEC_CNTL 0x017a +#define regDMCUB_RBBMIF_SEC_CNTL_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_rbbmif_dispdec +// base address: 0x0 +#define regRBBMIF_TIMEOUT 0x017f +#define regRBBMIF_TIMEOUT_BASE_IDX 2 +#define regRBBMIF_STATUS 0x0180 +#define regRBBMIF_STATUS_BASE_IDX 2 +#define regRBBMIF_STATUS_2 0x0181 +#define regRBBMIF_STATUS_2_BASE_IDX 2 +#define regRBBMIF_INT_STATUS 0x0182 +#define regRBBMIF_INT_STATUS_BASE_IDX 2 +#define regRBBMIF_TIMEOUT_DIS 0x0183 +#define regRBBMIF_TIMEOUT_DIS_BASE_IDX 2 +#define regRBBMIF_TIMEOUT_DIS_2 0x0184 +#define regRBBMIF_TIMEOUT_DIS_2_BASE_IDX 2 +#define regRBBMIF_STATUS_FLAG 0x0185 +#define regRBBMIF_STATUS_FLAG_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_dmu_dcperfmon_dc_perfmon_dispdec +// base address: 0x2f8 +#define regDC_PERFMON2_PERFCOUNTER_CNTL 0x00be +#define regDC_PERFMON2_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON2_PERFCOUNTER_CNTL2 0x00bf +#define regDC_PERFMON2_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON2_PERFCOUNTER_STATE 0x00c0 +#define regDC_PERFMON2_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_CNTL 0x00c1 +#define regDC_PERFMON2_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_CNTL2 0x00c2 +#define regDC_PERFMON2_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_CVALUE_INT_MISC 0x00c3 +#define regDC_PERFMON2_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_CVALUE_LOW 0x00c4 +#define regDC_PERFMON2_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_HI 0x00c5 +#define regDC_PERFMON2_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_LOW 0x00c6 +#define regDC_PERFMON2_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_TEST_DEBUG_INDEX 0x00c7 +#define regDC_PERFMON2_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON2_PERFMON_TEST_DEBUG_DATA 0x00c8 +#define regDC_PERFMON2_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_ihc_dispdec +// base address: 0x0 +#define regDC_GPU_TIMER_START_POSITION_V_UPDATE 0x0126 +#define regDC_GPU_TIMER_START_POSITION_V_UPDATE_BASE_IDX 2 +#define regDC_GPU_TIMER_START_POSITION_VSTARTUP 0x0127 +#define regDC_GPU_TIMER_START_POSITION_VSTARTUP_BASE_IDX 2 +#define regDC_GPU_TIMER_READ 0x0128 +#define regDC_GPU_TIMER_READ_BASE_IDX 2 +#define regDC_GPU_TIMER_READ_CNTL 0x0129 +#define regDC_GPU_TIMER_READ_CNTL_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS 0x012a +#define regDISP_INTERRUPT_STATUS_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE 0x012b +#define regDISP_INTERRUPT_STATUS_CONTINUE_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE2 0x012c +#define regDISP_INTERRUPT_STATUS_CONTINUE2_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE3 0x012d +#define regDISP_INTERRUPT_STATUS_CONTINUE3_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE4 0x012e +#define regDISP_INTERRUPT_STATUS_CONTINUE4_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE5 0x012f +#define regDISP_INTERRUPT_STATUS_CONTINUE5_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE6 0x0130 +#define regDISP_INTERRUPT_STATUS_CONTINUE6_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE7 0x0131 +#define regDISP_INTERRUPT_STATUS_CONTINUE7_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE8 0x0132 +#define regDISP_INTERRUPT_STATUS_CONTINUE8_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE9 0x0133 +#define regDISP_INTERRUPT_STATUS_CONTINUE9_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE10 0x0134 +#define regDISP_INTERRUPT_STATUS_CONTINUE10_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE11 0x0135 +#define regDISP_INTERRUPT_STATUS_CONTINUE11_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE12 0x0136 +#define regDISP_INTERRUPT_STATUS_CONTINUE12_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE13 0x0137 +#define regDISP_INTERRUPT_STATUS_CONTINUE13_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE14 0x0138 +#define regDISP_INTERRUPT_STATUS_CONTINUE14_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE15 0x0139 +#define regDISP_INTERRUPT_STATUS_CONTINUE15_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE16 0x013a +#define regDISP_INTERRUPT_STATUS_CONTINUE16_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE17 0x013b +#define regDISP_INTERRUPT_STATUS_CONTINUE17_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE18 0x013c +#define regDISP_INTERRUPT_STATUS_CONTINUE18_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE19 0x013d +#define regDISP_INTERRUPT_STATUS_CONTINUE19_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE20 0x013e +#define regDISP_INTERRUPT_STATUS_CONTINUE20_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE21 0x013f +#define regDISP_INTERRUPT_STATUS_CONTINUE21_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE22 0x0140 +#define regDISP_INTERRUPT_STATUS_CONTINUE22_BASE_IDX 2 +#define regDC_GPU_TIMER_START_POSITION_VREADY 0x0141 +#define regDC_GPU_TIMER_START_POSITION_VREADY_BASE_IDX 2 +#define regDC_GPU_TIMER_START_POSITION_FLIP 0x0142 +#define regDC_GPU_TIMER_START_POSITION_FLIP_BASE_IDX 2 +#define regDC_GPU_TIMER_START_POSITION_V_UPDATE_NO_LOCK 0x0143 +#define regDC_GPU_TIMER_START_POSITION_V_UPDATE_NO_LOCK_BASE_IDX 2 +#define regDC_GPU_TIMER_START_POSITION_FLIP_AWAY 0x0144 +#define regDC_GPU_TIMER_START_POSITION_FLIP_AWAY_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE23 0x0145 +#define regDISP_INTERRUPT_STATUS_CONTINUE23_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE24 0x0146 +#define regDISP_INTERRUPT_STATUS_CONTINUE24_BASE_IDX 2 +#define regDISP_INTERRUPT_STATUS_CONTINUE25 0x0147 +#define regDISP_INTERRUPT_STATUS_CONTINUE25_BASE_IDX 2 +#define regDCCG_INTERRUPT_DEST 0x0148 +#define regDCCG_INTERRUPT_DEST_BASE_IDX 2 +#define regDMU_INTERRUPT_DEST 0x0149 +#define regDMU_INTERRUPT_DEST_BASE_IDX 2 +#define regDMU_INTERRUPT_DEST2 0x014a +#define regDMU_INTERRUPT_DEST2_BASE_IDX 2 +#define regDCPG_INTERRUPT_DEST 0x014b +#define regDCPG_INTERRUPT_DEST_BASE_IDX 2 +#define regDCPG_INTERRUPT_DEST2 0x014c +#define regDCPG_INTERRUPT_DEST2_BASE_IDX 2 +#define regMMHUBBUB_INTERRUPT_DEST 0x014d +#define regMMHUBBUB_INTERRUPT_DEST_BASE_IDX 2 +#define regWB_INTERRUPT_DEST 0x014e +#define regWB_INTERRUPT_DEST_BASE_IDX 2 +#define regDCHUB_INTERRUPT_DEST 0x014f +#define regDCHUB_INTERRUPT_DEST_BASE_IDX 2 +#define regDCHUB_PERFCOUNTER_INTERRUPT_DEST 0x0150 +#define regDCHUB_PERFCOUNTER_INTERRUPT_DEST_BASE_IDX 2 +#define regDCHUB_INTERRUPT_DEST2 0x0151 +#define regDCHUB_INTERRUPT_DEST2_BASE_IDX 2 +#define regDPP_PERFCOUNTER_INTERRUPT_DEST 0x0152 +#define regDPP_PERFCOUNTER_INTERRUPT_DEST_BASE_IDX 2 +#define regMPC_INTERRUPT_DEST 0x0153 +#define regMPC_INTERRUPT_DEST_BASE_IDX 2 +#define regOPP_INTERRUPT_DEST 0x0154 +#define regOPP_INTERRUPT_DEST_BASE_IDX 2 +#define regOPTC_INTERRUPT_DEST 0x0155 +#define regOPTC_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG0_INTERRUPT_DEST 0x0156 +#define regOTG0_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG1_INTERRUPT_DEST 0x0157 +#define regOTG1_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG2_INTERRUPT_DEST 0x0158 +#define regOTG2_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG3_INTERRUPT_DEST 0x0159 +#define regOTG3_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG4_INTERRUPT_DEST 0x015a +#define regOTG4_INTERRUPT_DEST_BASE_IDX 2 +#define regOTG5_INTERRUPT_DEST 0x015b +#define regOTG5_INTERRUPT_DEST_BASE_IDX 2 +#define regDIG_INTERRUPT_DEST 0x015c +#define regDIG_INTERRUPT_DEST_BASE_IDX 2 +#define regI2C_DDC_HPD_INTERRUPT_DEST 0x015d +#define regI2C_DDC_HPD_INTERRUPT_DEST_BASE_IDX 2 +#define regHDCP_INTERRUPT_DEST 0x015e +#define regHDCP_INTERRUPT_DEST_BASE_IDX 2 +#define regDIO_INTERRUPT_DEST 0x015f +#define regDIO_INTERRUPT_DEST_BASE_IDX 2 +#define regDCIO_INTERRUPT_DEST 0x0160 +#define regDCIO_INTERRUPT_DEST_BASE_IDX 2 +#define regHPD_INTERRUPT_DEST 0x0161 +#define regHPD_INTERRUPT_DEST_BASE_IDX 2 +#define regAZ_INTERRUPT_DEST 0x0162 +#define regAZ_INTERRUPT_DEST_BASE_IDX 2 +#define regAUX_INTERRUPT_DEST 0x0163 +#define regAUX_INTERRUPT_DEST_BASE_IDX 2 +#define regDSC_INTERRUPT_DEST 0x0164 +#define regDSC_INTERRUPT_DEST_BASE_IDX 2 +#define regHPO_INTERRUPT_DEST 0x0165 +#define regHPO_INTERRUPT_DEST_BASE_IDX 2 +#define regDPP_INTERRUPT_DEST 0x0166 +#define regDPP_INTERRUPT_DEST_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_dmu_misc_dispdec +// base address: 0x0 +#define regCC_DC_PIPE_DIS 0x00ca +#define regCC_DC_PIPE_DIS_BASE_IDX 2 +#define regDMU_CLK_CNTL 0x00cb +#define regDMU_CLK_CNTL_BASE_IDX 2 +#define regDMCUB_SMU_INTERRUPT_CNTL 0x00cd +#define regDMCUB_SMU_INTERRUPT_CNTL_BASE_IDX 2 +#define regSMU_INTERRUPT_CONTROL 0x00ce +#define regSMU_INTERRUPT_CONTROL_BASE_IDX 2 +#define regDMU_MISC_ALLOW_DS_FORCE 0x00d6 +#define regDMU_MISC_ALLOW_DS_FORCE_BASE_IDX 2 +#define regDMU_DISPCLK_CGTT_BLK_CTRL_REG 0x00d8 +#define regDMU_DISPCLK_CGTT_BLK_CTRL_REG_BASE_IDX 2 +#define regDMU_SOCCLK_CGTT_BLK_CTRL_REG 0x00d9 +#define regDMU_SOCCLK_CGTT_BLK_CTRL_REG_BASE_IDX 2 +#define regDMU_MEM_PWR_REQ_CNTL 0x00db +#define regDMU_MEM_PWR_REQ_CNTL_BASE_IDX 2 + + +// addressBlock: dce_dc_dmu_dmcub_dispdec +// base address: 0x0 +#define regDMCUB_REGION0_OFFSET 0x018e +#define regDMCUB_REGION0_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION0_OFFSET_HIGH 0x018f +#define regDMCUB_REGION0_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION1_OFFSET 0x0190 +#define regDMCUB_REGION1_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION1_OFFSET_HIGH 0x0191 +#define regDMCUB_REGION1_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION2_OFFSET 0x0192 +#define regDMCUB_REGION2_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION2_OFFSET_HIGH 0x0193 +#define regDMCUB_REGION2_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION2_ITCM_OFFSET 0x0194 +#define regDMCUB_REGION2_ITCM_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION2_ITCM_OFFSET_HIGH 0x0195 +#define regDMCUB_REGION2_ITCM_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION4_OFFSET 0x0196 +#define regDMCUB_REGION4_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION4_OFFSET_HIGH 0x0197 +#define regDMCUB_REGION4_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION5_OFFSET 0x0198 +#define regDMCUB_REGION5_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION5_OFFSET_HIGH 0x0199 +#define regDMCUB_REGION5_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION6_OFFSET 0x019a +#define regDMCUB_REGION6_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION6_OFFSET_HIGH 0x019b +#define regDMCUB_REGION6_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION7_OFFSET 0x019c +#define regDMCUB_REGION7_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION7_OFFSET_HIGH 0x019d +#define regDMCUB_REGION7_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION0_TOP_ADDRESS 0x019e +#define regDMCUB_REGION0_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION1_TOP_ADDRESS 0x019f +#define regDMCUB_REGION1_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION2_TOP_ADDRESS 0x01a0 +#define regDMCUB_REGION2_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION4_TOP_ADDRESS 0x01a1 +#define regDMCUB_REGION4_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION5_TOP_ADDRESS 0x01a2 +#define regDMCUB_REGION5_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION6_TOP_ADDRESS 0x01a3 +#define regDMCUB_REGION6_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION7_TOP_ADDRESS 0x01a4 +#define regDMCUB_REGION7_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW0_BASE_ADDRESS 0x01a5 +#define regDMCUB_REGION3_CW0_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW1_BASE_ADDRESS 0x01a6 +#define regDMCUB_REGION3_CW1_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW2_BASE_ADDRESS 0x01a7 +#define regDMCUB_REGION3_CW2_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW3_BASE_ADDRESS 0x01a8 +#define regDMCUB_REGION3_CW3_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW4_BASE_ADDRESS 0x01a9 +#define regDMCUB_REGION3_CW4_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW5_BASE_ADDRESS 0x01aa +#define regDMCUB_REGION3_CW5_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW6_BASE_ADDRESS 0x01ab +#define regDMCUB_REGION3_CW6_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW7_BASE_ADDRESS 0x01ac +#define regDMCUB_REGION3_CW7_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW0_TOP_ADDRESS 0x01ad +#define regDMCUB_REGION3_CW0_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW1_TOP_ADDRESS 0x01ae +#define regDMCUB_REGION3_CW1_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW2_TOP_ADDRESS 0x01af +#define regDMCUB_REGION3_CW2_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW3_TOP_ADDRESS 0x01b0 +#define regDMCUB_REGION3_CW3_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW4_TOP_ADDRESS 0x01b1 +#define regDMCUB_REGION3_CW4_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW5_TOP_ADDRESS 0x01b2 +#define regDMCUB_REGION3_CW5_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW6_TOP_ADDRESS 0x01b3 +#define regDMCUB_REGION3_CW6_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW7_TOP_ADDRESS 0x01b4 +#define regDMCUB_REGION3_CW7_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_CW0_OFFSET 0x01b5 +#define regDMCUB_REGION3_CW0_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW0_OFFSET_HIGH 0x01b6 +#define regDMCUB_REGION3_CW0_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW1_OFFSET 0x01b7 +#define regDMCUB_REGION3_CW1_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW1_OFFSET_HIGH 0x01b8 +#define regDMCUB_REGION3_CW1_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW2_OFFSET 0x01b9 +#define regDMCUB_REGION3_CW2_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW2_OFFSET_HIGH 0x01ba +#define regDMCUB_REGION3_CW2_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW3_OFFSET 0x01bb +#define regDMCUB_REGION3_CW3_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW3_OFFSET_HIGH 0x01bc +#define regDMCUB_REGION3_CW3_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW4_OFFSET 0x01bd +#define regDMCUB_REGION3_CW4_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW4_OFFSET_HIGH 0x01be +#define regDMCUB_REGION3_CW4_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW5_OFFSET 0x01bf +#define regDMCUB_REGION3_CW5_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW5_OFFSET_HIGH 0x01c0 +#define regDMCUB_REGION3_CW5_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW6_OFFSET 0x01c1 +#define regDMCUB_REGION3_CW6_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW6_OFFSET_HIGH 0x01c2 +#define regDMCUB_REGION3_CW6_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_REGION3_CW7_OFFSET 0x01c3 +#define regDMCUB_REGION3_CW7_OFFSET_BASE_IDX 2 +#define regDMCUB_REGION3_CW7_OFFSET_HIGH 0x01c4 +#define regDMCUB_REGION3_CW7_OFFSET_HIGH_BASE_IDX 2 +#define regDMCUB_INTERRUPT_ENABLE 0x01c5 +#define regDMCUB_INTERRUPT_ENABLE_BASE_IDX 2 +#define regDMCUB_INTERRUPT_ACK 0x01c6 +#define regDMCUB_INTERRUPT_ACK_BASE_IDX 2 +#define regDMCUB_INTERRUPT_STATUS 0x01c7 +#define regDMCUB_INTERRUPT_STATUS_BASE_IDX 2 +#define regDMCUB_INTERRUPT_TYPE 0x01c8 +#define regDMCUB_INTERRUPT_TYPE_BASE_IDX 2 +#define regDMCUB_EXT_INTERRUPT_STATUS 0x01c9 +#define regDMCUB_EXT_INTERRUPT_STATUS_BASE_IDX 2 +#define regDMCUB_EXT_INTERRUPT_CTXID 0x01ca +#define regDMCUB_EXT_INTERRUPT_CTXID_BASE_IDX 2 +#define regDMCUB_EXT_INTERRUPT_ACK 0x01cb +#define regDMCUB_EXT_INTERRUPT_ACK_BASE_IDX 2 +#define regDMCUB_INST_FETCH_FAULT_ADDR 0x01cc +#define regDMCUB_INST_FETCH_FAULT_ADDR_BASE_IDX 2 +#define regDMCUB_DATA_WRITE_FAULT_ADDR 0x01cd +#define regDMCUB_DATA_WRITE_FAULT_ADDR_BASE_IDX 2 +#define regDMCUB_SEC_CNTL 0x01ce +#define regDMCUB_SEC_CNTL_BASE_IDX 2 +#define regDMCUB_MEM_CNTL 0x01cf +#define regDMCUB_MEM_CNTL_BASE_IDX 2 +#define regDMCUB_INBOX0_BASE_ADDRESS 0x01d0 +#define regDMCUB_INBOX0_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_INBOX0_SIZE 0x01d1 +#define regDMCUB_INBOX0_SIZE_BASE_IDX 2 +#define regDMCUB_INBOX0_WPTR 0x01d2 +#define regDMCUB_INBOX0_WPTR_BASE_IDX 2 +#define regDMCUB_INBOX0_RPTR 0x01d3 +#define regDMCUB_INBOX0_RPTR_BASE_IDX 2 +#define regDMCUB_INBOX1_BASE_ADDRESS 0x01d4 +#define regDMCUB_INBOX1_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_INBOX1_SIZE 0x01d5 +#define regDMCUB_INBOX1_SIZE_BASE_IDX 2 +#define regDMCUB_INBOX1_WPTR 0x01d6 +#define regDMCUB_INBOX1_WPTR_BASE_IDX 2 +#define regDMCUB_INBOX1_RPTR 0x01d7 +#define regDMCUB_INBOX1_RPTR_BASE_IDX 2 +#define regDMCUB_OUTBOX0_BASE_ADDRESS 0x01d8 +#define regDMCUB_OUTBOX0_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_OUTBOX0_SIZE 0x01d9 +#define regDMCUB_OUTBOX0_SIZE_BASE_IDX 2 +#define regDMCUB_OUTBOX0_WPTR 0x01da +#define regDMCUB_OUTBOX0_WPTR_BASE_IDX 2 +#define regDMCUB_OUTBOX0_RPTR 0x01db +#define regDMCUB_OUTBOX0_RPTR_BASE_IDX 2 +#define regDMCUB_OUTBOX1_BASE_ADDRESS 0x01dc +#define regDMCUB_OUTBOX1_BASE_ADDRESS_BASE_IDX 2 +#define regDMCUB_OUTBOX1_SIZE 0x01dd +#define regDMCUB_OUTBOX1_SIZE_BASE_IDX 2 +#define regDMCUB_OUTBOX1_WPTR 0x01de +#define regDMCUB_OUTBOX1_WPTR_BASE_IDX 2 +#define regDMCUB_OUTBOX1_RPTR 0x01df +#define regDMCUB_OUTBOX1_RPTR_BASE_IDX 2 +#define regDMCUB_TIMER_TRIGGER0 0x01e0 +#define regDMCUB_TIMER_TRIGGER0_BASE_IDX 2 +#define regDMCUB_TIMER_TRIGGER1 0x01e1 +#define regDMCUB_TIMER_TRIGGER1_BASE_IDX 2 +#define regDMCUB_TIMER_WINDOW 0x01e2 +#define regDMCUB_TIMER_WINDOW_BASE_IDX 2 +#define regDMCUB_SCRATCH0 0x01e3 +#define regDMCUB_SCRATCH0_BASE_IDX 2 +#define regDMCUB_SCRATCH1 0x01e4 +#define regDMCUB_SCRATCH1_BASE_IDX 2 +#define regDMCUB_SCRATCH2 0x01e5 +#define regDMCUB_SCRATCH2_BASE_IDX 2 +#define regDMCUB_SCRATCH3 0x01e6 +#define regDMCUB_SCRATCH3_BASE_IDX 2 +#define regDMCUB_SCRATCH4 0x01e7 +#define regDMCUB_SCRATCH4_BASE_IDX 2 +#define regDMCUB_SCRATCH5 0x01e8 +#define regDMCUB_SCRATCH5_BASE_IDX 2 +#define regDMCUB_SCRATCH6 0x01e9 +#define regDMCUB_SCRATCH6_BASE_IDX 2 +#define regDMCUB_SCRATCH7 0x01ea +#define regDMCUB_SCRATCH7_BASE_IDX 2 +#define regDMCUB_SCRATCH8 0x01eb +#define regDMCUB_SCRATCH8_BASE_IDX 2 +#define regDMCUB_SCRATCH9 0x01ec +#define regDMCUB_SCRATCH9_BASE_IDX 2 +#define regDMCUB_SCRATCH10 0x01ed +#define regDMCUB_SCRATCH10_BASE_IDX 2 +#define regDMCUB_SCRATCH11 0x01ee +#define regDMCUB_SCRATCH11_BASE_IDX 2 +#define regDMCUB_SCRATCH12 0x01ef +#define regDMCUB_SCRATCH12_BASE_IDX 2 +#define regDMCUB_SCRATCH13 0x01f0 +#define regDMCUB_SCRATCH13_BASE_IDX 2 +#define regDMCUB_SCRATCH14 0x01f1 +#define regDMCUB_SCRATCH14_BASE_IDX 2 +#define regDMCUB_SCRATCH15 0x01f2 +#define regDMCUB_SCRATCH15_BASE_IDX 2 +#define regDMCUB_SCRATCH16 0x01f3 +#define regDMCUB_SCRATCH16_BASE_IDX 2 +#define regDMCUB_SCRATCH17 0x01f4 +#define regDMCUB_SCRATCH17_BASE_IDX 2 +#define regDMCUB_SCRATCH18 0x01f5 +#define regDMCUB_SCRATCH18_BASE_IDX 2 +#define regDMCUB_CNTL 0x01f6 +#define regDMCUB_CNTL_BASE_IDX 2 +#define regDMCUB_GPINT_DATAIN0 0x01f7 +#define regDMCUB_GPINT_DATAIN0_BASE_IDX 2 +#define regDMCUB_GPINT_DATAIN1 0x01f8 +#define regDMCUB_GPINT_DATAIN1_BASE_IDX 2 +#define regDMCUB_GPINT_DATAOUT 0x01f9 +#define regDMCUB_GPINT_DATAOUT_BASE_IDX 2 +#define regDMCUB_UNDEFINED_ADDRESS_FAULT_ADDR 0x01fa +#define regDMCUB_UNDEFINED_ADDRESS_FAULT_ADDR_BASE_IDX 2 +#define regDMCUB_LS_WAKE_INT_ENABLE 0x01fb +#define regDMCUB_LS_WAKE_INT_ENABLE_BASE_IDX 2 +#define regDMCUB_MEM_PWR_CNTL 0x01fc +#define regDMCUB_MEM_PWR_CNTL_BASE_IDX 2 +#define regDMCUB_TIMER_CURRENT 0x01fd +#define regDMCUB_TIMER_CURRENT_BASE_IDX 2 +#define regDMCUB_DBG_BUS_SELECT 0x01fe +#define regDMCUB_DBG_BUS_SELECT_BASE_IDX 2 +#define regDMCUB_PROC_ID 0x01ff +#define regDMCUB_PROC_ID_BASE_IDX 2 +#define regDMCUB_CNTL2 0x0200 +#define regDMCUB_CNTL2_BASE_IDX 2 +#define regDMCUB_RSMU_WHITELIST_STATUS 0x0201 +#define regDMCUB_RSMU_WHITELIST_STATUS_BASE_IDX 2 +#define regDMCUB_RSMU_REG_STATUS 0x0202 +#define regDMCUB_RSMU_REG_STATUS_BASE_IDX 2 +#define regDMCUB_RSMU_REG_APER_ID 0x0203 +#define regDMCUB_RSMU_REG_APER_ID_BASE_IDX 2 +#define regDMCUB_RSMU_MASTER_A_REG_SEC_FLAG 0x0204 +#define regDMCUB_RSMU_MASTER_A_REG_SEC_FLAG_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST0_BASE 0x0205 +#define regRSMU_MASTER_A_WHITELIST0_BASE_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST0_TOP 0x0206 +#define regRSMU_MASTER_A_WHITELIST0_TOP_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST1_BASE 0x0207 +#define regRSMU_MASTER_A_WHITELIST1_BASE_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST1_TOP 0x0208 +#define regRSMU_MASTER_A_WHITELIST1_TOP_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST2_BASE 0x0209 +#define regRSMU_MASTER_A_WHITELIST2_BASE_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST2_TOP 0x020a +#define regRSMU_MASTER_A_WHITELIST2_TOP_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST3_BASE 0x020b +#define regRSMU_MASTER_A_WHITELIST3_BASE_BASE_IDX 2 +#define regRSMU_MASTER_A_WHITELIST3_TOP 0x020c +#define regRSMU_MASTER_A_WHITELIST3_TOP_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST0_BASE 0x020d +#define regRSMU_MASTER_B_WHITELIST0_BASE_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST0_TOP 0x020e +#define regRSMU_MASTER_B_WHITELIST0_TOP_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST1_BASE 0x020f +#define regRSMU_MASTER_B_WHITELIST1_BASE_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST1_TOP 0x0210 +#define regRSMU_MASTER_B_WHITELIST1_TOP_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST2_BASE 0x0211 +#define regRSMU_MASTER_B_WHITELIST2_BASE_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST2_TOP 0x0212 +#define regRSMU_MASTER_B_WHITELIST2_TOP_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST3_BASE 0x0213 +#define regRSMU_MASTER_B_WHITELIST3_BASE_BASE_IDX 2 +#define regRSMU_MASTER_B_WHITELIST3_TOP 0x0214 +#define regRSMU_MASTER_B_WHITELIST3_TOP_BASE_IDX 2 +#define regDMCUB_GPINT_DATAIN2 0x0215 +#define regDMCUB_GPINT_DATAIN2_BASE_IDX 2 +#define regDMCUB_GPINT_DATAIN3 0x0216 +#define regDMCUB_GPINT_DATAIN3_BASE_IDX 2 +#define regDMCUB_GPINT_DATAIN4 0x0217 +#define regDMCUB_GPINT_DATAIN4_BASE_IDX 2 +#define regDMCUB_REGION2_ITCM_SRC_TOP_ADDRESS 0x0218 +#define regDMCUB_REGION2_ITCM_SRC_TOP_ADDRESS_BASE_IDX 2 +#define regDMCUB_REGION3_TMR_AXI_SPACE 0x021a +#define regDMCUB_REGION3_TMR_AXI_SPACE_BASE_IDX 2 +#define regDMCUB_SCRATCH19 0x021b +#define regDMCUB_SCRATCH19_BASE_IDX 2 +#define regDMCUB_SCRATCH20 0x021c +#define regDMCUB_SCRATCH20_BASE_IDX 2 +#define regDMCUB_SCRATCH21 0x021d +#define regDMCUB_SCRATCH21_BASE_IDX 2 +#define regDMCUB_SCRATCH22 0x021e +#define regDMCUB_SCRATCH22_BASE_IDX 2 +#define regDMCUB_SCRATCH23 0x021f +#define regDMCUB_SCRATCH23_BASE_IDX 2 +#define regDMCUB_TEST_DEBUG_INDEX 0x0220 +#define regDMCUB_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDMCUB_TEST_DEBUG_DATA 0x0221 +#define regDMCUB_TEST_DEBUG_DATA_BASE_IDX 2 +#define regHOST_INTERRUPT_CSR 0x0222 +#define regHOST_INTERRUPT_CSR_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_RDY 0x0223 +#define regDMCUB_REG_INBOX0_RDY_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG0 0x0224 +#define regDMCUB_REG_INBOX0_MSG0_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG1 0x0225 +#define regDMCUB_REG_INBOX0_MSG1_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG2 0x0226 +#define regDMCUB_REG_INBOX0_MSG2_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG3 0x0227 +#define regDMCUB_REG_INBOX0_MSG3_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG4 0x0228 +#define regDMCUB_REG_INBOX0_MSG4_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG5 0x0229 +#define regDMCUB_REG_INBOX0_MSG5_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG6 0x022a +#define regDMCUB_REG_INBOX0_MSG6_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG7 0x022b +#define regDMCUB_REG_INBOX0_MSG7_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG8 0x022c +#define regDMCUB_REG_INBOX0_MSG8_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG9 0x022d +#define regDMCUB_REG_INBOX0_MSG9_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG10 0x022e +#define regDMCUB_REG_INBOX0_MSG10_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG11 0x022f +#define regDMCUB_REG_INBOX0_MSG11_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG12 0x0230 +#define regDMCUB_REG_INBOX0_MSG12_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG13 0x0231 +#define regDMCUB_REG_INBOX0_MSG13_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_MSG14 0x0232 +#define regDMCUB_REG_INBOX0_MSG14_BASE_IDX 2 +#define regDMCUB_REG_INBOX0_RSP 0x0233 +#define regDMCUB_REG_INBOX0_RSP_BASE_IDX 2 +#define regDMCUB_REG_OUTBOX0_RDY 0x0234 +#define regDMCUB_REG_OUTBOX0_RDY_BASE_IDX 2 +#define regDMCUB_REG_OUTBOX0_MSG0 0x0235 +#define regDMCUB_REG_OUTBOX0_MSG0_BASE_IDX 2 +#define regDMCUB_REG_OUTBOX0_RSP 0x0236 +#define regDMCUB_REG_OUTBOX0_RSP_BASE_IDX 2 +#define regDMCUB_REG_INBOX1_RDY 0x0237 +#define regDMCUB_REG_INBOX1_RDY_BASE_IDX 2 +#define regDMCUB_REG_INBOX1_MSG0 0x0238 +#define regDMCUB_REG_INBOX1_MSG0_BASE_IDX 2 +#define regDMCUB_REG_INBOX1_MSG1 0x0239 +#define regDMCUB_REG_INBOX1_MSG1_BASE_IDX 2 +#define regDMCUB_REG_INBOX1_RSP 0x023a +#define regDMCUB_REG_INBOX1_RSP_BASE_IDX 2 +#define regDMCUB_REG_INBOX1_INTERRUPT_CSR 0x023b +#define regDMCUB_REG_INBOX1_INTERRUPT_CSR_BASE_IDX 2 +#define regDMCUB_REG_INBOX2_RDY 0x023c +#define regDMCUB_REG_INBOX2_RDY_BASE_IDX 2 +#define regDMCUB_REG_INBOX2_MSG0 0x023d +#define regDMCUB_REG_INBOX2_MSG0_BASE_IDX 2 +#define regDMCUB_REG_INBOX2_MSG1 0x023e +#define regDMCUB_REG_INBOX2_MSG1_BASE_IDX 2 +#define regDMCUB_REG_INBOX2_RSP 0x023f +#define regDMCUB_REG_INBOX2_RSP_BASE_IDX 2 +#define regDMCUB_REG_INBOX3_RDY 0x0240 +#define regDMCUB_REG_INBOX3_RDY_BASE_IDX 2 +#define regDMCUB_REG_INBOX3_MSG0 0x0241 +#define regDMCUB_REG_INBOX3_MSG0_BASE_IDX 2 +#define regDMCUB_REG_INBOX3_MSG1 0x0242 +#define regDMCUB_REG_INBOX3_MSG1_BASE_IDX 2 +#define regDMCUB_REG_INBOX3_RSP 0x0243 +#define regDMCUB_REG_INBOX3_RSP_BASE_IDX 2 +#define regDMCUB_REG_INBOX4_RDY 0x0244 +#define regDMCUB_REG_INBOX4_RDY_BASE_IDX 2 +#define regDMCUB_REG_INBOX4_MSG0 0x0245 +#define regDMCUB_REG_INBOX4_MSG0_BASE_IDX 2 +#define regDMCUB_REG_INBOX4_MSG1 0x0246 +#define regDMCUB_REG_INBOX4_MSG1_BASE_IDX 2 +#define regDMCUB_REG_INBOX4_RSP 0x0247 +#define regDMCUB_REG_INBOX4_RSP_BASE_IDX 2 +#define regDMCUB_RSMU_MASTER_B_REG_SEC_FLAG 0x0248 +#define regDMCUB_RSMU_MASTER_B_REG_SEC_FLAG_BASE_IDX 2 +#define regDMCUB_IDLE_HYSTERESIS_CSR 0x0249 +#define regDMCUB_IDLE_HYSTERESIS_CSR_BASE_IDX 2 + + +// addressBlock: dce_dc_mmhubbub_mmhubbub_dcperfmon_dc_perfmon_dispdec +// base address: 0xd48 +#define regDC_PERFMON3_PERFCOUNTER_CNTL 0x0352 +#define regDC_PERFMON3_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON3_PERFCOUNTER_CNTL2 0x0353 +#define regDC_PERFMON3_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON3_PERFCOUNTER_STATE 0x0354 +#define regDC_PERFMON3_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_CNTL 0x0355 +#define regDC_PERFMON3_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_CNTL2 0x0356 +#define regDC_PERFMON3_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_CVALUE_INT_MISC 0x0357 +#define regDC_PERFMON3_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_CVALUE_LOW 0x0358 +#define regDC_PERFMON3_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_HI 0x0359 +#define regDC_PERFMON3_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_LOW 0x035a +#define regDC_PERFMON3_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_TEST_DEBUG_INDEX 0x035b +#define regDC_PERFMON3_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON3_PERFMON_TEST_DEBUG_DATA 0x035c +#define regDC_PERFMON3_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_mmhubbub_mmhubbub_dispdec +// base address: 0x0 +#define regMCIF_WB_NB_PSTATE_LATENCY_WATERMARK 0x0262 +#define regMCIF_WB_NB_PSTATE_LATENCY_WATERMARK_BASE_IDX 2 +#define regMCIF_WB_WATERMARK 0x0263 +#define regMCIF_WB_WATERMARK_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_CONFIG 0x0264 +#define regMMHUBBUB_WARMUP_CONFIG_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_CONTROL_STATUS 0x0265 +#define regMMHUBBUB_WARMUP_CONTROL_STATUS_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_BASE_ADDR_LOW 0x0266 +#define regMMHUBBUB_WARMUP_BASE_ADDR_LOW_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_BASE_ADDR_HIGH 0x0267 +#define regMMHUBBUB_WARMUP_BASE_ADDR_HIGH_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_ADDR_REGION 0x0268 +#define regMMHUBBUB_WARMUP_ADDR_REGION_BASE_IDX 2 +#define regMMHUBBUB_MIN_TTO 0x0269 +#define regMMHUBBUB_MIN_TTO_BASE_IDX 2 +#define regMMHUBBUB_CTRL 0x0333 +#define regMMHUBBUB_CTRL_BASE_IDX 2 +#define regWBIF_SMU_WM_CONTROL 0x0334 +#define regWBIF_SMU_WM_CONTROL_BASE_IDX 2 +#define regMMHUBBUB_MEM_PWR_STATUS 0x033e +#define regMMHUBBUB_MEM_PWR_STATUS_BASE_IDX 2 +#define regMMHUBBUB_MEM_PWR_CNTL 0x033f +#define regMMHUBBUB_MEM_PWR_CNTL_BASE_IDX 2 +#define regMMHUBBUB_CLOCK_CNTL 0x0340 +#define regMMHUBBUB_CLOCK_CNTL_BASE_IDX 2 +#define regMMHUBBUB_SOFT_RESET 0x0341 +#define regMMHUBBUB_SOFT_RESET_BASE_IDX 2 +#define regDMU_IF_ERR_STATUS 0x0345 +#define regDMU_IF_ERR_STATUS_BASE_IDX 2 +#define regMMHUBBUB_CLIENT_UNIT_ID 0x0346 +#define regMMHUBBUB_CLIENT_UNIT_ID_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_SECURITY_CFG 0x0347 +#define regMMHUBBUB_WARMUP_SECURITY_CFG_BASE_IDX 2 +#define regMMHUBBUB_WARMUP_VMID_CONTROL 0x0348 +#define regMMHUBBUB_WARMUP_VMID_CONTROL_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0controller_dispdec +// base address: 0x0 +#define regAZALIA_CONTROLLER_CLOCK_GATING 0x03c2 +#define regAZALIA_CONTROLLER_CLOCK_GATING_BASE_IDX 2 +#define regAZALIA_AUDIO_DTO 0x03c3 +#define regAZALIA_AUDIO_DTO_BASE_IDX 2 +#define regAZALIA_AUDIO_DTO_CONTROL 0x03c4 +#define regAZALIA_AUDIO_DTO_CONTROL_BASE_IDX 2 +#define regAZALIA_SOCCLK_CONTROL 0x03c5 +#define regAZALIA_SOCCLK_CONTROL_BASE_IDX 2 +#define regAZALIA_UNDERFLOW_FILLER_SAMPLE 0x03c6 +#define regAZALIA_UNDERFLOW_FILLER_SAMPLE_BASE_IDX 2 +#define regAZALIA_DATA_DMA_CONTROL 0x03c7 +#define regAZALIA_DATA_DMA_CONTROL_BASE_IDX 2 +#define regAZALIA_BDL_DMA_CONTROL 0x03c8 +#define regAZALIA_BDL_DMA_CONTROL_BASE_IDX 2 +#define regAZALIA_RIRB_AND_DP_CONTROL 0x03c9 +#define regAZALIA_RIRB_AND_DP_CONTROL_BASE_IDX 2 +#define regAZALIA_CORB_DMA_CONTROL 0x03ca +#define regAZALIA_CORB_DMA_CONTROL_BASE_IDX 2 +#define regAZALIA_GLOBAL_CAPABILITIES 0x03d3 +#define regAZALIA_GLOBAL_CAPABILITIES_BASE_IDX 2 +#define regAZALIA_OUTPUT_PAYLOAD_CAPABILITY 0x03d4 +#define regAZALIA_OUTPUT_PAYLOAD_CAPABILITY_BASE_IDX 2 +#define regAZALIA_OUTPUT_STREAM_ARBITER_CONTROL 0x03d5 +#define regAZALIA_OUTPUT_STREAM_ARBITER_CONTROL_BASE_IDX 2 +#define regAZALIA_INPUT_PAYLOAD_CAPABILITY 0x03d6 +#define regAZALIA_INPUT_PAYLOAD_CAPABILITY_BASE_IDX 2 +#define regAZALIA_CONTROLLER_DEBUG 0x03d7 +#define regAZALIA_CONTROLLER_DEBUG_BASE_IDX 2 +#define regAZALIA_MEM_PWR_CTRL 0x03ee +#define regAZALIA_MEM_PWR_CTRL_BASE_IDX 2 +#define regAZALIA_MEM_PWR_STATUS 0x03ef +#define regAZALIA_MEM_PWR_STATUS_BASE_IDX 2 +#define regDCI_PG_DEBUG_CONFIG 0x03f0 +#define regDCI_PG_DEBUG_CONFIG_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0root_dispdec +// base address: 0x0 +#define regAZALIA_F0_CODEC_ROOT_PARAMETER_VENDOR_AND_DEVICE_ID 0x0406 +#define regAZALIA_F0_CODEC_ROOT_PARAMETER_VENDOR_AND_DEVICE_ID_BASE_IDX 2 +#define regAZALIA_F0_CODEC_ROOT_PARAMETER_REVISION_ID 0x0407 +#define regAZALIA_F0_CODEC_ROOT_PARAMETER_REVISION_ID_BASE_IDX 2 +#define regAZALIA_F0_CODEC_CHANNEL_COUNT_CONTROL 0x0408 +#define regAZALIA_F0_CODEC_CHANNEL_COUNT_CONTROL_BASE_IDX 2 +#define regAZALIA_F0_CODEC_RESYNC_FIFO_CONTROL 0x0409 +#define regAZALIA_F0_CODEC_RESYNC_FIFO_CONTROL_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_GROUP_TYPE 0x040a +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_GROUP_TYPE_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_SUPPORTED_SIZE_RATES 0x040b +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_SUPPORTED_SIZE_RATES_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_STREAM_FORMATS 0x040c +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_STREAM_FORMATS_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_POWER_STATES 0x040d +#define regAZALIA_F0_CODEC_FUNCTION_PARAMETER_POWER_STATES_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_POWER_STATE 0x040e +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_POWER_STATE_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_RESET 0x040f +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_RESET_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_RESPONSE_SUBSYSTEM_ID 0x0410 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_RESPONSE_SUBSYSTEM_ID_BASE_IDX 2 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_CONVERTER_SYNCHRONIZATION 0x0411 +#define regAZALIA_F0_CODEC_FUNCTION_CONTROL_CONVERTER_SYNCHRONIZATION_BASE_IDX 2 +#define regCC_RCU_DC_AUDIO_PORT_CONNECTIVITY 0x0412 +#define regCC_RCU_DC_AUDIO_PORT_CONNECTIVITY_BASE_IDX 2 +#define regCC_RCU_DC_AUDIO_INPUT_PORT_CONNECTIVITY 0x0413 +#define regCC_RCU_DC_AUDIO_INPUT_PORT_CONNECTIVITY_BASE_IDX 2 +#define regAZALIA_F0_CODEC_DEBUG 0x0414 +#define regAZALIA_F0_CODEC_DEBUG_BASE_IDX 2 +#define regREG_DC_AUDIO_PORT_CONNECTIVITY 0x041c +#define regREG_DC_AUDIO_PORT_CONNECTIVITY_BASE_IDX 2 +#define regREG_DC_AUDIO_INPUT_PORT_CONNECTIVITY 0x041d +#define regREG_DC_AUDIO_INPUT_PORT_CONNECTIVITY_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_az_misc_dispdec +// base address: 0x0 +#define regAZ_CLOCK_CNTL 0x0372 +#define regAZ_CLOCK_CNTL_BASE_IDX 2 +#define regAZ_MEM_GLOBAL_PWR_REQ_CNTL 0x0373 +#define regAZ_MEM_GLOBAL_PWR_REQ_CNTL_BASE_IDX 2 +#define regAZ_STRAPS 0x0374 +#define regAZ_STRAPS_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_az_dcperfmon_dc_perfmon_dispdec +// base address: 0xde8 +#define regDC_PERFMON4_PERFCOUNTER_CNTL 0x037a +#define regDC_PERFMON4_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON4_PERFCOUNTER_CNTL2 0x037b +#define regDC_PERFMON4_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON4_PERFCOUNTER_STATE 0x037c +#define regDC_PERFMON4_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_CNTL 0x037d +#define regDC_PERFMON4_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_CNTL2 0x037e +#define regDC_PERFMON4_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_CVALUE_INT_MISC 0x037f +#define regDC_PERFMON4_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_CVALUE_LOW 0x0380 +#define regDC_PERFMON4_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_HI 0x0381 +#define regDC_PERFMON4_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_LOW 0x0382 +#define regDC_PERFMON4_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_TEST_DEBUG_INDEX 0x0383 +#define regDC_PERFMON4_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON4_PERFMON_TEST_DEBUG_DATA 0x0384 +#define regDC_PERFMON4_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream0_dispdec +// base address: 0x0 +#define regAZF0STREAM0_AZALIA_STREAM_INDEX 0x035e +#define regAZF0STREAM0_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM0_AZALIA_STREAM_DATA 0x035f +#define regAZF0STREAM0_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream1_dispdec +// base address: 0x8 +#define regAZF0STREAM1_AZALIA_STREAM_INDEX 0x0360 +#define regAZF0STREAM1_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM1_AZALIA_STREAM_DATA 0x0361 +#define regAZF0STREAM1_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream2_dispdec +// base address: 0x10 +#define regAZF0STREAM2_AZALIA_STREAM_INDEX 0x0362 +#define regAZF0STREAM2_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM2_AZALIA_STREAM_DATA 0x0363 +#define regAZF0STREAM2_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream3_dispdec +// base address: 0x18 +#define regAZF0STREAM3_AZALIA_STREAM_INDEX 0x0364 +#define regAZF0STREAM3_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM3_AZALIA_STREAM_DATA 0x0365 +#define regAZF0STREAM3_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream4_dispdec +// base address: 0x20 +#define regAZF0STREAM4_AZALIA_STREAM_INDEX 0x0366 +#define regAZF0STREAM4_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM4_AZALIA_STREAM_DATA 0x0367 +#define regAZF0STREAM4_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream5_dispdec +// base address: 0x28 +#define regAZF0STREAM5_AZALIA_STREAM_INDEX 0x0368 +#define regAZF0STREAM5_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM5_AZALIA_STREAM_DATA 0x0369 +#define regAZF0STREAM5_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream6_dispdec +// base address: 0x30 +#define regAZF0STREAM6_AZALIA_STREAM_INDEX 0x036a +#define regAZF0STREAM6_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM6_AZALIA_STREAM_DATA 0x036b +#define regAZF0STREAM6_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream7_dispdec +// base address: 0x38 +#define regAZF0STREAM7_AZALIA_STREAM_INDEX 0x036c +#define regAZF0STREAM7_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM7_AZALIA_STREAM_DATA 0x036d +#define regAZF0STREAM7_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream8_dispdec +// base address: 0x320 +#define regAZF0STREAM8_AZALIA_STREAM_INDEX 0x0426 +#define regAZF0STREAM8_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM8_AZALIA_STREAM_DATA 0x0427 +#define regAZF0STREAM8_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream9_dispdec +// base address: 0x328 +#define regAZF0STREAM9_AZALIA_STREAM_INDEX 0x0428 +#define regAZF0STREAM9_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM9_AZALIA_STREAM_DATA 0x0429 +#define regAZF0STREAM9_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream10_dispdec +// base address: 0x330 +#define regAZF0STREAM10_AZALIA_STREAM_INDEX 0x042a +#define regAZF0STREAM10_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM10_AZALIA_STREAM_DATA 0x042b +#define regAZF0STREAM10_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream11_dispdec +// base address: 0x338 +#define regAZF0STREAM11_AZALIA_STREAM_INDEX 0x042c +#define regAZF0STREAM11_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM11_AZALIA_STREAM_DATA 0x042d +#define regAZF0STREAM11_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream12_dispdec +// base address: 0x340 +#define regAZF0STREAM12_AZALIA_STREAM_INDEX 0x042e +#define regAZF0STREAM12_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM12_AZALIA_STREAM_DATA 0x042f +#define regAZF0STREAM12_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream13_dispdec +// base address: 0x348 +#define regAZF0STREAM13_AZALIA_STREAM_INDEX 0x0430 +#define regAZF0STREAM13_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM13_AZALIA_STREAM_DATA 0x0431 +#define regAZF0STREAM13_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream14_dispdec +// base address: 0x350 +#define regAZF0STREAM14_AZALIA_STREAM_INDEX 0x0432 +#define regAZF0STREAM14_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM14_AZALIA_STREAM_DATA 0x0433 +#define regAZF0STREAM14_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0stream15_dispdec +// base address: 0x358 +#define regAZF0STREAM15_AZALIA_STREAM_INDEX 0x0434 +#define regAZF0STREAM15_AZALIA_STREAM_INDEX_BASE_IDX 2 +#define regAZF0STREAM15_AZALIA_STREAM_DATA 0x0435 +#define regAZF0STREAM15_AZALIA_STREAM_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint0_dispdec +// base address: 0x0 +#define regAZF0ENDPOINT0_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x0386 +#define regAZF0ENDPOINT0_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT0_AZALIA_F0_CODEC_ENDPOINT_DATA 0x0387 +#define regAZF0ENDPOINT0_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint1_dispdec +// base address: 0x18 +#define regAZF0ENDPOINT1_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x038c +#define regAZF0ENDPOINT1_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT1_AZALIA_F0_CODEC_ENDPOINT_DATA 0x038d +#define regAZF0ENDPOINT1_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint2_dispdec +// base address: 0x30 +#define regAZF0ENDPOINT2_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x0392 +#define regAZF0ENDPOINT2_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT2_AZALIA_F0_CODEC_ENDPOINT_DATA 0x0393 +#define regAZF0ENDPOINT2_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint3_dispdec +// base address: 0x48 +#define regAZF0ENDPOINT3_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x0398 +#define regAZF0ENDPOINT3_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT3_AZALIA_F0_CODEC_ENDPOINT_DATA 0x0399 +#define regAZF0ENDPOINT3_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint4_dispdec +// base address: 0x60 +#define regAZF0ENDPOINT4_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x039e +#define regAZF0ENDPOINT4_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT4_AZALIA_F0_CODEC_ENDPOINT_DATA 0x039f +#define regAZF0ENDPOINT4_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint5_dispdec +// base address: 0x78 +#define regAZF0ENDPOINT5_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x03a4 +#define regAZF0ENDPOINT5_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT5_AZALIA_F0_CODEC_ENDPOINT_DATA 0x03a5 +#define regAZF0ENDPOINT5_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint6_dispdec +// base address: 0x90 +#define regAZF0ENDPOINT6_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x03aa +#define regAZF0ENDPOINT6_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT6_AZALIA_F0_CODEC_ENDPOINT_DATA 0x03ab +#define regAZF0ENDPOINT6_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_hda_azf0endpoint7_dispdec +// base address: 0xa8 +#define regAZF0ENDPOINT7_AZALIA_F0_CODEC_ENDPOINT_INDEX 0x03b0 +#define regAZF0ENDPOINT7_AZALIA_F0_CODEC_ENDPOINT_INDEX_BASE_IDX 2 +#define regAZF0ENDPOINT7_AZALIA_F0_CODEC_ENDPOINT_DATA 0x03b1 +#define regAZF0ENDPOINT7_AZALIA_F0_CODEC_ENDPOINT_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dchubbubl_hubbub_dispdec +// base address: 0x0 +#define regDCHUBBUB_ARB_DF_REQ_OUTSTAND 0x04f9 +#define regDCHUBBUB_ARB_DF_REQ_OUTSTAND_BASE_IDX 2 +#define regDCHUBBUB_ARB_SAT_LEVEL 0x04fa +#define regDCHUBBUB_ARB_SAT_LEVEL_BASE_IDX 2 +#define regDCHUBBUB_ARB_QOS_FORCE 0x04fb +#define regDCHUBBUB_ARB_QOS_FORCE_BASE_IDX 2 +#define regDCHUBBUB_ARB_DRAM_STATE_CNTL 0x04fc +#define regDCHUBBUB_ARB_DRAM_STATE_CNTL_BASE_IDX 2 +#define regDCHUBBUB_ARB_DRAM_HVM_STATE_CNTL 0x04fd +#define regDCHUBBUB_ARB_DRAM_HVM_STATE_CNTL_BASE_IDX 2 +#define regDCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A 0x04fe +#define regDCHUBBUB_ARB_DATA_URGENCY_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A 0x04ff +#define regDCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_REFCYC_PER_META_TRIP_A 0x0500 +#define regDCHUBBUB_ARB_REFCYC_PER_META_TRIP_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A 0x0501 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A 0x0502 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK1_A 0x0503 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK1_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK1_A 0x0504 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK1_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK2_A 0x0505 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK2_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK2_A 0x0506 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK2_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK3_A 0x0507 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK3_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK3_A 0x0508 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK3_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK_A 0x0509 +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK1_A 0x050a +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK1_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK_A 0x050b +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK1_A 0x050c +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK1_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_A 0x050d +#define regDCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_FRAC_URG_BW_NOM_A 0x050e +#define regDCHUBBUB_ARB_FRAC_URG_BW_NOM_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_FRAC_URG_BW_FLIP_A 0x050f +#define regDCHUBBUB_ARB_FRAC_URG_BW_FLIP_A_BASE_IDX 2 +#define regDCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B 0x0510 +#define regDCHUBBUB_ARB_DATA_URGENCY_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B 0x0511 +#define regDCHUBBUB_ARB_REFCYC_PER_TRIP_TO_MEMORY_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_REFCYC_PER_META_TRIP_B 0x0512 +#define regDCHUBBUB_ARB_REFCYC_PER_META_TRIP_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B 0x0513 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B 0x0514 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK1_B 0x0515 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK1_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK1_B 0x0516 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK1_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK2_B 0x0517 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK2_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK2_B 0x0518 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK2_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK3_B 0x0519 +#define regDCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK3_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK3_B 0x051a +#define regDCHUBBUB_ARB_ALLOW_SR_EXIT_WATERMARK3_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK_B 0x051b +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK1_B 0x051c +#define regDCHUBBUB_ARB_UCLK_PSTATE_CHANGE_WATERMARK1_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK_B 0x051d +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK1_B 0x051e +#define regDCHUBBUB_ARB_FCLK_PSTATE_CHANGE_WATERMARK1_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_B 0x051f +#define regDCHUBBUB_ARB_BUFFER_FULLNESS_WATERMARK_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_FRAC_URG_BW_NOM_B 0x0520 +#define regDCHUBBUB_ARB_FRAC_URG_BW_NOM_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_FRAC_URG_BW_FLIP_B 0x0521 +#define regDCHUBBUB_ARB_FRAC_URG_BW_FLIP_B_BASE_IDX 2 +#define regDCHUBBUB_ARB_HOSTVM_CNTL 0x0522 +#define regDCHUBBUB_ARB_HOSTVM_CNTL_BASE_IDX 2 +#define regDCHUBBUB_ARB_WATERMARK_CHANGE_CNTL 0x0523 +#define regDCHUBBUB_ARB_WATERMARK_CHANGE_CNTL_BASE_IDX 2 +#define regDCHUBBUB_ARB_ALT_CH_CNTL 0x0524 +#define regDCHUBBUB_ARB_ALT_CH_CNTL_BASE_IDX 2 +#define regDCHUBBUB_ARB_TIMEOUT_ENABLE 0x0525 +#define regDCHUBBUB_ARB_TIMEOUT_ENABLE_BASE_IDX 2 +#define regDCHUBBUB_GLOBAL_TIMER_CNTL 0x0526 +#define regDCHUBBUB_GLOBAL_TIMER_CNTL_BASE_IDX 2 +#define regSURFACE_CHECK0_ADDRESS_LSB 0x0527 +#define regSURFACE_CHECK0_ADDRESS_LSB_BASE_IDX 2 +#define regSURFACE_CHECK0_ADDRESS_MSB 0x0528 +#define regSURFACE_CHECK0_ADDRESS_MSB_BASE_IDX 2 +#define regSURFACE_CHECK1_ADDRESS_LSB 0x0529 +#define regSURFACE_CHECK1_ADDRESS_LSB_BASE_IDX 2 +#define regSURFACE_CHECK1_ADDRESS_MSB 0x052a +#define regSURFACE_CHECK1_ADDRESS_MSB_BASE_IDX 2 +#define regSURFACE_CHECK2_ADDRESS_LSB 0x052b +#define regSURFACE_CHECK2_ADDRESS_LSB_BASE_IDX 2 +#define regSURFACE_CHECK2_ADDRESS_MSB 0x052c +#define regSURFACE_CHECK2_ADDRESS_MSB_BASE_IDX 2 +#define regSURFACE_CHECK3_ADDRESS_LSB 0x052d +#define regSURFACE_CHECK3_ADDRESS_LSB_BASE_IDX 2 +#define regSURFACE_CHECK3_ADDRESS_MSB 0x052e +#define regSURFACE_CHECK3_ADDRESS_MSB_BASE_IDX 2 +#define regVTG0_CONTROL 0x052f +#define regVTG0_CONTROL_BASE_IDX 2 +#define regVTG1_CONTROL 0x0530 +#define regVTG1_CONTROL_BASE_IDX 2 +#define regVTG2_CONTROL 0x0531 +#define regVTG2_CONTROL_BASE_IDX 2 +#define regVTG3_CONTROL 0x0532 +#define regVTG3_CONTROL_BASE_IDX 2 +#define regDCHUBBUB_SOFT_RESET 0x0533 +#define regDCHUBBUB_SOFT_RESET_BASE_IDX 2 +#define regDCHUBBUB_CLOCK_CNTL 0x0534 +#define regDCHUBBUB_CLOCK_CNTL_BASE_IDX 2 +#define regDCFCLK_CNTL 0x0535 +#define regDCFCLK_CNTL_BASE_IDX 2 +#define regDCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL 0x0536 +#define regDCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL_BASE_IDX 2 +#define regDCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL2 0x0537 +#define regDCHUBBUB_PERFORMANCE_MEASUREMENT_CNTL2_BASE_IDX 2 +#define regDCHUBBUB_VLINE_SNAPSHOT 0x0538 +#define regDCHUBBUB_VLINE_SNAPSHOT_BASE_IDX 2 +#define regDCHUBBUB_CTRL_STATUS 0x0539 +#define regDCHUBBUB_CTRL_STATUS_BASE_IDX 2 +#define regDCHUBBUB_TIMEOUT_DETECTION_CTRL1 0x053f +#define regDCHUBBUB_TIMEOUT_DETECTION_CTRL1_BASE_IDX 2 +#define regDCHUBBUB_TIMEOUT_DETECTION_CTRL2 0x0540 +#define regDCHUBBUB_TIMEOUT_DETECTION_CTRL2_BASE_IDX 2 +#define regDCHUBBUB_TIMEOUT_INTERRUPT_STATUS 0x0541 +#define regDCHUBBUB_TIMEOUT_INTERRUPT_STATUS_BASE_IDX 2 +#define regFMON_CTRL 0x0542 +#define regFMON_CTRL_BASE_IDX 2 +#define regDCHUBBUB_TEST_DEBUG_INDEX 0x0543 +#define regDCHUBBUB_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDCHUBBUB_TEST_DEBUG_DATA 0x0544 +#define regDCHUBBUB_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dchubbubl_hubbub_sdpif_dispdec +// base address: 0x0 +#define regDCHUBBUB_SDPIF_CFG0 0x046f +#define regDCHUBBUB_SDPIF_CFG0_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_CFG1 0x0470 +#define regDCHUBBUB_SDPIF_CFG1_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_CFG2 0x0471 +#define regDCHUBBUB_SDPIF_CFG2_BASE_IDX 2 +#define regVM_REQUEST_PHYSICAL 0x0472 +#define regVM_REQUEST_PHYSICAL_BASE_IDX 2 +#define regDCHUBBUB_FORCE_IO_STATUS_0 0x0473 +#define regDCHUBBUB_FORCE_IO_STATUS_0_BASE_IDX 2 +#define regDCHUBBUB_FORCE_IO_STATUS_1 0x0474 +#define regDCHUBBUB_FORCE_IO_STATUS_1_BASE_IDX 2 +#define regDCN_VM_FB_LOCATION_BASE 0x0475 +#define regDCN_VM_FB_LOCATION_BASE_BASE_IDX 2 +#define regDCN_VM_FB_LOCATION_TOP 0x0476 +#define regDCN_VM_FB_LOCATION_TOP_BASE_IDX 2 +#define regDCN_VM_FB_OFFSET 0x0477 +#define regDCN_VM_FB_OFFSET_BASE_IDX 2 +#define regDCN_VM_AGP_BOT 0x0478 +#define regDCN_VM_AGP_BOT_BASE_IDX 2 +#define regDCN_VM_AGP_TOP 0x0479 +#define regDCN_VM_AGP_TOP_BASE_IDX 2 +#define regDCN_VM_AGP_BASE 0x047a +#define regDCN_VM_AGP_BASE_BASE_IDX 2 +#define regDCN_VM_LOCAL_HBM_ADDRESS_START 0x047b +#define regDCN_VM_LOCAL_HBM_ADDRESS_START_BASE_IDX 2 +#define regDCN_VM_LOCAL_HBM_ADDRESS_END 0x047c +#define regDCN_VM_LOCAL_HBM_ADDRESS_END_BASE_IDX 2 +#define regDCN_VM_LOCAL_HBM_ADDRESS_LOCK_CNTL 0x047d +#define regDCN_VM_LOCAL_HBM_ADDRESS_LOCK_CNTL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_SEC_LVL 0x047e +#define regDCHUBBUB_SDPIF_PIPE_SEC_LVL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_NOALLOC 0x047f +#define regDCHUBBUB_SDPIF_PIPE_NOALLOC_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_DMDATA_SEC_LVL 0x0480 +#define regDCHUBBUB_SDPIF_PIPE_DMDATA_SEC_LVL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_CURSOR0_SEC_LVL 0x0481 +#define regDCHUBBUB_SDPIF_PIPE_CURSOR0_SEC_LVL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_3DLUT_SEC_LVL 0x0482 +#define regDCHUBBUB_SDPIF_PIPE_3DLUT_SEC_LVL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_GPUVM_SEC_LVL 0x0483 +#define regDCHUBBUB_SDPIF_PIPE_GPUVM_SEC_LVL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_PIPE_DATAFETCH 0x0484 +#define regDCHUBBUB_SDPIF_PIPE_DATAFETCH_BASE_IDX 2 +#define regSDPIF_REQUEST_RATE_LIMIT 0x0485 +#define regSDPIF_REQUEST_RATE_LIMIT_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_MEM_PWR_CTRL 0x0486 +#define regDCHUBBUB_SDPIF_MEM_PWR_CTRL_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_MEM_PWR_STATUS 0x0487 +#define regDCHUBBUB_SDPIF_MEM_PWR_STATUS_BASE_IDX 2 +#define regDCHUBBUB_SDPIF_MCACHE_INVALIDATION_CTL 0x0488 +#define regDCHUBBUB_SDPIF_MCACHE_INVALIDATION_CTL_BASE_IDX 2 +#define regUTM_CAPABILITIES_0 0x0489 +#define regUTM_CAPABILITIES_0_BASE_IDX 2 +#define regUTM_CONFIGURATION_0 0x048a +#define regUTM_CONFIGURATION_0_BASE_IDX 2 +#define regUTM_CLIENT_TO_SYSTEM_PROFILE_MAPPING_0 0x048b +#define regUTM_CLIENT_TO_SYSTEM_PROFILE_MAPPING_0_BASE_IDX 2 + + +// addressBlock: dce_dc_dchubbubl_hubbub_ret_path_dispdec +// base address: 0x0 +#define regDCHUBBUB_RET_PATH_MEM_PWR_CTRL 0x04af +#define regDCHUBBUB_RET_PATH_MEM_PWR_CTRL_BASE_IDX 2 +#define regDCHUBBUB_RET_PATH_MEM_PWR_STATUS 0x04b0 +#define regDCHUBBUB_RET_PATH_MEM_PWR_STATUS_BASE_IDX 2 +#define regDCHUBBUB_CRC_CTRL 0x04b1 +#define regDCHUBBUB_CRC_CTRL_BASE_IDX 2 +#define regDCHUBBUB_CRC0_VAL_R 0x04b2 +#define regDCHUBBUB_CRC0_VAL_R_BASE_IDX 2 +#define regDCHUBBUB_CRC0_VAL_G 0x04b3 +#define regDCHUBBUB_CRC0_VAL_G_BASE_IDX 2 +#define regDCHUBBUB_CRC0_VAL_B 0x04b4 +#define regDCHUBBUB_CRC0_VAL_B_BASE_IDX 2 +#define regDCHUBBUB_CRC0_VAL_A 0x04b5 +#define regDCHUBBUB_CRC0_VAL_A_BASE_IDX 2 +#define regDCHUBBUB_CRC1_VAL_R 0x04b6 +#define regDCHUBBUB_CRC1_VAL_R_BASE_IDX 2 +#define regDCHUBBUB_CRC1_VAL_G 0x04b7 +#define regDCHUBBUB_CRC1_VAL_G_BASE_IDX 2 +#define regDCHUBBUB_CRC1_VAL_B 0x04b8 +#define regDCHUBBUB_CRC1_VAL_B_BASE_IDX 2 +#define regDCHUBBUB_CRC1_VAL_A 0x04b9 +#define regDCHUBBUB_CRC1_VAL_A_BASE_IDX 2 +#define regDCHUBBUB_DCC_STAT_CNTL 0x04ba +#define regDCHUBBUB_DCC_STAT_CNTL_BASE_IDX 2 +#define regDCHUBBUB_DCC_STAT0 0x04bb +#define regDCHUBBUB_DCC_STAT0_BASE_IDX 2 +#define regDCHUBBUB_DCC_STAT1 0x04bc +#define regDCHUBBUB_DCC_STAT1_BASE_IDX 2 +#define regDCHUBBUB_DCC_STAT2 0x04bd +#define regDCHUBBUB_DCC_STAT2_BASE_IDX 2 +#define regDCHUBBUB_COMPBUF_CTRL 0x04be +#define regDCHUBBUB_COMPBUF_CTRL_BASE_IDX 2 +#define regDCHUBBUB_DET0_CTRL 0x04bf +#define regDCHUBBUB_DET0_CTRL_BASE_IDX 2 +#define regDCHUBBUB_DET1_CTRL 0x04c0 +#define regDCHUBBUB_DET1_CTRL_BASE_IDX 2 +#define regDCHUBBUB_DET2_CTRL 0x04c1 +#define regDCHUBBUB_DET2_CTRL_BASE_IDX 2 +#define regDCHUBBUB_DET3_CTRL 0x04c2 +#define regDCHUBBUB_DET3_CTRL_BASE_IDX 2 +#define regDCHUBBUB_MEM_PWR_MODE_CTRL 0x04c4 +#define regDCHUBBUB_MEM_PWR_MODE_CTRL_BASE_IDX 2 +#define regCOMPBUF_MEM_PWR_CTRL_1 0x04c5 +#define regCOMPBUF_MEM_PWR_CTRL_1_BASE_IDX 2 +#define regCOMPBUF_MEM_PWR_CTRL_2 0x04c6 +#define regCOMPBUF_MEM_PWR_CTRL_2_BASE_IDX 2 +#define regDCHUBBUB_MEM_PWR_STATUS 0x04c7 +#define regDCHUBBUB_MEM_PWR_STATUS_BASE_IDX 2 +#define regCOMPBUF_RESERVED_SPACE 0x04c8 +#define regCOMPBUF_RESERVED_SPACE_BASE_IDX 2 +#define regDCN_DECOMP_STATUS 0x04c9 +#define regDCN_DECOMP_STATUS_BASE_IDX 2 +#define regDCHUBBUB_DEBUG_CTRL_0 0x04ca +#define regDCHUBBUB_DEBUG_CTRL_0_BASE_IDX 2 +#define regDCHUBBUB_RET_PATH_REG_UPDATE_PENDING_TAKEN_STATUS 0x04cd +#define regDCHUBBUB_RET_PATH_REG_UPDATE_PENDING_TAKEN_STATUS_BASE_IDX 2 +#define regDCHUBBUB_RET_PATH_TEST_DEBUG_INDEX 0x04ce +#define regDCHUBBUB_RET_PATH_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDCHUBBUB_RET_PATH_TEST_DEBUG_DATA 0x04cf +#define regDCHUBBUB_RET_PATH_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dchubbubl_hubbub_vmrq_if_dispdec +// base address: 0x0 +#define regDCN_VM_CONTEXT0_CNTL 0x0559 +#define regDCN_VM_CONTEXT0_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32 0x055a +#define regDCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32 0x055b +#define regDCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32 0x055c +#define regDCN_VM_CONTEXT0_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32 0x055d +#define regDCN_VM_CONTEXT0_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32 0x055e +#define regDCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32 0x055f +#define regDCN_VM_CONTEXT0_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_CNTL 0x0560 +#define regDCN_VM_CONTEXT1_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_BASE_ADDR_HI32 0x0561 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_BASE_ADDR_LO32 0x0562 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32 0x0563 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32 0x0564 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_END_ADDR_HI32 0x0565 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_END_ADDR_LO32 0x0566 +#define regDCN_VM_CONTEXT1_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_CNTL 0x0567 +#define regDCN_VM_CONTEXT2_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_BASE_ADDR_HI32 0x0568 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_BASE_ADDR_LO32 0x0569 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_START_ADDR_HI32 0x056a +#define regDCN_VM_CONTEXT2_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_START_ADDR_LO32 0x056b +#define regDCN_VM_CONTEXT2_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_END_ADDR_HI32 0x056c +#define regDCN_VM_CONTEXT2_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT2_PAGE_TABLE_END_ADDR_LO32 0x056d +#define regDCN_VM_CONTEXT2_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_CNTL 0x056e +#define regDCN_VM_CONTEXT3_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_BASE_ADDR_HI32 0x056f +#define regDCN_VM_CONTEXT3_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_BASE_ADDR_LO32 0x0570 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_START_ADDR_HI32 0x0571 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_START_ADDR_LO32 0x0572 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_END_ADDR_HI32 0x0573 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_END_ADDR_LO32 0x0574 +#define regDCN_VM_CONTEXT3_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_CNTL 0x0575 +#define regDCN_VM_CONTEXT4_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_BASE_ADDR_HI32 0x0576 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_BASE_ADDR_LO32 0x0577 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_START_ADDR_HI32 0x0578 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_START_ADDR_LO32 0x0579 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_END_ADDR_HI32 0x057a +#define regDCN_VM_CONTEXT4_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT4_PAGE_TABLE_END_ADDR_LO32 0x057b +#define regDCN_VM_CONTEXT4_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_CNTL 0x057c +#define regDCN_VM_CONTEXT5_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_BASE_ADDR_HI32 0x057d +#define regDCN_VM_CONTEXT5_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_BASE_ADDR_LO32 0x057e +#define regDCN_VM_CONTEXT5_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_START_ADDR_HI32 0x057f +#define regDCN_VM_CONTEXT5_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_START_ADDR_LO32 0x0580 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_END_ADDR_HI32 0x0581 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_END_ADDR_LO32 0x0582 +#define regDCN_VM_CONTEXT5_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_CNTL 0x0583 +#define regDCN_VM_CONTEXT6_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_BASE_ADDR_HI32 0x0584 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_BASE_ADDR_LO32 0x0585 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_START_ADDR_HI32 0x0586 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_START_ADDR_LO32 0x0587 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_END_ADDR_HI32 0x0588 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_END_ADDR_LO32 0x0589 +#define regDCN_VM_CONTEXT6_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_CNTL 0x058a +#define regDCN_VM_CONTEXT7_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_BASE_ADDR_HI32 0x058b +#define regDCN_VM_CONTEXT7_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_BASE_ADDR_LO32 0x058c +#define regDCN_VM_CONTEXT7_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_START_ADDR_HI32 0x058d +#define regDCN_VM_CONTEXT7_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_START_ADDR_LO32 0x058e +#define regDCN_VM_CONTEXT7_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_END_ADDR_HI32 0x058f +#define regDCN_VM_CONTEXT7_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_END_ADDR_LO32 0x0590 +#define regDCN_VM_CONTEXT7_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_CNTL 0x0591 +#define regDCN_VM_CONTEXT8_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_BASE_ADDR_HI32 0x0592 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_BASE_ADDR_LO32 0x0593 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_START_ADDR_HI32 0x0594 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_START_ADDR_LO32 0x0595 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_END_ADDR_HI32 0x0596 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_END_ADDR_LO32 0x0597 +#define regDCN_VM_CONTEXT8_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_CNTL 0x0598 +#define regDCN_VM_CONTEXT9_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_BASE_ADDR_HI32 0x0599 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_BASE_ADDR_LO32 0x059a +#define regDCN_VM_CONTEXT9_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_START_ADDR_HI32 0x059b +#define regDCN_VM_CONTEXT9_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_START_ADDR_LO32 0x059c +#define regDCN_VM_CONTEXT9_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_END_ADDR_HI32 0x059d +#define regDCN_VM_CONTEXT9_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT9_PAGE_TABLE_END_ADDR_LO32 0x059e +#define regDCN_VM_CONTEXT9_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_CNTL 0x059f +#define regDCN_VM_CONTEXT10_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_BASE_ADDR_HI32 0x05a0 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_BASE_ADDR_LO32 0x05a1 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_START_ADDR_HI32 0x05a2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_START_ADDR_LO32 0x05a3 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_END_ADDR_HI32 0x05a4 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_END_ADDR_LO32 0x05a5 +#define regDCN_VM_CONTEXT10_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_CNTL 0x05a6 +#define regDCN_VM_CONTEXT11_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_BASE_ADDR_HI32 0x05a7 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_BASE_ADDR_LO32 0x05a8 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_START_ADDR_HI32 0x05a9 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_START_ADDR_LO32 0x05aa +#define regDCN_VM_CONTEXT11_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_END_ADDR_HI32 0x05ab +#define regDCN_VM_CONTEXT11_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT11_PAGE_TABLE_END_ADDR_LO32 0x05ac +#define regDCN_VM_CONTEXT11_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_CNTL 0x05ad +#define regDCN_VM_CONTEXT12_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_BASE_ADDR_HI32 0x05ae +#define regDCN_VM_CONTEXT12_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_BASE_ADDR_LO32 0x05af +#define regDCN_VM_CONTEXT12_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_START_ADDR_HI32 0x05b0 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_START_ADDR_LO32 0x05b1 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_END_ADDR_HI32 0x05b2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_END_ADDR_LO32 0x05b3 +#define regDCN_VM_CONTEXT12_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_CNTL 0x05b4 +#define regDCN_VM_CONTEXT13_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_BASE_ADDR_HI32 0x05b5 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_BASE_ADDR_LO32 0x05b6 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_START_ADDR_HI32 0x05b7 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_START_ADDR_LO32 0x05b8 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_END_ADDR_HI32 0x05b9 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT13_PAGE_TABLE_END_ADDR_LO32 0x05ba +#define regDCN_VM_CONTEXT13_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_CNTL 0x05bb +#define regDCN_VM_CONTEXT14_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_BASE_ADDR_HI32 0x05bc +#define regDCN_VM_CONTEXT14_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_BASE_ADDR_LO32 0x05bd +#define regDCN_VM_CONTEXT14_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_START_ADDR_HI32 0x05be +#define regDCN_VM_CONTEXT14_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_START_ADDR_LO32 0x05bf +#define regDCN_VM_CONTEXT14_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_END_ADDR_HI32 0x05c0 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_END_ADDR_LO32 0x05c1 +#define regDCN_VM_CONTEXT14_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_CNTL 0x05c2 +#define regDCN_VM_CONTEXT15_CNTL_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_BASE_ADDR_HI32 0x05c3 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_BASE_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_BASE_ADDR_LO32 0x05c4 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_BASE_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_START_ADDR_HI32 0x05c5 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_START_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_START_ADDR_LO32 0x05c6 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_START_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_END_ADDR_HI32 0x05c7 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_END_ADDR_HI32_BASE_IDX 2 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_END_ADDR_LO32 0x05c8 +#define regDCN_VM_CONTEXT15_PAGE_TABLE_END_ADDR_LO32_BASE_IDX 2 +#define regDCN_VM_DEFAULT_ADDR_MSB 0x05c9 +#define regDCN_VM_DEFAULT_ADDR_MSB_BASE_IDX 2 +#define regDCN_VM_DEFAULT_ADDR_LSB 0x05ca +#define regDCN_VM_DEFAULT_ADDR_LSB_BASE_IDX 2 +#define regDCN_VM_FAULT_CNTL 0x05cb +#define regDCN_VM_FAULT_CNTL_BASE_IDX 2 +#define regDCN_VM_FAULT_STATUS 0x05cc +#define regDCN_VM_FAULT_STATUS_BASE_IDX 2 +#define regDCN_VM_FAULT_ADDR_MSB 0x05cd +#define regDCN_VM_FAULT_ADDR_MSB_BASE_IDX 2 +#define regDCN_VM_FAULT_ADDR_LSB 0x05ce +#define regDCN_VM_FAULT_ADDR_LSB_BASE_IDX 2 + + +// addressBlock: dce_dc_dchubbubl_dchubbub_dcperfmon_dc_perfmon_dispdec +// base address: 0x1534 +#define regDC_PERFMON5_PERFCOUNTER_CNTL 0x054d +#define regDC_PERFMON5_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON5_PERFCOUNTER_CNTL2 0x054e +#define regDC_PERFMON5_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON5_PERFCOUNTER_STATE 0x054f +#define regDC_PERFMON5_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_CNTL 0x0550 +#define regDC_PERFMON5_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_CNTL2 0x0551 +#define regDC_PERFMON5_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_CVALUE_INT_MISC 0x0552 +#define regDC_PERFMON5_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_CVALUE_LOW 0x0553 +#define regDC_PERFMON5_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_HI 0x0554 +#define regDC_PERFMON5_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_LOW 0x0555 +#define regDC_PERFMON5_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_TEST_DEBUG_INDEX 0x0556 +#define regDC_PERFMON5_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON5_PERFMON_TEST_DEBUG_DATA 0x0557 +#define regDC_PERFMON5_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp0_dispdec_hubp_dispdec +// base address: 0x0 +#define regHUBP0_DCSURF_SURFACE_CONFIG 0x05e5 +#define regHUBP0_DCSURF_SURFACE_CONFIG_BASE_IDX 2 +#define regHUBP0_DCSURF_ADDR_CONFIG 0x05e6 +#define regHUBP0_DCSURF_ADDR_CONFIG_BASE_IDX 2 +#define regHUBP0_DCSURF_TILING_CONFIG 0x05e7 +#define regHUBP0_DCSURF_TILING_CONFIG_BASE_IDX 2 +#define regHUBP0_DCSURF_LEGACY_ADDR_CONFIG 0x05e8 +#define regHUBP0_DCSURF_LEGACY_ADDR_CONFIG_BASE_IDX 2 +#define regHUBP0_DCSURF_PRI_VIEWPORT_START 0x05e9 +#define regHUBP0_DCSURF_PRI_VIEWPORT_START_BASE_IDX 2 +#define regHUBP0_DCSURF_VIEWPORT_MCACHE_SPLIT_COORDINATE 0x05ea +#define regHUBP0_DCSURF_VIEWPORT_MCACHE_SPLIT_COORDINATE_BASE_IDX 2 +#define regHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION 0x05eb +#define regHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_BASE_IDX 2 +#define regHUBP0_DCSURF_PRI_VIEWPORT_START_C 0x05ec +#define regHUBP0_DCSURF_PRI_VIEWPORT_START_C_BASE_IDX 2 +#define regHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_C 0x05ed +#define regHUBP0_DCSURF_PRI_VIEWPORT_DIMENSION_C_BASE_IDX 2 +#define regHUBP0_DCSURF_SEC_VIEWPORT_START 0x05ee +#define regHUBP0_DCSURF_SEC_VIEWPORT_START_BASE_IDX 2 +#define regHUBP0_DCSURF_SEC_VIEWPORT_DIMENSION 0x05ef +#define regHUBP0_DCSURF_SEC_VIEWPORT_DIMENSION_BASE_IDX 2 +#define regHUBP0_DCSURF_SEC_VIEWPORT_START_C 0x05f0 +#define regHUBP0_DCSURF_SEC_VIEWPORT_START_C_BASE_IDX 2 +#define regHUBP0_DCSURF_SEC_VIEWPORT_DIMENSION_C 0x05f1 +#define regHUBP0_DCSURF_SEC_VIEWPORT_DIMENSION_C_BASE_IDX 2 +#define regHUBP0_DCHUBP_REQ_SIZE_CONFIG 0x05f2 +#define regHUBP0_DCHUBP_REQ_SIZE_CONFIG_BASE_IDX 2 +#define regHUBP0_DCHUBP_REQ_SIZE_CONFIG_C 0x05f3 +#define regHUBP0_DCHUBP_REQ_SIZE_CONFIG_C_BASE_IDX 2 +#define regHUBP0_DCHUBP_CNTL 0x05f4 +#define regHUBP0_DCHUBP_CNTL_BASE_IDX 2 +#define regHUBP0_HUBP_CLK_CNTL 0x05f5 +#define regHUBP0_HUBP_CLK_CNTL_BASE_IDX 2 +#define regHUBP0_DCHUBP_VMPG_CONFIG 0x05f6 +#define regHUBP0_DCHUBP_VMPG_CONFIG_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG0 0x05f7 +#define regHUBP0_DCHUBP_SUB_VP_CFG0_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG1 0x05f8 +#define regHUBP0_DCHUBP_SUB_VP_CFG1_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG2 0x05f9 +#define regHUBP0_DCHUBP_SUB_VP_CFG2_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG3 0x05fa +#define regHUBP0_DCHUBP_SUB_VP_CFG3_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG4 0x05fb +#define regHUBP0_DCHUBP_SUB_VP_CFG4_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG5 0x05fc +#define regHUBP0_DCHUBP_SUB_VP_CFG5_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG6 0x05fd +#define regHUBP0_DCHUBP_SUB_VP_CFG6_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG7 0x05fe +#define regHUBP0_DCHUBP_SUB_VP_CFG7_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG8 0x05ff +#define regHUBP0_DCHUBP_SUB_VP_CFG8_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG9 0x0600 +#define regHUBP0_DCHUBP_SUB_VP_CFG9_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG10 0x0601 +#define regHUBP0_DCHUBP_SUB_VP_CFG10_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG11 0x0602 +#define regHUBP0_DCHUBP_SUB_VP_CFG11_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG12 0x0603 +#define regHUBP0_DCHUBP_SUB_VP_CFG12_BASE_IDX 2 +#define regHUBP0_DCHUBP_SUB_VP_CFG13 0x0604 +#define regHUBP0_DCHUBP_SUB_VP_CFG13_BASE_IDX 2 +#define regHUBP0_DCHUBP_MCACHEID_CONFIG 0x0605 +#define regHUBP0_DCHUBP_MCACHEID_CONFIG_BASE_IDX 2 +#define regHUBP0_HUBPREQ_DEBUG_DB 0x0606 +#define regHUBP0_HUBPREQ_DEBUG_DB_BASE_IDX 2 +#define regHUBP0_HUBPREQ_DEBUG 0x0607 +#define regHUBP0_HUBPREQ_DEBUG_BASE_IDX 2 +#define regHUBP0_HUBP_MEASURE_WIN_CTRL_DCFCLK 0x060b +#define regHUBP0_HUBP_MEASURE_WIN_CTRL_DCFCLK_BASE_IDX 2 +#define regHUBP0_HUBP_MEASURE_WIN_CTRL_DPPCLK 0x060c +#define regHUBP0_HUBP_MEASURE_WIN_CTRL_DPPCLK_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp0_dispdec_hubpreq_dispdec +// base address: 0x0 +#define regHUBPREQ0_DCSURF_SURFACE_PITCH 0x0613 +#define regHUBPREQ0_DCSURF_SURFACE_PITCH_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_PITCH_C 0x0614 +#define regHUBPREQ0_DCSURF_SURFACE_PITCH_C_BASE_IDX 2 +#define regHUBPREQ0_VMID_SETTINGS_0 0x0615 +#define regHUBPREQ0_VMID_SETTINGS_0_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS 0x0616 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH 0x0617 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_C 0x0618 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C 0x0619 +#define regHUBPREQ0_DCSURF_PRIMARY_SURFACE_ADDRESS_HIGH_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS 0x061a +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH 0x061b +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_C 0x061c +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH_C 0x061d +#define regHUBPREQ0_DCSURF_SECONDARY_SURFACE_ADDRESS_HIGH_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_CONTROL 0x061e +#define regHUBPREQ0_DCSURF_SURFACE_CONTROL_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_FLIP_CONTROL 0x061f +#define regHUBPREQ0_DCSURF_FLIP_CONTROL_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_FLIP_CONTROL2 0x0620 +#define regHUBPREQ0_DCSURF_FLIP_CONTROL2_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_FLIP_INTERRUPT 0x0623 +#define regHUBPREQ0_DCSURF_SURFACE_FLIP_INTERRUPT_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE 0x0624 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_HIGH 0x0625 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_HIGH_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_C 0x0626 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_HIGH_C 0x0627 +#define regHUBPREQ0_DCSURF_SURFACE_INUSE_HIGH_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE 0x0628 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_HIGH 0x0629 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_HIGH_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_C 0x062a +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_C_BASE_IDX 2 +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C 0x062b +#define regHUBPREQ0_DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C_BASE_IDX 2 +#define regHUBPREQ0_DCN_EXPANSION_MODE 0x062c +#define regHUBPREQ0_DCN_EXPANSION_MODE_BASE_IDX 2 +#define regHUBPREQ0_DCN_GLOBAL_TTU_CNTL 0x062d +#define regHUBPREQ0_DCN_GLOBAL_TTU_CNTL_BASE_IDX 2 +#define regHUBPREQ0_DCN_SURF0_TTU_CNTL0 0x062e +#define regHUBPREQ0_DCN_SURF0_TTU_CNTL0_BASE_IDX 2 +#define regHUBPREQ0_DCN_SURF0_TTU_CNTL1 0x062f +#define regHUBPREQ0_DCN_SURF0_TTU_CNTL1_BASE_IDX 2 +#define regHUBPREQ0_DCN_SURF1_TTU_CNTL0 0x0630 +#define regHUBPREQ0_DCN_SURF1_TTU_CNTL0_BASE_IDX 2 +#define regHUBPREQ0_DCN_SURF1_TTU_CNTL1 0x0631 +#define regHUBPREQ0_DCN_SURF1_TTU_CNTL1_BASE_IDX 2 +#define regHUBPREQ0_DCN_CUR0_TTU_CNTL0 0x0632 +#define regHUBPREQ0_DCN_CUR0_TTU_CNTL0_BASE_IDX 2 +#define regHUBPREQ0_DCN_CUR0_TTU_CNTL1 0x0633 +#define regHUBPREQ0_DCN_CUR0_TTU_CNTL1_BASE_IDX 2 +#define regHUBPREQ0_DCN_CUR1_TTU_CNTL0 0x0634 +#define regHUBPREQ0_DCN_CUR1_TTU_CNTL0_BASE_IDX 2 +#define regHUBPREQ0_DCN_CUR1_TTU_CNTL1 0x0635 +#define regHUBPREQ0_DCN_CUR1_TTU_CNTL1_BASE_IDX 2 +#define regHUBPREQ0_DCN_DMDATA_VM_CNTL 0x0636 +#define regHUBPREQ0_DCN_DMDATA_VM_CNTL_BASE_IDX 2 +#define regHUBPREQ0_DCN_VM_SYSTEM_APERTURE_LOW_ADDR 0x0637 +#define regHUBPREQ0_DCN_VM_SYSTEM_APERTURE_LOW_ADDR_BASE_IDX 2 +#define regHUBPREQ0_DCN_VM_SYSTEM_APERTURE_HIGH_ADDR 0x0638 +#define regHUBPREQ0_DCN_VM_SYSTEM_APERTURE_HIGH_ADDR_BASE_IDX 2 +#define regHUBPREQ0_DCN_VM_MX_L1_TLB_CNTL 0x0645 +#define regHUBPREQ0_DCN_VM_MX_L1_TLB_CNTL_BASE_IDX 2 +#define regHUBPREQ0_BLANK_OFFSET_0 0x0646 +#define regHUBPREQ0_BLANK_OFFSET_0_BASE_IDX 2 +#define regHUBPREQ0_BLANK_OFFSET_1 0x0647 +#define regHUBPREQ0_BLANK_OFFSET_1_BASE_IDX 2 +#define regHUBPREQ0_DST_DIMENSIONS 0x0648 +#define regHUBPREQ0_DST_DIMENSIONS_BASE_IDX 2 +#define regHUBPREQ0_DST_AFTER_SCALER 0x0649 +#define regHUBPREQ0_DST_AFTER_SCALER_BASE_IDX 2 +#define regHUBPREQ0_PREFETCH_SETTINGS 0x064a +#define regHUBPREQ0_PREFETCH_SETTINGS_BASE_IDX 2 +#define regHUBPREQ0_PREFETCH_SETTINGS_C 0x064b +#define regHUBPREQ0_PREFETCH_SETTINGS_C_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_0 0x064c +#define regHUBPREQ0_VBLANK_PARAMETERS_0_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_1 0x064d +#define regHUBPREQ0_VBLANK_PARAMETERS_1_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_2 0x064e +#define regHUBPREQ0_VBLANK_PARAMETERS_2_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_3 0x064f +#define regHUBPREQ0_VBLANK_PARAMETERS_3_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_4 0x0650 +#define regHUBPREQ0_VBLANK_PARAMETERS_4_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_0 0x0651 +#define regHUBPREQ0_FLIP_PARAMETERS_0_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_1 0x0652 +#define regHUBPREQ0_FLIP_PARAMETERS_1_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_2 0x0653 +#define regHUBPREQ0_FLIP_PARAMETERS_2_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_0 0x0654 +#define regHUBPREQ0_NOM_PARAMETERS_0_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_1 0x0655 +#define regHUBPREQ0_NOM_PARAMETERS_1_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_2 0x0656 +#define regHUBPREQ0_NOM_PARAMETERS_2_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_3 0x0657 +#define regHUBPREQ0_NOM_PARAMETERS_3_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_4 0x0658 +#define regHUBPREQ0_NOM_PARAMETERS_4_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_5 0x0659 +#define regHUBPREQ0_NOM_PARAMETERS_5_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_6 0x065a +#define regHUBPREQ0_NOM_PARAMETERS_6_BASE_IDX 2 +#define regHUBPREQ0_NOM_PARAMETERS_7 0x065b +#define regHUBPREQ0_NOM_PARAMETERS_7_BASE_IDX 2 +#define regHUBPREQ0_PER_LINE_DELIVERY_PRE 0x065c +#define regHUBPREQ0_PER_LINE_DELIVERY_PRE_BASE_IDX 2 +#define regHUBPREQ0_PER_LINE_DELIVERY 0x065d +#define regHUBPREQ0_PER_LINE_DELIVERY_BASE_IDX 2 +#define regHUBPREQ0_CURSOR_SETTINGS 0x065e +#define regHUBPREQ0_CURSOR_SETTINGS_BASE_IDX 2 +#define regHUBPREQ0_REF_FREQ_TO_PIX_FREQ 0x065f +#define regHUBPREQ0_REF_FREQ_TO_PIX_FREQ_BASE_IDX 2 +#define regHUBPREQ0_DST_Y_DELTA_DRQ_LIMIT 0x0660 +#define regHUBPREQ0_DST_Y_DELTA_DRQ_LIMIT_BASE_IDX 2 +#define regHUBPREQ0_DST_Y_ALT_CH_DRQ_LIMIT 0x0661 +#define regHUBPREQ0_DST_Y_ALT_CH_DRQ_LIMIT_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_MEM_PWR_CTRL 0x0662 +#define regHUBPREQ0_HUBPREQ_MEM_PWR_CTRL_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_MEM_PWR_STATUS 0x0663 +#define regHUBPREQ0_HUBPREQ_MEM_PWR_STATUS_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_5 0x0667 +#define regHUBPREQ0_VBLANK_PARAMETERS_5_BASE_IDX 2 +#define regHUBPREQ0_VBLANK_PARAMETERS_6 0x0668 +#define regHUBPREQ0_VBLANK_PARAMETERS_6_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_3 0x0669 +#define regHUBPREQ0_FLIP_PARAMETERS_3_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_4 0x066a +#define regHUBPREQ0_FLIP_PARAMETERS_4_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_5 0x066b +#define regHUBPREQ0_FLIP_PARAMETERS_5_BASE_IDX 2 +#define regHUBPREQ0_FLIP_PARAMETERS_6 0x066c +#define regHUBPREQ0_FLIP_PARAMETERS_6_BASE_IDX 2 +#define regHUBPREQ0_UCLK_PSTATE_FORCE 0x066d +#define regHUBPREQ0_UCLK_PSTATE_FORCE_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_STATUS_REG0 0x066e +#define regHUBPREQ0_HUBPREQ_STATUS_REG0_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_STATUS_REG1 0x066f +#define regHUBPREQ0_HUBPREQ_STATUS_REG1_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_STATUS_REG2 0x0670 +#define regHUBPREQ0_HUBPREQ_STATUS_REG2_BASE_IDX 2 +#define regHUBPREQ0_HUBPREQ_STATUS_REG3 0x0671 +#define regHUBPREQ0_HUBPREQ_STATUS_REG3_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp0_dispdec_hubpret_dispdec +// base address: 0x0 +#define regHUBPRET0_HUBPRET_CONTROL 0x0679 +#define regHUBPRET0_HUBPRET_CONTROL_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_MEM_PWR_CTRL 0x067a +#define regHUBPRET0_HUBPRET_MEM_PWR_CTRL_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_MEM_PWR_STATUS 0x067b +#define regHUBPRET0_HUBPRET_MEM_PWR_STATUS_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE_CTRL0 0x067c +#define regHUBPRET0_HUBPRET_READ_LINE_CTRL0_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE_CTRL1 0x067d +#define regHUBPRET0_HUBPRET_READ_LINE_CTRL1_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE0 0x067e +#define regHUBPRET0_HUBPRET_READ_LINE0_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE1 0x067f +#define regHUBPRET0_HUBPRET_READ_LINE1_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_INTERRUPT 0x0680 +#define regHUBPRET0_HUBPRET_INTERRUPT_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE_VALUE 0x0681 +#define regHUBPRET0_HUBPRET_READ_LINE_VALUE_BASE_IDX 2 +#define regHUBPRET0_HUBPRET_READ_LINE_STATUS 0x0682 +#define regHUBPRET0_HUBPRET_READ_LINE_STATUS_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp0_dispdec_cursor0_dispdec +// base address: 0x0 +#define regCURSOR0_0_CURSOR_CONTROL 0x0686 +#define regCURSOR0_0_CURSOR_CONTROL_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_SURFACE_ADDRESS 0x0687 +#define regCURSOR0_0_CURSOR_SURFACE_ADDRESS_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_SURFACE_ADDRESS_HIGH 0x0688 +#define regCURSOR0_0_CURSOR_SURFACE_ADDRESS_HIGH_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_SIZE 0x0689 +#define regCURSOR0_0_CURSOR_SIZE_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_POSITION 0x068a +#define regCURSOR0_0_CURSOR_POSITION_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_HOT_SPOT 0x068b +#define regCURSOR0_0_CURSOR_HOT_SPOT_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_STEREO_CONTROL 0x068c +#define regCURSOR0_0_CURSOR_STEREO_CONTROL_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_DST_OFFSET 0x068d +#define regCURSOR0_0_CURSOR_DST_OFFSET_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_MEM_PWR_CTRL 0x068e +#define regCURSOR0_0_CURSOR_MEM_PWR_CTRL_BASE_IDX 2 +#define regCURSOR0_0_CURSOR_MEM_PWR_STATUS 0x068f +#define regCURSOR0_0_CURSOR_MEM_PWR_STATUS_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_ADDRESS_HIGH 0x0690 +#define regCURSOR0_0_DMDATA_ADDRESS_HIGH_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_ADDRESS_LOW 0x0691 +#define regCURSOR0_0_DMDATA_ADDRESS_LOW_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_CNTL 0x0692 +#define regCURSOR0_0_DMDATA_CNTL_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_QOS_CNTL 0x0693 +#define regCURSOR0_0_DMDATA_QOS_CNTL_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_STATUS 0x0694 +#define regCURSOR0_0_DMDATA_STATUS_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_SW_CNTL 0x0695 +#define regCURSOR0_0_DMDATA_SW_CNTL_BASE_IDX 2 +#define regCURSOR0_0_DMDATA_SW_DATA 0x0696 +#define regCURSOR0_0_DMDATA_SW_DATA_BASE_IDX 2 +#define regCURSOR0_0_HUBP_3DLUT_CONTROL 0x0697 +#define regCURSOR0_0_HUBP_3DLUT_CONTROL_BASE_IDX 2 +#define regCURSOR0_0_HUBP_3DLUT_ADDRESS_LOW 0x0698 +#define regCURSOR0_0_HUBP_3DLUT_ADDRESS_LOW_BASE_IDX 2 +#define regCURSOR0_0_HUBP_3DLUT_ADDRESS_HIGH 0x0699 +#define regCURSOR0_0_HUBP_3DLUT_ADDRESS_HIGH_BASE_IDX 2 +#define regCURSOR0_0_HUBP_3DLUT_DLG_PARAM 0x069a +#define regCURSOR0_0_HUBP_3DLUT_DLG_PARAM_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp0_dispdec_hubp_dcperfmon_dc_perfmon_dispdec +// base address: 0x1a74 +#define regDC_PERFMON6_PERFCOUNTER_CNTL 0x069d +#define regDC_PERFMON6_PERFCOUNTER_CNTL_BASE_IDX 2 +#define regDC_PERFMON6_PERFCOUNTER_CNTL2 0x069e +#define regDC_PERFMON6_PERFCOUNTER_CNTL2_BASE_IDX 2 +#define regDC_PERFMON6_PERFCOUNTER_STATE 0x069f +#define regDC_PERFMON6_PERFCOUNTER_STATE_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_CNTL 0x06a0 +#define regDC_PERFMON6_PERFMON_CNTL_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_CNTL2 0x06a1 +#define regDC_PERFMON6_PERFMON_CNTL2_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_CVALUE_INT_MISC 0x06a2 +#define regDC_PERFMON6_PERFMON_CVALUE_INT_MISC_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_CVALUE_LOW 0x06a3 +#define regDC_PERFMON6_PERFMON_CVALUE_LOW_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_HI 0x06a4 +#define regDC_PERFMON6_PERFMON_HI_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_LOW 0x06a5 +#define regDC_PERFMON6_PERFMON_LOW_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_TEST_DEBUG_INDEX 0x06a6 +#define regDC_PERFMON6_PERFMON_TEST_DEBUG_INDEX_BASE_IDX 2 +#define regDC_PERFMON6_PERFMON_TEST_DEBUG_DATA 0x06a7 +#define regDC_PERFMON6_PERFMON_TEST_DEBUG_DATA_BASE_IDX 2 + + +// addressBlock: dce_dc_dcbubp1_dispdec_hubp_dispdec +// base address: 0x370 +#define regHUBP1_DCSURF_SURFACE_CONFIG 0x06c1 +#define regHUBP1_DCSURF_SURFACE_CONFIG_BASE_IDX 2 +#define regHUBP1_DCSURF_ADDR_CONFIG 0x06c2 +#define regHUBP1_DCSURF_ADDR_CONFIG_BASE_IDX 2 +#define regHUBP1_DCSURF_TILING_CONFIG 0x06c3 +#define regHUBP1_DCSURF_TILING_CONFIG_BASE_IDX 2 +#define regHUBP1_DCSURF_LEGACY_ADDR_CONFIG 0x06c4 +#define regHUBP1_DCSURF_LEGACY_ADDR_CONFIG_BASE_IDX 2 +#define regHUBP1_DCSURF_PRI_VIEWPORT_START 0x06c5 +#define regHUBP1_DCSURF_PRI_VIEWPORT_START_BASE_IDX 2 +#define regHUBP1_DCSURF_VIEWPORT_MCACHE_SPLIT_COORDINATE 0x06c6 +#define regHUBP1_DCSURF_VIEWPORT_MCACHE_SPLIT_COORDINATE_BASE_IDX 2 +#define regHUBP1_DCSURF_PRI_VIEWPORT_DIMENSION 0x06c7 +#define regHUBP1_DCSURF_PRI_VIEWPORT_DIMENSION_BASE_IDX 2 +#define regHUBP1_DCSURF_PRI_VIEWPORT_START_C 0x06c8
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/include/asic_reg/dcn/dcn_6_0_0_sh_mask.h new file +58556 -0
58,556 lines not on this page · raw message
drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_offset.h new file +47 -0
47 lines not on this page · raw message
drivers/gpu/drm/amd/include/asic_reg/dpcs/dpcs_6_0_0_sh_mask.h new file +55 -0
55 lines not on this page · raw message
drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_offset.h new file +17 -0
Lines of this file are not shown. View the raw message.
drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_5_0_1_sh_mask.h new file +17 -0
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.53.0
Part of the diff is not shown here. View the raw message.
Sasha Levin
maintainerPATCH 1/1 net: prestera: ignore duplicate RIF destruction events
In reply to Sasha LevinFrom: Yuyang Huang <[email protected]>
[ Upstream commit 3cbbc9fa33382d03f2813118e672eb318eba9cde ]
During address teardown, the inetaddr notifier may be called multiple times for the same interface. Ignore NETDEV_DOWN events if the RIF has already been destroyed, rather than returning -EEXIST, which aborts the notifier chain.
---
LLM Generated explanations, may be completely bogus:
I have enough to decide: this tree already has the IPv4 teardown change that makes prestera abort the inetaddr chain, so the two-line companion fix belongs here.
## Local tree
This checkout is **v7.3-rc4-27** (7.3.0-rc4, VERSION=7 PATCHLEVEL=3 SUBLEVEL=0). The candidate is 3cbbc9fa33382 (“net: prestera: ignore duplicate RIF destruction events”), already an ancestor of HEAD (merged for 7.3-rc1). The verdict is whether this tree’s code needs that fix on technical merit, not whether a pipeline already picked it.
---
### PHASE 1: COMMIT MESSAGE FORENSICS
**Step 1.1 — Subject**
Record: **[net: prestera]** **[ignore]** duplicate RIF destruction events. “Ignore” here means treat a second destroy as success instead of failing.
**Step 1.2 — Tags**
Record:
- Cc: Ido Schimmel <[email protected]>
- Cc: Kuniyuki Iwashima <[email protected]>
- Signed-off-by: Yuyang Huang <[email protected]> (author)
- `Link: https://patch.msgid.link/20260711005405.2861680-2-
[email protected]`
- Signed-off-by: Jakub Kicinski <[email protected]> (netdev maintainer)
- No Fixes:, no Reported-by:, no Cc: stable (expected for this review)
- Ignore any Sasha Levin SOB (none on the real commit)
Later trailers (mbox): Acked-by: Elad Nachman <[email protected]> (Marvell prestera).
**Step 1.3 — Body**
Record: During address teardown the inetaddr notifier can run more than once for the same interface. Returning -EEXIST when the RIF is already gone **aborts the notifier chain**. Symptom: later inetaddr listeners miss NETDEV_DOWN. Root cause: destroy is not idempotent.
**Step 1.4 — Hidden bug fix?**
Record: Not hidden. It is a real error-path fix: missing RIF on NETDEV_DOWN was treated as a hard error.
---
### PHASE 2: DIFF ANALYSIS
**Step 2.1 — Inventory**
Record: drivers/net/ethernet/marvell/prestera/prestera_router.c — **+2 / −4** (6 lines net). Function: __prestera_inetaddr_port_event(). Surgical, single-file.
**Step 2.2 — Flow**
Before (NETDEV_DOWN, RIF already gone): set extack "Can't find RIF", return -EEXIST.
After: if (!re) return 0; then only destroy/put when the RIF still exists.
**Step 2.3 — Bug category**
Record: **Logic / correctness** (idempotent teardown). Secondary:
**notifier-chain abort**. Not UAF/leak/lock.
Mechanism: __prestera_inetaddr_cb uses notifier_from_errno(err). Non-zero errno becomes NOTIFY_STOP_MASK, so blocking_notifier_call_chain() stops. Confirmed in include/linux/notifier.h.
**Step 2.4 — Fix quality**
Record: Obviously correct: destroy should be idempotent. No new locks/APIs. Regression risk is low: a true “RIF missing on first DOWN” is now silent success instead of -EEXIST. That matches mlxsw-style handling Ido sketched on v1.
---
### PHASE 3: GIT HISTORY
**Step 3.1 — Blame**
Record: Buggy -EEXIST on missing RIF came from 15fa9e8c5ffbe0 (“Implement initial inetaddr notifiers”, 2021-12-27) / 32d098bb2e494c (refactor, 2022-01-11). Prestera router dates to da3c16398602a / 69204174cc5cb (~v5.17). Long-lived driver code.
**Step 3.2 — Fixes: tag**
Record: None. Trigger is **not** that old RIF code alone; it is companion series patch 3:
aa22336b76b73 — net: ipv4: clear dev->ip_ptr before destroying inetdev
That commit **is in this tree** (git merge-base --is-ancestor succeeded). It moves RCU_INIT_POINTER(dev->ip_ptr, NULL) **before** the ifa_list teardown loop in inetdev_destroy().
**Step 3.3 — File history**
Record: Recent prestera_router.c churn is unrelated (kmalloc_obj, IPv4 nhid, NULL vs IS_ERR). Standalone vs the series: this is **patch 1/3**, ordered so drivers are fixed **before** the core IPv4 change for bisectability.
**Step 3.4 — Author**
Record: Yuyang Huang (Google); two commits in this series. Not the prestera maintainer. Elad Nachman (Marvell) acked patch 1. Ido Schimmel **wrote the exact diff** in v1 review.
**Step 3.5 — Dependencies**
Record: Applies standalone on the 2022 RIF code. **Semantically required** once aa22336b76b73 is present. Patch 2 (e5b14e9ae82b, mac80211) is a sibling, not a prereq for prestera.
Without patch 3, __prestera_inetaddr_cb still uses __in_dev_get_rtnl(dev) and skips unless ifa_list is empty, so duplicate destroy on inetdev teardown does not happen. **This tree has patch 3**, so the duplicate path is live.
---
### PHASE 4: MAILING LIST
**Step 4.1 — Original thread**
Record: b4 dig -c 3cbbc9fa33382 →
https://patch.msgid.link/[email protected]
v1: single net-next patch only moving ip_ptr clear.
v2: [PATCH net-next v2 0/3] align IPv4 teardown with IPv6 and fix driver regressions.
Ido (v1): sashiko was right; prestera must ignore missing-RIF NETDEV_DOWN; he pasted this exact hunk; mlxsw already OK; audit other listeners.
Cover letter: clearing ip_ptr early makes __in_dev_get_rtnl() NULL in the destroy loop → prestera/mac80211 regressions. Drivers first, then core, for bisectability.
No NAKs. Applied to net-next by Kicinski (2026-07-21). Elad Acked-by after merge.
**Step 4.2 — Recipients (b4 dig -w)**
Record: davem, kuba, pabeni, dsahern, horms, edumazet, Ido, Elad Nachman, Johannes Berg, netdev, linux-wireless. Right lists/maintainers.
**Step 4.3 — Bug report**
Record: No syzbot/bugzilla. Found in review of the IPv4 teardown change.
**Step 4.4 — Series**
1. This prestera fix
2. mac80211: use ifa->ifa_dev
3. IPv4 ip_ptr clear
All three are in this tree.
**Step 4.5 — stable@**
Record: lore.kernel.org returned 403 via HTTP; b4 did get the netdev thread. No Cc: stable in the series (sent to **net-next**, not **net**). No evidence it was rejected for stable.
---
### PHASE 5: CODE SEMANTIC ANALYSIS
**Step 5.1 — Functions**
Record: __prestera_inetaddr_port_event() only.
**Step 5.2 — Callers**__prestera_inetaddr_event() → __prestera_inetaddr_cb (NETDEV_DOWN, last-address intent) and __prestera_inetaddr_valid_cb (NETDEV_UP only). Registered via register_inetaddr_notifier() in prestera_router_init().
**Step 5.3 — Callees** prestera_rif_entry_find/create/destroy, dev_hold/dev_put.
**Step 5.4 — Reachability**
Yes, from normal IPv4 teardown: inetdev_destroy() (NETDEV_UNREGISTER or invalid MTU) → inet_del_ifa() → inetaddr_chain NETDEV_DOWN.
After patch 3, __in_dev_get_rtnl(dev) is NULL, so the “not last address” skip is false and **every** remaining address generates a destroy attempt. First succeeds; later ones hit missing RIF.
inetaddr_chain also includes fib_inetaddr_event, SCTP, nf_nat masquerade, nfsd, lockd, mac80211, RDMA GID, ipvlan, etc. Default notifier priority 0: boot-time FIB typically runs before prestera; later-registered listeners after prestera **do not run** if prestera returns -EEXIST.
**Step 5.5 — Similar patterns**
mlxsw already treats missing RIF as “no config” (mlxsw_sp_rif_should_config). Ido: “mlxsw is OK.” No remaining "Can't find RIF" in prestera.
---
### PHASE 6: THIS TREE
**Step 6.1 — Buggy code**
The pre-fix return -EEXIST is in 3cbbc9fa33382^. Trigger aa22336b76b73 is in HEAD. Without this patch, 7.3-rc4 prestera would abort the chain. Current HEAD already has the idempotent return 0.
**Step 6.2 — Backport difficulty**
Clean: same function shape since 2022. This tree already contains the result.
**Step 6.3 — Other fixes**
No earlier equivalent. This is the fix.
---
### PHASE 7: SUBSYSTEM CONTEXT
**Step 7.1**
Record: Marvell Prestera switchdev Ethernet (CONFIG_PRESTERA). **PERIPHERAL** hardware, but the failure is on the **global inetaddr chain** (IMPORTANT impact surface).
**Step 7.2**
Record: Mature driver (v5.17+). This change is a companion to 7.3 IPv4 teardown, not random refactor.
---
### PHASE 8: IMPACT AND RISK
**Step 8.1 — Who**
Prestera switch users with IPv4 on ports, especially **multiple addresses**, during unregister / inetdev destroy. Other inetaddr listeners on those events.
**Step 8.2 — Trigger**inetdev_destroy() after ip_ptr is cleared, more than one IPv4 address. Unprivileged users typically cannot unload the switch; admin teardown/unregister can. Not a race; deterministic.
**Step 8.3 — Failure mode**
Not an oops/UAF. -EEXIST → notifier stop → later listeners miss NETDEV_DOWN (SCTP local addrs, nfsd/lockd, RDMA GIDs, etc.). inet_del_ifa() ignores the chain return, so teardown continues, but **sidecar state can go stale**. Severity: **HIGH** for correctness of address teardown, not CRITICAL crash.
**Step 8.4 — Risk/benefit**
Benefit: high for this tree (trigger commit is present). Risk: very low (2 lines, maintainer-supplied, Acked). Ratio: strongly in favor.
---
### PHASE 9: SYNTHESIS
**For backporting**
- Real bug once aa22336b76b73 is present (this tree).
- Aborts inetaddr_chain; not cosmetic.
- 2-line, obviously correct, Ido-authored hunk, Elad ack, Kicinski merge.
- Applies cleanly; no new API.
- Patch 2 is not required for this file.
**Against**
- Niche CONFIG_PRESTERA.
- net-next companion, not a crash/CVE.
- No production Reported-by.
- Independent value is weak **without** the IPv4 ip_ptr move — but that move **is here**.
**Unresolved**
- HTTP 403 on lore/stable search; thread recovered via b4. No sign of a stable NAK.
**Stable rules**
1. Obviously correct and tested? **PASS** (Ido diff + Elad ack + net- next)
2. Real user-visible bug? **PASS** (notifier abort on port teardown)
3. Important? **PASS** (broken global NETDEV_DOWN delivery; not a panic)
4. Small/contained? **PASS** (+2/−4, one function)
5. No new features/APIs? **PASS**
6. Applies to this tree? **PASS** (same code; trigger present)
Exception category: none (not an ID/quirk/DT/build/doc add). Still a contained correctness fix.
This tree is 7.3-rc4 **with** the IPv4 teardown change. Without this patch, prestera turns duplicate RIF destroy into -EEXIST and stops the inetaddr chain. The fix is minimal and already reviewed. It should be in this tree.
Verification:
- [Phase 1] Tags: Cc Ido/Kuniyuki, Link msgid ...2861680-2, SOB Huang
+ Kicinski; no Fixes/syzbot
- [Phase 2] Diff: NETDEV_DOWN !re path -EEXIST → return 0 in __prestera_inetaddr_port_event
- [Phase 3] Blame: RIF notifier from 15fa9e8c5ffbe0 / 32d098bb2e494c (~v5.17)
- [Phase 3] git merge-base --is-ancestor aa22336b76b73 HEAD → trigger **in tree**; same for e5b14e9ae82b and 3cbbc9fa33382
- [Phase 3] git describe HEAD → v7.3-rc4-27-gf0100363d8c37; make kernelversion → 7.3.0-rc4
- [Phase 3] git show aa22336b76b73: ip_ptr cleared **before** ifa loop
- [Phase 4] b4 dig -c 3cbbc9fa33382: v2 1/3 net-next; v1 was core-only
- [Phase 4] Ido v1: exact prestera hunk; Elad Acked-by
- [Phase 4] lore HTTP 403; mbox via b4 succeeded
- [Phase 5] Callers: __prestera_inetaddr_cb → notifier_from_errno; chain includes fib, sctp, nfsd, rdma, mac80211
- [Phase 5] notifier_from_errno sets NOTIFY_STOP_MASK on any errno
- [Phase 6] Pre-image at 3cbbc9fa33382^ still has -EEXIST; HEAD has return 0
- [Phase 8] Failure: notifier abort, not oops; trigger = inetdev_destroy
+ multiple IPv4 addrs after ip_ptr clear
- UNVERIFIED: whether anyone asked for this on stable@ (lore 403)
**YES**
drivers/net/ethernet/marvell/prestera/prestera_router.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/prestera/prestera_router.c +2 -4
@@ -1302,10 +1302,8 @@ static int __prestera_inetaddr_port_event(struct net_device *port_dev,dev_hold (port_dev);break ;case NETDEV_DOWN : -if (!re) { -NL_SET_ERR_MSG_MOD (extack,"Can't find RIF" ); -return -EEXIST ; - } +if (!re) +return 0 ;prestera_rif_entry_destroy (port->sw, re);dev_put (port_dev);break ;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 media: cec: tegra_cec: don't break off msg on NACK
In reply to Sasha LevinFrom: Hans Verkuil <[email protected]>
[ Upstream commit be627f257ce283c95fd2988080dc0db3a20d0d2a ]
The Tegra CEC hardware has a bug where, if the first attempt to transmit a message is NACKed so the transmit is aborted, then the second attempt can contain corrupt data.
Ensure that the full message is always transmitted to avoid hitting this bug.
I suspect some internal state is not reset in the case of aborting a message due to a NACK.
---
LLM Generated explanations, may be completely bogus:
This is a hardware-quirk workaround in the Tegra HDMI CEC driver: after a NACK abort, the next transmit can be corrupt. The local tree is **v7.3-rc4** (7.3.0-rc4). The driver and TEGRA_CEC_HWCTRL_TX_NAK_MODE bit have been here since the original 2017 driver, so the fix belongs in this tree.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: [media: cec: tegra_cec] [don't break off] [keep transmitting a CEC message after NACK so Tegra HW does not corrupt the retry]
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- Signed-off-by: Hans Verkuil \<[email protected]\> (author; CEC and Tegra CEC maintainer)
- Reviewed-by: Mikko Perttunen \<[email protected]\> (NVIDIA)
- Signed-off-by: Mauro Carvalho Chehab \<[email protected]\> (media maintainer)
- No Fixes:, Reported-by:, Tested-by:, Link:, or Cc: stable (absence expected)
- Ignored: any Sasha Levin SOB / Upstream-commit markers (none present on the real commit)
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- Bug: Tegra CEC silicon bug. If the first transmit is NACKed and aborted, the second attempt can contain corrupt data. Author suspects internal HW state is not reset on NACK abort.
- Symptom: corrupt HDMI-CEC frames on retry after NACK (wrong bytes on the CEC bus).
- Version info: none in the message. Driver dates to v4.15-rc1.
- Root cause (author): abort-on-NACK leaves HW in a bad state; workaround is to always send the full message (TX_NAK_MODE).
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not disguised. Cover letter calls it “a fix” / HW-bug workaround. Not cleanup.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- File: drivers/media/cec/platform/tegra/tegra_cec.c (+12 / -1)
- Function: tegra_cec_adap_enable()
- Scope: single-file surgical change; one functional OR of an existing HW bit plus a comment
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- Before: enable path wrote TEGRA_CEC_HW_CONTROL = TEGRA_CEC_HWCTRL_TX_RX_MODE only. Hardware aborted TX on NACK.
- After: same write also sets TEGRA_CEC_HWCTRL_TX_NAK_MODE so the full frame is sent even if bytes are NACKed.
- Path: adapter enable (normal init), not an error path.
- tegra_cec_adap_log_addr() and tegra_cec_adap_monitor_all_enable() RMW HW_CONTROL, so they keep the bit. tegra_cec_error_recovery() saves/restores hw_ctrl, so it keeps the bit too.
Step 2.3: IDENTIFY THE BUG MECHANISM
Record: [Hardware workaround] Default abort-on-NACK leaves Tegra CEC TX state unrestored; retry can emit corrupt data. Setting TX_NAK_MODE avoids the abort path. IRQ still reports NACK via TX_FRAME_OR_BLOCK_NAKD when TX_FRAME_TRANSMITTED fires.
Step 2.4: ASSESS THE FIX QUALITY
Record:
- Obviously correct: one existing register bit, documented in-tree since 2017, unused until now.
- Minimal: one OR plus comment.
- Regression risk: low. Bus is occupied a bit longer after NACK (author notes this). NVIDIA reviewed. Software still reports CEC_TX_STATUS_NACK. POLL (the usual NACK) is one byte, so extra bus time is negligible.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record: Buggy write is from 9d2d60687c9a (“media: tegra-cec: add Tegra HDMI CEC driver”, 2017-07-15, contained in v4.15-rc1). TEGRA_CEC_HWCTRL_TX_NAK_MODE was defined in that same commit ((1 << 24)), later rewritten as BIT(24) in cce8ccca80d838 (2019). Bug has been in this driver for the entire mainline life of the driver.
Step 3.2: FOLLOW THE FIXES: TAG
Record: No Fixes: tag. N/A. Introduced by original driver, not a later regression.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record: Same-day series 1/2. 2/2 is bce7236c16c2c (“keep track of number of Rx Low Drives”) — debug counter, not a prerequisite. Later a45a81a790b96 is an unrelated dev_err cleanup. Standalone.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Hans Verkuil is listed in MAINTAINERS for both CEC FRAMEWORK and ARM/TEGRA HDMI CEC. NVIDIA’s Mikko Perttunen reviewed. High confidence.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: None. Uses TEGRA_CEC_HWCTRL_TX_NAK_MODE already in tegra_cec.h in this tree. Applies standalone.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- Lore: https://patch.msgid.link/7e50d6027e1676650d52905cd20eb212c01cd3e
[email protected]
- Cover: [PATCH 0/2] media: tegra_cec: a fix and an enhancement — “the first works around a HW bug where, if a transmit was NACKed, the retransmit would contain corrupt data.”
- Only v1; committed as submitted.
- No NAK, no stable nomination, no reviewer risk flags.
- Included in “[GIT PULL FOR v7.3] media: CEC fixes/improvements”.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record: To linux-media; Cc Thierry Reding and linux-tegra. Reviewed-by Mikko Perttunen (NVIDIA). Right maintainers.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: No syzbot/bugzilla. Author-discovered HW bug, confirmed by NVIDIA review. No user-count in the thread.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: 1/2 of 2. 2/2 is an enhancement (Rx low-drive debugfs), not required. Do not pull 2/2 as a dependency.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: No stable-list discussion found for this NACK workaround. linux- media search for “tegra_cec stable” did not hit this patch.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: tegra_cec_adap_enable()
Step 5.2: TRACE CALLERS
Record: Wired as cec_adap_ops.adap_enable. Called from cec_adap_enable() in drivers/media/cec/core/cec-adap.c (open/configure /dev/cecX, logical-address setup, enable/disable). Userspace-reachable on Tegra HDMI.
Step 5.3: TRACE CALLEES
Record: cec_write() → writel() of TEGRA_CEC_HW_CONTROL. No alloc, no new locks.
Step 5.4: FOLLOW THE CALL CHAIN
Record: userspace CEC ioctl/open → CEC core cec_adap_enable() → tegra_cec_adap_enable(). Transmit path tegra_cec_adap_transmit() fills TX FIFO; NACK is handled in tegra_cec_irq_handler(). Unprivileged users with /dev/cecX can trigger TX, including NACK+retry.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: TX_NAK_MODE is only used in this driver. No sibling-driver copy of this workaround.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: Yes. Tree is v7.3-rc4. File drivers/media/cec/platform/tegra/tegra_cec.c and header bit TEGRA_CEC_HWCTRL_TX_NAK_MODE are present. Pre-fix enable path wrote only TX_RX_MODE (blame to 2017). Bug introduced in v4.15-era driver, long before this branch.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: Clean apply. Context in the candidate is the INT_MASK block without later RX_BUS_ERROR_DETECTED (that line is from 2/2). Against this tree the hunk is already the intended enable write. No data- structure or API change.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: No earlier alternate fix for NACK-abort corruption. This is the first use of TX_NAK_MODE in C code.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: [drivers/media/cec/platform/tegra] [PERIPHERAL / platform driver, but real Tegra HDMI product path]. CONFIG_CEC_TEGRA, depends on ARCH_TEGRA.
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: Mature. Driver since 2017; low churn. This is an old HW bug, not new-code churn.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: Tegra HDMI-CEC users (Jetson and other Tegra boards with CEC). Config- and platform-specific, not universal.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Transmit a message that is NACKed, then retry. Common for POLL during logical-address allocation (1 byte; author says that case is cheap). Multi-byte NACK+retry is less common but real (absent follower, follower busy). Userspace with CEC device access can trigger it.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record: [Corrupt CEC frame on retry] [MEDIUM functionally, HIGH for that hardware’s CEC reliability]. Not a kernel oops. Puts garbage on the CEC bus, which can break TV/AVR control after a NACK. That is user-visible protocol corruption.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- Benefit: high for Tegra CEC — stops corrupt retries on a long-standing silicon bug.
- Risk: very low — one register bit, NVIDIA Reviewed-by, CEC maintainer authored it.
- Ratio: strongly favors applying the workaround.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Real Tegra CEC hardware bug: NACK abort → corrupt retransmit
- Hardware quirk/workaround (stable exception)
- Tiny: +12/-1, one bit OR
- Bit defined since original 2017 driver; no new API
- Authored by CEC/Tegra-CEC maintainer; Reviewed-by NVIDIA
- Standalone; 2/2 of the series is unrelated debug
- Applies to this tree: driver and define exist
- IRQ path still reports NACK correctly
AGAINST:
- Not a kernel crash, UAF, or security bug
- Tegra-only
- Slightly longer bus occupancy after NACK (documented, accepted)
- No Fixes:/Cc: stable (not a negative here)
- No public multi-user bugzilla/syzbot report
UNRESOLVED:
- lore.kernel.org WebFetch returned 403; thread recovered via b4 dig -m and gnuweeb/ratatoskr mirrors
- No stable@ discussion found
- HW “internal state not reset” is the author’s suspicion; NVIDIA did not contradict it
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? PASS — one documented HW bit; NVIDIA Reviewed-by
2. Fixes a real bug that affects users? PASS — corrupt CEC retries after NACK
3. Important issue? PASS as hardware workaround / protocol corruption on HDMI-CEC, not as a kernel panic
4. Small and contained? PASS — 13-line hunk, one function
5. No new features or APIs? PASS — enables an existing unused control bit
6. Can apply to the local tree? PASS — file, function, and TEGRA_CEC_HWCTRL_TX_NAK_MODE are here
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: Hardware quirk/workaround. Qualifies even without a panic.
Step 9.4: MAKE YOUR DECISION
This is a small, reviewed workaround for a real Tegra CEC silicon bug that corrupts the next transmit after a NACK abort. The driver and register bit exist in this v7.3-rc4 tree and have since v4.15. Risk is a single enable-time bit. That meets stable rules via the hardware-quirk exception.
What it solves for users of this tree: Tegra HDMI-CEC retries after NACK can put corrupt bytes on the bus; setting TX_NAK_MODE avoids the abort path that triggers that bug.
Risk vs benefit: one-bit enable flag, NVIDIA-reviewed, vs broken CEC after NACK. Benefit wins.
===============================================================
Verification:
- [Phase 1] Parsed be627f257ce283c95fd2988080dc0db3a20d0d2a: no Fixes/Reported-by/Cc:stable; SOB Hans Verkuil + Mauro; Reviewed-by Mikko Perttunen
- [Phase 1] Cover letter (mbox): “works around a HW bug” / corrupt retransmit after NACK
- [Phase 2] Diff: tegra_cec_adap_enable() OR TEGRA_CEC_HWCTRL_TX_NAK_MODE into HW_CONTROL (+12/-1)
- [Phase 2] Confirmed RMW of HW_CONTROL in tegra_cec_adap_log_addr, tegra_cec_adap_monitor_all_enable, tegra_cec_error_recovery preserves the bit
- [Phase 2] IRQ still sets CEC_TX_STATUS_NACK on TX_FRAME_TRANSMITTED + TX_FRAME_OR_BLOCK_NAKD
- [Phase 3] git blame parent: HW_CONTROL write from 9d2d60687c9a (v4.15-rc1); TX_NAK_MODE in original header
- [Phase 3] git merge-base --is-ancestor 9d2d60687c9a HEAD: yes
- [Phase 3] No Fixes: tag; follow-up bce7236c16c2c is debug-only, not a prereq
- [Phase 4] b4 dig -c: https://patch.msgid.link/7e50d6027e1676650d52905c
[email protected]
- [Phase 4] b4 dig -a: v1 only
- [Phase 4] b4 dig -w: linux-media, linux-tegra, Thierry Reding
- [Phase 4] b4 dig -m: NVIDIA Reviewed-by; no NAK; no Cc:stable in thread
- [Phase 4] lore.kernel.org WebFetch: 403; used mbox + gnuweeb/ratatoskr instead
- [Phase 5] Callers: cec-adap.c cec_adap_enable() → ops->adap_enable; userspace /dev/cecX
- [Phase 5] grep TX_NAK_MODE: only tegra_cec.c/.h
- [Phase 6] git describe HEAD: v7.3-rc4-27-gf0100363d8c37; make kernelversion 7.3.0-rc4
- [Phase 6] Header bit present; enable function present; clean single- hunk change
- [Phase 7] MAINTAINERS: Hans Verkuil maintains ARM/TEGRA HDMI CEC and CEC FRAMEWORK
- [Phase 8] Failure mode: corrupt CEC retry after NACK, not oops; severity MEDIUM/HIGH for that hardware
- UNVERIFIED: no TRM quote confirming “internal state not reset”; author suspicion only, not used as the sole reason
**YES**
drivers/media/cec/platform/tegra/tegra_cec.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/media/cec/platform/tegra/tegra_cec.c +12 -1
@@ -243,7 +243,18 @@ static int tegra_cec_adap_enable(struct cec_adapter *adap, bool enable)TEGRA_CEC_INT_MASK_RX_REGISTER_FULL | TEGRA_CEC_INT_MASK_RX_START_BIT_DETECTED); -cec_write (cec,TEGRA_CEC_HW_CONTROL ,TEGRA_CEC_HWCTRL_TX_RX_MODE ); +/* +* TX_NAK_MODE ensures that the whole message is transmitted even +* if each byte is NACKed. Without this flag the retransmit of the +* messages after a NACK can be corrupt. This is a bug in the hardware. +* +* While less efficient, in practice you rarely transmit messages +* that can be NACKed, with the exception of POLL messages which +* are just one byte anyway. +*/ +cec_write (cec,TEGRA_CEC_HW_CONTROL , +TEGRA_CEC_HWCTRL_TX_RX_MODE | +TEGRA_CEC_HWCTRL_TX_NAK_MODE );return 0 ; }
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 drm/amd/pm: Use uploaded size for legacy custom PPTable
In reply to Sasha LevinFrom: Yang Wang <[email protected]>
[ Upstream commit 055a40c32f3a2dcd4d1a6f85ff4c231cf35f1b53 ]
The legacy powerplay path used to allocate hardcode_pp_table from the original VBIOS PPTable size, copy only the uploaded bytes into it, and keep soft_pp_table_size unchanged. If a custom PPTable is shorter than the original table, later code can still treat the stale tail as valid table data.
Treat the uploaded buffer as the complete custom PPTable: duplicate the uploaded buffer directly, replace hardcode_pp_table atomically, and set soft_pp_table_size to the uploaded size.
---
LLM Generated explanations, may be completely bogus:
## PHASE 1: COMMIT MESSAGE FORENSICS
**Step 1.1: PARSE THE SUBJECT LINE**
Record: [drm/amd/pm] [Use] Use uploaded size for legacy custom PPTable
Subsystem: AMDGPU PowerPlay (legacy hwmgr path). Verb “Use” describes the corrected size source; the body is a correctness fix for stale table tails.
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- Signed-off-by: Yang Wang <[email protected]> (author)
- Reviewed-by: Hawking Zhang <[email protected]> (AMD)
- Signed-off-by: Alex Deucher <[email protected]> (amdgpu maintainer)
- No Fixes:, Reported-by:, Tested-by:, Link:, or Cc: stable on the upstream commit (absence expected)
- Pipeline-only markers ignored: [Upstream commit 055a40c32f3a2…], Signed-off-by: Sasha Levin
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- **Bug:** pp_dpm_set_pp_table() allocated hardcode_pp_table at the original VBIOS PPTable size, memcpy’d only the uploaded bytes, and left soft_pp_table_size unchanged.
- **Symptom:** A shorter custom table leaves a stale VBIOS tail; later parsing still treats that tail as valid table data. pp_dpm_get_pp_table() also reports the old size.
- **Root cause:** Upload size is not treated as the complete custom table.
- **Fix:** kmemdup(buf, size), atomically replace hardcode_pp_table, set soft_pp_table_size = size.
- No stack traces, syzbot, or version range in the message.
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: Not a disguised cleanup. It is an explicit correctness/memory- safety fix for mixed VBIOS+custom table contents. Also aligns the legacy path with SWSMU’s smu_sys_set_pp_table().
## PHASE 2: DIFF ANALYSIS
**Step 2.1: INVENTORY THE CHANGES**
Record:
- File: drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c (+8 / −13)
- Function: pp_dpm_set_pp_table() only
- Scope: single-file surgical fix
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record: **Before** (this tree at v6.18.53 / parent of the candidate):
```
if (!hwmgr || !hwmgr->pm_en) return -EINVAL;
if (size > hwmgr->soft_pp_table_size) return -EINVAL;
if (!hardcode_pp_table)
hardcode_pp_table = kmemdup(soft_pp_table, soft_pp_table_size, ...);
memcpy(hardcode_pp_table, buf, size);
soft_pp_table = hardcode_pp_table;
// soft_pp_table_size unchanged
amd_powerplay_reset();
```
**After:**
```
if (!hwmgr || !hwmgr->pm_en || !buf || !size || size > U32_MAX) return
-EINVAL;
hardcode_pp_table = kmemdup(buf, size, GFP_KERNEL);
kfree(old); assign new;
soft_pp_table = hardcode_pp_table;
soft_pp_table_size = size;
amd_powerplay_reset();
```Path: privileged sysfs store to pp_table, then DPM re-init. Not boot- default.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record: **Logic/correctness + memory-safety (stale buffer / wrong length).**
Broken: partial overwrite of a VBIOS-sized copy; parsers and pp_table_has_space() / *_pp_table_has_space() use soft_pp_table_size as the valid span.
Fix: the uploaded buffer *is* the table; size matches allocation. Removes the overflow memcpy by allocating exactly size (supersedes the in-tree size > soft_pp_table_size cap). Adds !buf, !size, size > U32_MAX (soft_pp_table_size is uint32_t).
**Step 2.4: ASSESS THE FIX QUALITY**
Record: Minimal and matches SWSMU. kfree + replace is serialized by adev->pm.mutex in amdgpu_dpm_set_pp_table(). kfree(NULL) is safe on first upload. Destroy path already kfrees hardcode_pp_table. Regression risk: low on the common (no custom table) path. Larger-than- VBIOS uploads are now allowed up to sysfs PAGE_SIZE; parsers that trust header offsets still need the later bounds patches. Truncated/malformed headers could already OOB in v6.18.53 without those checks.
## PHASE 3: GIT HISTORY INVESTIGATION
**Step 3.1: BLAME THE CHANGED LINES**
Record:
- Function added f3898ea12fc1f (2016-02, “add some sysfs interfaces for powerplay”)
- Upload/reset/memcpy: 4dcf9e6f2e33fe (2016-07, “add uploading pptable and resetting powerplay support”)
- kmemdup of VBIOS-sized original: efdf7a93195a71 (2016-09)
- Overflow cap: 3334985f8b4c7 / upstream f193e71fa9fab (“bound pp_dpm_set_pp_table() memcpy”) — **already in v6.18.53**
Bug is long-standing; this tree still has the stale-tail behavior.
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. Introduced with PowerPlay sysfs upload in 2016. Present in this 6.18.y tree.
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record: Related in this tree:
- 3334985f8b4c7 — overflow bound (in v6.18.53)
- 3149b1bee4fa1 — series 1/5, SWSMU header check (not in v6.18.53; different file)
- Later descendants: f29e53bc54611, 10510a4c2c397, c80131588ca2f (series 3–5 bounds; **not** in v6.18.53)
- 8c685df5c3b26 — get-path UAF, different files
This patch is **2/5** of Yang Wang’s June 2026 series. It is standalone (legacy amd_powerplay.c only). 3–5 use soft_pp_table_size as the bound, so they want this size to match custom uploads.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record: Yang Wang is an AMD pm contributor with several PPTable bounds/UAF fixes. Hawking Zhang reviewed; Alex Deucher signed off.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
Record: No missing helpers: kmemdup, U32_MAX, hardcode_pp_table, amd_powerplay_reset() all exist in v6.18.53. Does **not** depend on 1/5. Parent blob already has the overflow if (size > soft_pp_table_size) that this diff removes — clean apply on this tree.
## PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- b4 dig -c 055a40c32f3a2dcd4d1a6f85ff4c231cf35f1b53 → https://patch.m
sgid.link/[email protected]
- Series v1 only (no v2/v3)
- [PATCH 2/5] drm/amd/pm: Use uploaded size for legacy custom PPTable
- **1/5** SWSMU header + atomic kmemdup
- **2/5** this commit
- **3/5** Tonga state-array bounds
- **4/5** Vega hwmgr bounds
- **5/5** legacy processpptables.c offset bounds (pp_table_has_space)
- lore.kernel.org HTTP 403; discussion taken from b4 dig -m mbox (verified)
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record (b4 dig -w): To/Cc [email protected], Alex Deucher, Hawking Zhang, Kenneth Feng. Hawking: “Series is Reviewed-by:
Hawking Zhang”. No NAKs in the saved thread.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No Reported-by / bugzilla / syzbot. Bug is described from code review.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: 2/5 does not need 1/5. 3–5 are follow-on parser hardening that treat soft_pp_table_size as the valid span; they are stronger with 2/5 but VBIOS parsing still works without it.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: **UNVERIFIED** — lore.kernel.org/stable/ returned HTTP 403. No stable discussion in the amd-gfx mbox.
## PHASE 5: CODE SEMANTIC ANALYSIS
**Step 5.1: IDENTIFY KEY FUNCTIONS**
Record: pp_dpm_set_pp_table(); uses amd_powerplay_reset().
**Step 5.2: TRACE CALLERS**
Record:
- pp_dpm_funcs.set_pp_table → amdgpu_dpm_set_pp_table() (mutex_lock(&adev->pm.mutex)) → amdgpu_set_pp_table() sysfs store
- Attribute: AMDGPU_DEVICE_ATTR_RW(pp_table, …) → S_IRUGO | S_IWUSR (root write)
- HW: legacy PowerPlay (SI/CI/VI/Polaris/Vega via hwmgr), not Navi+ SWSMU (smu_sys_set_pp_table)
**Step 5.3: TRACE CALLEES**
Record: kmemdup, kfree, amd_powerplay_reset() → hwmgr_hw_fini / hwmgr_hw_init / hwmgr_handle_task(AMD_PP_TASK_COMPLETE_INIT), optional avfs_control(false).
**Step 5.4: FOLLOW THE CALL CHAIN**
Record: Userspace write() to /sys/class/drm/card*/device/pp_table (root). Then full PM re-init from the new table. Reachable, privileged, documented.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: SWSMU already kmemdup(buf, size) and sets power_play_table_size = size (series 1/5 / current smu_sys_set_pp_table()). This is the legacy equivalent.
## PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record: **Yes.** git describe HEAD = v6.18.53-5049-g0f0bdc2b0dffb; Makefile 6.18.53. v6.18.53:drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c still has VBIOS-sized kmemdup + partial memcpy + unchanged soft_pp_table_size (and the overflow cap). Introduced ~2016.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: **Clean apply.** Candidate diff is against the exact v6.18.53 function (including if (size > hwmgr->soft_pp_table_size)).
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: Overflow cap is in v6.18.53; it does **not** fix the short- table tail. No other in-tree substitute for updating soft_pp_table_size on upload.
## PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: drivers/gpu/drm/amd/pm/powerplay — **IMPORTANT** (amdgpu DPM on pre-Navi ASICs). Not core mm/vfs, but production GPU power/clocks.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Actively maintained (Alex Deucher). Legacy PowerPlay is mature; this is hardening of a 2016 sysfs API, not new feature work.
## PHASE 8: IMPACT AND RISK ASSESSMENT
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: Driver-specific: root users uploading custom PPTables on legacy PowerPlay AMD GPUs (Polaris/Vega/etc.). Not universal; the sysfs node is a documented interface.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: Write a custom table **shorter** than the VBIOS table. Common for truncated files or smaller community/AMD PPT blobs. Not boot. **Not** unprivileged (S_IWUSR).
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: Mixed custom prefix + stale VBIOS tail parsed as one table → wrong clocks/voltages/DPM (hangs, instability, possible overvoltage). get_pp_table returns too much mixed data. Defeats size-based parser bounds that key off soft_pp_table_size.
**Severity: HIGH** on that path (wrong PM programming / confused bounds), **MEDIUM** globally (privileged, non-default).
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- **Benefit:** Completes the overflow fix already in 6.18.53; custom tables are actually the bytes uploaded; readback size is right; later bounds checks can trust the size.
- **Risk:** Low — ~8 insertions, one function, mutex-held, same pattern as SWSMU. Idle GPUs that never write pp_table are unchanged.
- **Ratio:** Favorable.
## PHASE 9: FINAL SYNTHESIS
**Step 9.1: COMPILE THE EVIDENCE**
**FOR:**
- Real bug: stale VBIOS tail treated as valid PPTable after a short custom upload
- Can misprogram GPU power/clocks and break size-based parsing
- Small, obviously correct, matches SWSMU
- Overflow half already in this tree; this is the remaining hole
- AMD review (Hawking) + maintainer SOB (Deucher)
- Applies cleanly; no missing helpers
- Privileged but supported sysfs API
**AGAINST:**
- Not a default-boot crash; root-only
- No syzbot/CVE/user report in the message
- Part of a 5-patch series (2/5 still stands alone)
- Allows uploads larger than the original VBIOS size (capped in practice by sysfs PAGE_SIZE)
**UNRESOLVED:** Stable-list discussion (lore 403). No evidence this was rejected for stable.
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — SWSMU-equivalent; reviewed by AMD; in mainline
2. Fixes a real bug that affects users? **PASS** — documented pp_table upload
3. Important issue? **PASS** — wrong DPM table contents / bounds (HIGH on that path)
4. Small and contained? **PASS** — one function, net −5 lines
5. No new features or APIs? **PASS**
6. Can apply to the local tree? **PASS** — clean vs v6.18.53
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: None (not a device ID/quirk/DT/build/docs exception). Qualifies as a normal small bugfix.
**Step 9.4: DECISION**
This belongs on 6.18.y: the buggy upload path is here, the overflow cap is already here, and this is the matching fix so a custom PPTable is exactly the uploaded bytes and length.
### What the commit solves for this tree
On 6.18.53, pp_dpm_set_pp_table() still clones the VBIOS table, copies only the write, and keeps soft_pp_table_size. A shorter custom table leaves a stale tail that init/sysfs still treat as valid, so DPM can run on a hybrid table. The patch makes the upload the whole table, which is what the sysfs ABI documents.
### Risk vs benefit
Benefit is real for anyone using pp_table on legacy PowerPlay. Risk is a small, mutex-protected change with no effect unless that sysfs node is written.
---
Verification:
- [Phase 1] Tags: author Yang Wang; Reviewed-by Hawking Zhang; SOB Alex Deucher; no Fixes/Reported-by/Cc: stable on upstream 055a40c32f3a2
- [Phase 2] Diff: pp_dpm_set_pp_table() only; drop VBIOS-sized clone + partial memcpy; kmemdup(buf,size); set soft_pp_table_size; extra !buf/!size/U32_MAX checks
- [Phase 3] Blame: memcpy upload 4dcf9e6f2e33fe (2016); overflow cap 3334985f8b4c7 is in v6.18.53; this candidate is not
- [Phase 3] git merge-base --is-ancestor 055a40c32f3a2 HEAD → not in this history as that SHA (expected for a stable cherry-pick evaluation)
- [Phase 3] v6.18.53 file contents confirmed: bound-check + kmemdup(original) + memcpy(size) + no size update
- [Phase 4] b4 dig -c 055a40c32f3a2 → patch 2/5, msgid 20260623034151.263746-2; v1 only; Hawking reviewed the series
- [Phase 4] WebFetch lore/msgid 403; mbox via b4 dig -m used instead
- [Phase 4] Stable-list search 403 — UNVERIFIED
- [Phase 5] Callers: amdgpu_dpm_set_pp_table under adev->pm.mutex from sysfs pp_table (S_IWUSR)
- [Phase 5] SWSMU smu_sys_set_pp_table() already uses the same kmemdup
+ size update
- [Phase 6] git describe HEAD = v6.18.53-5049-g0f0bdc2b0dffb; make kernelversion 6.18.53; buggy code in this tree
- [Phase 6] Series 3–5 not in v6.18.53; this commit does not require them to apply
- [Phase 8] Failure mode: mixed PPTable → wrong GPU PM; trigger = root write of a shorter custom table
- UNVERIFIED: Whether anyone requested this on stable@ (lore 403)
**YES**
.../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +8 -13
@@ -663,25 +663,20 @@ static int amd_powerplay_reset(void *handle)static int pp_dpm_set_pp_table (void *handle,const char *buf,size_t size) {struct pp_hwmgr *hwmgr = handle; +void *hardcode_pp_table;int ret = -ENOMEM ; -if (!hwmgr || !hwmgr->pm_en) -return -EINVAL ; - -if (size > hwmgr->soft_pp_table_size) +if (!hwmgr || !hwmgr->pm_en || !buf || !size || size >U32_MAX )return -EINVAL ; -if (!hwmgr->hardcode_pp_table) { - hwmgr->hardcode_pp_table =kmemdup (hwmgr->soft_pp_table, - hwmgr->soft_pp_table_size, -GFP_KERNEL ); -if (!hwmgr->hardcode_pp_table) -return ret; - } - -memcpy (hwmgr->hardcode_pp_table, buf, size); + hardcode_pp_table =kmemdup (buf, size,GFP_KERNEL ); +if (!hardcode_pp_table) +return ret; +kfree (hwmgr->hardcode_pp_table); + hwmgr->hardcode_pp_table = hardcode_pp_table; hwmgr->soft_pp_table = hwmgr->hardcode_pp_table; + hwmgr->soft_pp_table_size = size; ret =amd_powerplay_reset (handle);if (ret)
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 virtio_ring: fix infinite loop in virtnet_poll_cleantx when device is broken
In reply to Sasha LevinFrom: Jinqian Yang <[email protected]>
[ Upstream commit 0d0eff39ceb3dcbf7847a6f4517086c207c60081 ]
virtnet_poll_cleantx() contains a do-while loop that cleans up transmitted TX buffers and calls virtqueue_enable_cb_delayed() to check whether more buffers need processing. When the virtio backend stops responding during guest reboot, used->idx is never updated, so virtqueue_enable_cb_delayed() always returns false and the loop never terminates. Then it will block reboot process, and the guest will hang.
The problem occurs during guest reboot under network traffic:
1. kernel_restart() -> device_shutdown() traverses the device list
2. virtio_dev_shutdown() calls virtio_break_device() which sets
vq->broken = true
3. virtio_dev_shutdown() then calls virtio_synchronize_cbs() to wait
for in-flight callbacks to complete
4. A virtio interrupt fires, softirq is deferred to ksoftirqd which
calls net_rx_action() -> virtnet_poll() -> virtnet_poll_cleantx()
5. virtnet_poll_cleantx() enters the do-while loop and never exits
because the QEMU backend has stopped updating used->idx, despite
vq->broken having been set to true in step 2.Since the loop runs inside ksoftirqd (a SCHED_OTHER kthread), it is visible to the scheduler and does not trigger a hard lockup. However, the kthread never leaves the loop, so RCU detects it as a CPU stall and reports it periodically. Meanwhile, the reboot process remains blocked in device_shutdown() because virtio_dev_shutdown() cannot complete its synchronization step, and the guest hangs permanently.
This can be reproduced on a guest with a virtio-net device: run iperf3 traffic in the guest, then trigger reboot. The reboot occasionally hangs permanently with RCU stall on ksoftirqd.
Observed on ARM64 KVM guest:
CPU#1 RCU stall (ksoftirqd/1), repeated periodically:
virtqueue_enable_cb_delayed_split <- virtnet_poll <- __napi_poll <- net_rx_action <- handle_softirqs <- run_ksoftirqd <- smpboot_thread_fn <- kthread
Fix by adding a vq->broken check in virtqueue_enable_cb_delayed(), so that the loop exits immediately when the device is broken, allowing the device shutdown to proceed.
Message-ID: <[email protected]>
---
LLM Generated explanations, may be completely bogus:
I have the local-tree picture: the cleanup loop is here, virtio_dev_shutdown() is not, and the missing vq->broken check is still a hang. Next I’ll write the full nine-phase verdict from that evidence.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
Record: [virtio_ring] [fix] [stop infinite loop in virtnet_poll_cleantx when the virtqueue is marked broken]
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record:
- Signed-off-by: Jinqian Yang <[email protected]> (author)
- Reviewed-by: Xuan Zhuo <[email protected]> (virtio co- maintainer)
- Signed-off-by: Michael S. Tsirkin <[email protected]> (virtio maintainer)
- Message-ID: <[email protected]>
- No Fixes: tag (expected)
- No Cc: stable (expected)
- No Reported-by / Tested-by / syzbot / Link: tags in the provided message
- Ignore pipeline markers (none present in the provided text besides normal maintainer SOBs)
Notable: maintainer + co-maintainer sign-off; author describes a real reproduced hang, not a theoretical cleanup.
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- Bug: virtnet_poll_cleantx() do-while loops on virtqueue_enable_cb_delayed() returning false. If the backend never advances used->idx, the loop never ends.
- Symptom: guest reboot hang under virtio-net traffic; RCU stalls on ksoftirqd (virtqueue_enable_cb_delayed_split <- virtnet_poll <- net_rx_action <- run_ksoftirqd); device_shutdown() blocked in virtio_synchronize_cbs().
- Trigger described: kernel_restart() → device_shutdown() → virtio_dev_shutdown() sets vq->broken then waits for callbacks; a deferred NAPI poll then spins forever.
- Root cause: virtqueue_enable_cb_delayed() keeps polling used->idx even after vq->broken is true.
- Reproduction: iperf3 + reboot on ARM64 KVM guest; occasional permanent hang.
- Version info in the message: none named; the reboot path names virtio_dev_shutdown().
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: Not a hidden fix. Subject and body are an explicit hang/infinite-loop fix. Not cleanup, refactor, or a feature.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
Record:
- File: drivers/virtio/virtio_ring.c only
- Scope: +8 lines (comment + if (unlikely(vq->broken)) return true;)
- Function: virtqueue_enable_cb_delayed()
- Classification: single-file surgical fix
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record:
- Before: convert _vq to vring_virtqueue, optionally clear event_triggered, then call split/packed enable_cb_delayed, which looks at used->idx / packed used descriptors and returns false if “many pending buffers” remain.
- After: if vq->broken, return true immediately so callers of the form while (!virtqueue_enable_cb_delayed()) exit.
- Path affected: any enable-cb-delayed poll/cleanup loop after the device is marked broken. Not a new feature path.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record:
- Category: logic/correctness that produces an infinite loop / hang (also a missing “device broken” abort, same family as other virtqueue ops).
- Mechanism: virtqueue_enable_cb_delayed() did not honor vq->broken, unlike virtqueue_poll(), virtqueue_add_*(), virtqueue_get_buf_*(), and virtqueue_notify() in this tree. Callers treat a false return as “more work remains”; on a dead backend that is never true, so they spin.
- Fix: return true when broken, matching virtqueue_enable_cb() which already becomes true because virtqueue_poll() returns false when broken.
**Step 2.4: ASSESS THE FIX QUALITY**
Record:
- Obviously correct: one unlikely(vq->broken) check at the API boundary, same pattern as sibling helpers.
- Minimal: no unrelated edits.
- Regression risk: low. Returning true skips further used-ring polling and skips re-enabling callbacks. vring_interrupt() already refuses to invoke callbacks when broken (returns IRQ_HANDLED / IRQ_NONE without calling vq->callback). Leftover TX buffers are still collected later by free_unused_bufs() / virtqueue_detach_unused_buf() on teardown.
- Red flags: none (no API change, no new lock, no data-structure change).
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Record:
- virtqueue_enable_cb_delayed() wrapper: e6f633e5beab65 / 1ce9e6055fa0a9 (Tiwei Bie, 2018) — packed/split split-up; the function itself is older.
- The spinning loop in virtnet_poll_cleantx / start_xmit:
a7766ef18b3367 (“virtio_net: disable cb aggressively”, 2021-07-08). Present in this tree (git merge-base --is-ancestor exit 0).
- virtqueue_poll() already has if (unlikely(vq->broken)) return false; in this tree.
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: No Fixes: tag. The hang the author describes is the interaction of that 2021 loop with later reboot teardown, not a one-line typo in a single commit.
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record:
- Recent virtio_ring.c work here is KCSAN tagging, resize/reset args, premapped DMA — unrelated.
- This is standalone, not patch X/Y of a series in-tree.
- Mailing-list series is v1→v3 of the same fix (see Phase 4).
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record:
- Jinqian Yang has no other virtio_ring/virtio_net commits in this tree. Not the subsystem maintainer.
- Weight comes from Reviewed-by Xuan Zhuo and SOB Michael S. Tsirkin.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS** Record:
- The insertion does not use VIRTQUEUE_CALL (mainline) vs the 6.12 ternary packed/split call. The new code sits before that dispatch.
- No new helpers. Can apply standalone.
- The *reboot* scenario names virtio_dev_shutdown(), which is **not** in this tree (see Phase 6). The *code defect* does not depend on that function.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- b4 dig -c <message-id>: no matching commit object in this checkout (candidate is not on HEAD).
- b4 mbox for Message-ID [email protected]: lore returned 404.
- Fallback mirrors (verified):
- v3: https://lists.openwall.net/linux-kernel/2026/07/16/1135
- v1: https://lkml.iu.edu/2607.1/10830.html (changed virtio_net.c loop to also test virtqueue_is_broken())
- v2 changelog: moved the check into virtqueue_enable_cb_delayed()
- v3: subject prefix only (virtio_net: → virtio_ring:)
- Xuan Zhuo Reviewed-by on v3: https://lkml.rescloud.iu.edu/hypermail/
linux/kernel/2607.2/09380.html
- No NAK found. Applied version is v3 (latest).
- No reviewer “Cc: stable” found in the retrieved mail.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record: v3 To/Cc (from the v3 post): [email protected], [email protected], [email protected], [email protected], netdev maintainers; lists netdev, virtualization, linux-kernel. Appropriate virtio + netdev audience. Reviewed-by Xuan Zhuo; merged via MST.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: No syzbot/bugzilla. Author reports a reproduced ARM64 KVM guest hang (iperf3 + reboot). That is a real user-visible failure, but the reboot recipe uses virtio_dev_shutdown() (Phase 6).
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: Single-patch series, v1–v3. v1 only fixed the virtio_net loop; v2/v3 fixed the core helper so every looping caller is covered (start_xmit in this tree has the same pattern). No extra patches required.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: lore.kernel.org/stable fetch returned 403; web search of stable archives did not show this subject. UNVERIFIED: no evidence this was already requested or rejected for stable.
Related context (verified via git objects + public commit page):8bd2fa086a04 (“virtio: break and reset virtio devices on device_shutdown()”) added virtio_dev_shutdown(). git merge-base --is- ancestor 8bd2fa086a04 HEAD → not an ancestor. Same SHA **is** an ancestor of v6.15, not of v6.12.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF**
Record: virtqueue_enable_cb_delayed() (exported). Indirectly virtqueue_enable_cb_delayed_split() / _packed() are skipped when broken.
**Step 5.2: TRACE CALLERS**
Record (this tree, git grep):
- drivers/net/virtio_net.c:
- virtnet_poll_cleantx() — do-while until enable_cb_delayed is true (the hang)
- start_xmit() — same loop when napi-tx and !xmit_more
- TX-stop path (~1066/1068) — not a spin loop; false just schedules NAPI / frees old bufs
- tools/virtio/* test code only
No other in-tree driver loops on this helper.
Call context: NAPI/ksoftirqd (virtnet_poll → virtnet_poll_cleantx) and ndo_start_xmit. Userspace-reachable via normal virtio-net RX/TX.
**Step 5.3: TRACE CALLEES**
Record: to_vvq(), optional event_triggered clear, then split/packed enable which does START_USE, writes used-event idx, compares used->idx vs last_used_idx. No alloc; ring MMIO/memory only.
**Step 5.4: FOLLOW THE CALL CHAIN**
Record:
- virtnet_poll() (line 2892) always calls virtnet_poll_cleantx() then virtnet_receive().
- virtnet_poll is the RX NAPI poll; with napi-tx it also reaps TX.
- Reachable from virtio-net interrupts / NAPI. Yes, userspace traffic can keep this hot.
Broken-device entry points in **this** tree (not reboot shutdown):
- virtio_pci_remove(): if (!pci_device_is_present(pci_dev)) virtio_break_device(...) then unregister_virtio_device() (verified in drivers/virtio/virtio_pci_common.c).
- virtqueue_notify(): sets vq->broken if notify() fails.
- virtio_reset_device(): virtio_break_device + virtio_synchronize_cbs only under CONFIG_VIRTIO_HARDEN_NOTIFICATION, which depends on BROKEN here — not a production 6.12 config.
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: Same do-while in start_xmit(). Core virtqueue ops already abort on vq->broken. This helper was the inconsistent one. No second copy of the bug in other drivers in this tree.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?** Record:
- Tree: **6.12.111** (make kernelversion), branch pending-6.12, git describe p-6.12-3-gc504cf0baa3d8.
- virtqueue_enable_cb_delayed() at drivers/virtio/virtio_ring.c:2528 has **no** vq->broken check.
- virtnet_poll_cleantx() at drivers/net/virtio_net.c:2842-2845 still has:
do { virtqueue_disable_cb(); free_old_xmit(); } while (unlikely(!virtqueue_enable_cb_delayed(sq->vq)));
- virtio_bus has probe/remove only — **no** .shutdown, **no** virtio_dev_shutdown().
- Therefore: the **infinite loop** exists; the **reboot-via- virtio_dev_shutdown** trigger does **not**.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: Clean/minor. Mainline uses VIRTQUEUE_CALL(vq, enable_cb_delayed) after the event_triggered block; 6.12 uses a packed/split ternary. The new lines go immediately after to_vvq() and before event_triggered, which exists here (8d622d21d24803 / b730cb109633c). Expected apply: clean or trivial context.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: Comment “When the device is broken there is no point in polling used->idx” is absent. git log --grep='infinite loop in virtnet_poll_cleantx' on these files: empty. No earlier equivalent fix.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: virtio core (drivers/virtio/virtio_ring.c) used by virtio-net.
Criticality: **IMPORTANT** (default NIC in KVM/QEMU/cloud guests; not mm/core, but extremely common).
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: Active but mature. The looping TX cleanup dates to 2021; broken- bit handling is long-standing. This is a hole in an old contract, not a bug in brand-new 6.12-only code.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: virtio-net guests (and any other future/looping caller of virtqueue_enable_cb_delayed). Driver-specific, but a very large VM population.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record:
- Documented reboot hang: requires virtio_dev_shutdown() — **not in 6.12**.
- In this tree, hang requires (1) napi-tx cleanup loop running, (2) used->idx stuck, (3) vq->broken true so this patch can abort. Realistic 6.12 cases: virtio-pci surprise removal under traffic; notify failure / backend disconnect with NAPI still polling.
- Unprivileged guest userspace can generate the traffic; unplug/reboot/backend death is admin/hypervisor-side.
- Timing-dependent (NAPI already running when the queue is broken).
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: Infinite loop in ksoftirqd → RCU stalls; teardown paths that wait for NAPI (unregister_netdev / napi_disable) block forever.
Severity: **CRITICAL** (guest hang), when the trigger hits. Frequency:
uncommon (needs broken device + in-flight TX cleanup), but consequences are a stuck VM, not a warning.
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- Benefit: stops a hard hang in virtio-net TX cleanup once vq->broken is set. On 6.12 this is not the 6.15+ reboot path, but it is the same loop vs the same broken flag this kernel already sets on surprise removal and notify failure.
- Risk: very low (8 lines, existing pattern, unlikely fast path).
- Ratio: favorable.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
FOR backporting:
- Real hang: unbounded loop in NAPI/ksoftirqd when enable_cb_delayed never returns true.
- Loop and helper both exist in 6.12.111; fix is not already applied.
- vq->broken is the documented abort switch; this helper uniquely ignored it.
- Same semantics as virtqueue_enable_cb() via virtqueue_poll().
- 8-line, obviously correct, reviewed by Xuan Zhuo, merged by MST.
- virtio-net is the common VM NIC; hangs on unplug/backend death matter to stable users.
- Applies with no prerequisites.
AGAINST backporting:
- The author’s reboot/kexec story depends on virtio_dev_shutdown() from 8bd2fa086a04 (v6.15), which is **not** in this tree. That specific “reboot hangs in device_shutdown” bug was introduced after 6.12 branched.
- No Fixes:/Cc: stable (expected, not a negative).
- No second independent reporter, no syzbot.
- Surprise-removal/notify-fail hang is reasoned from call chains, not a 6.12-specific user report.
UNRESOLVED:
- Could not run b4 dig against a mainline SHA (commit not in this repo); lore.kernel.org 403/404 for some URLs.
- Stable list discussion: UNVERIFIED (403).
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — matches sibling broken checks; author reproduced; virtio maintainers reviewed/applied.
2. Fixes a real bug that affects users? **PASS** — infinite NAPI loop when the queue is broken; the loop exists here. The 6.15 reboot recipe does not, but 6.12 still marks queues broken and still runs this loop.
3. Important issue (crash, security, corruption, deadlock)? **PASS** — hang / RCU stall / teardown stuck. Severity CRITICAL when triggered.
4. Small and contained? **PASS** — 8 lines, one function.
5. No new features or APIs? **PASS**.
6. Can apply to the local tree? **PASS** — same function, same insertion point.
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: Not a device-ID/quirk/DT/build/docs exception. Ordinary hang fix.
**Step 9.4: MAKE YOUR DECISION**
This tree is 6.12.111. The reboot hang named in the commit message needs virtio_dev_shutdown(), which landed in 6.15 and is not here — that trigger alone would not justify a backport.
The patch still belongs on 6.12 because it does not fix that later function; it closes a hole in virtqueue_enable_cb_delayed() that 6.12 already has. virtnet_poll_cleantx() / start_xmit() will spin forever if used->idx stops moving, and they never look at vq->broken. This kernel already sets that flag (PCI surprise removal, failed notify). Returning true there is the same contract as virtqueue_poll() / virtqueue_enable_cb(), is eight lines, and cannot wait on new APIs.
Benefit is avoiding a virtio-net hang in a widely used guest NIC; regression risk is negligible.
Verification:
- [Phase 1] Parsed subject/tags/body: hang fix; Reviewed-by Xuan Zhuo; SOB MST; Message-ID 20260716115940.394832-1; no Fixes/syzbot
- [Phase 2] Diff: +8 lines in virtqueue_enable_cb_delayed(); return true if vq->broken
- [Phase 3] Blame: wrapper 2018 (e6f633e5beab65); poll_cleantx loop a7766ef18b3367 (2021), ancestor of HEAD
- [Phase 3] No Fixes: tag; no Jinqian Yang virtio history in this tree
- [Phase 4] b4 dig on Message-ID: no commit in this repo; b4 mbox: lore 404
- [Phase 4] v1 patched virtio_net loop; v2/v3 moved check to virtio_ring; Xuan Zhuo Reviewed-by on v3 (lkml.rescloud 09380)
- [Phase 4] 8bd2fa086a04 exists as object, NOT ancestor of HEAD; IS ancestor of v6.15; NOT of v6.12
- [Phase 4] UNVERIFIED: stable@ discussion (lore 403)
- [Phase 5] Callers: virtnet_poll_cleantx, start_xmit, TX-stop; poll_cleantx invoked from virtnet_poll line 2892
- [Phase 5] virtio_pci_remove surprise-removal calls virtio_break_device (line 758-759)
- [Phase 5] virtqueue_poll/add/get_buf/notify already check broken; enable_cb_delayed does not
- [Phase 5] CONFIG_VIRTIO_HARDEN_NOTIFICATION depends on BROKEN in this Kconfig
- [Phase 6] kernelversion 6.12.111; virtio_bus has no .shutdown; fix comment absent
- [Phase 6] Insertion point (after to_vvq, before event_triggered) present
- [Phase 8] Failure mode: infinite ksoftirqd loop / RCU stall / teardown hang
- UNVERIFIED: whether a 6.12 user has actually hit surprise-unplug hang (code path verified, field report not found)
**YES**
drivers/virtio/virtio_ring.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/virtio/virtio_ring.c +8 -0
@@ -2667,6 +2667,14 @@ bool virtqueue_enable_cb_delayed(struct virtqueue *_vq) {struct vring_virtqueue *vq =to_vvq (_vq); +/* +* When the device is broken there is no point in polling used->idx, +* the backend will never update it. Return true to let callers +* exit their cleanup loops instead of spinning forever. +*/ +if (unlikely (vq->broken)) +return true; +if (vq->event_triggered)data_race (vq->event_triggered = false);
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH AUTOSEL 6.18-5.15] virtio_ring: fix infinite loop in virtnet_poll_cleantx when device is broken
Sashiko has reviewed this patch and found no issues.
Quoted 13 lines
From: Jinqian Yang <[email protected]>
[ Upstream commit
0d0eff39ceb3dcbf7847a6f4517086c207c60081]
virtnet_poll_cleantx()contains a do-while loop that cleans up transmitted TX buffers and callsvirtqueue_enable_cb_delayed()to check whether more buffers need processing. When the virtio backend stops responding during guest reboot,used->idxis never updated, sovirtqueue_enable_cb_delayed()always returns false and the loop never terminates. Then it will block reboot process, and the guest will hang.The problem occurs during guest reboot under network traffic:
Quoted 8 lines
1.
kernel_restart()->device_shutdown()traverses the device list
2.virtio_dev_shutdown()callsvirtio_break_device()which sets[ ... ]Signed-off-by Jinqian Yang <[email protected]>Reviewed-by Xuan Zhuo <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Message-ID: <[email protected]>
Signed-off-by Sasha Levin <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Sasha Levin
maintainerPATCH 1/1 soundwire: dmi-quirks: Disable ghost Realtek on Asus Expertbook
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 90af3209742db61a7f9d7d054a16165818cfc6d8 ]
The Asus Expertbook B9406CAA also has a Realtek device in the ACPI that doesn't exist in the physical hardware. This confuses the machine driver into attempting to create DAI links for the device. Add a quirk to remove this device.
---
LLM Generated explanations, may be completely bogus:
I have enough to decide: this is a DMI hardware quirk for a user- confirmed “no sound” failure, and the ghost_realtek machinery already exists in this 7.3 tree.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: [soundwire: dmi-quirks] [Disable] [DMI quirk to hide a ghost Realtek SoundWire device on Asus Expertbook B9406CAA]
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- Closes: https://github.com/thesofproject/linux/issues/5828 (user-filed SOF audio bug)
- Signed-off-by: Charles Keepax (author)
- Link: https://patch.msgid.link/20260630081132.3294488-1-
[email protected]
- Signed-off-by: Vinod Koul (SoundWire maintainer)
- No Fixes: tag (expected)
- No Cc: stable (expected)
- No Reported-by / Tested-by / Reviewed-by / Acked-by in the committed message
- Ignore pipeline SOBs: none present (no Sasha Levin marker)
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- Bug: ACPI lists a Realtek SoundWire device that is not physically present on Asus Expertbook B9406CAA.
- Symptom: the machine driver tries to create DAI links for that ghost device; audio probe fails (dummy output / no card).
- Version info in the GitHub issue (not the commit body): worked on 7.0, broken since 7.1 after function-topology matching.
- Root cause: firmware/ACPI advertises RT722 on link 3; function topology builds the card from ACPI, so the ghost device breaks card creation.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: Not a disguised cleanup. It is an explicit hardware quirk. The “add a table entry” form is the standard stable-acceptable quirk pattern.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- File: drivers/soundwire/dmi-quirks.c (+7 / −0)
- Function/data: adr_remap_quirk_table[] only (no new functions)
- Scope: single-file surgical DMI match addition
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- Before: B9406CAA did not match adr_remap_quirk_table, so ACPI _ADR 0x000330025d072201 (RT722 on link 3) stayed visible.
- After: DMI match ASUS + board B9406CAA uses existing ghost_realtek[], remapping that _ADR to 0.
- Path: SoundWire ACPI slave discovery (find_slave()), not a hot path or a new API.
Step 2.3: IDENTIFY THE BUG MECHANISM
Record: [Hardware workaround / DMI quirk]
Mechanism: ghost_realtek[] remaps 0x000330025d072201 → 0. find_slave() does if (!addr) return false;, so the ghost device is not registered and sof_sdw does not build DAI links for it.
Step 2.4: ASSESS THE FIX QUALITY
Record: Obviously correct and minimal. Same pattern as UX5406AA / Lenovo 83QK / 83SF. Regression risk is very low: only that DMI pair is affected; other machines are unchanged.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record: The new B9406CAA block is this commit (90af3209742db, 2026-06-30). ghost_realtek[] and the PTL comment come from 4dab2b904414f (“Disable ghost Realtek devices”, 2026-05-20, in v7.2). dmi-quirks.c itself dates to f6594cdfec4cd (v5.13).
Step 3.2: FOLLOW THE FIXES: TAG
Record: No Fixes: tag. The user-visible regression was function topology in 7.1 (e0fb794d67f86 / 45cf24da0a10 pair, present in v7.1). This commit does not revert those; it adds a device-specific ACPI workaround. git merge-base --is-ancestor e0fb794d67f86 v7.1 is true.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record: Same-file siblings: 4dab2b904414f (base table), then B9406CAA, then UX8407AA / GX651AR / GX651AX. Standalone: one extra DMI row. Prerequisite is only ghost_realtek[], which is in this tree.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Charles Keepax has 30 SoundWire commits here; he introduced ghost_realtek. Vinod Koul (maintainer) applied it. Pierre-Louis Bossart (reviewer in MAINTAINERS) was CCed.
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record: Depends on ghost_realtek[] (4dab2b904414f, in v7.2 and in this 7.3 tree) and on remap-to-zero skip in find_slave() (if (!addr) return false; in drivers/soundwire/slave.c). Both exist here. Applies standalone on this tree.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- b4 dig: https://patch.msgid.link/20260630081132.3294488-1-
[email protected]
- Series: v1 only (no v2/v3)
- Cover note: follow-up quirk after a previous one proved unnecessary
- Vinod Koul: “Applied, thanks!” → 90af3209742db
- No NAK, no review concerns, no Cc: stable in the thread
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record (b4 dig -w): To Vinod Koul; Cc Pierre-Louis Bossart, Bard Liao, linux-sound, linux-kernel, Cirrus patches. Maintainer applied it. No extra Reviewed-by on this follow-up (the base table had Reviewed-by:
Pierre-Louis Bossart).
Step 4.3: SEARCH FOR THE BUG REPORT
Record: GitHub thesofproject/linux#5828, closed.
- Reporter q66: no sound on ExpertBook B9406CAA since 7.1 (dummy output; snd_soc_register_card failed -517, later duplicate sysfs).
- Charles identified ACPI ghost: link 3 mfg_id 0x025d part_id 0x0722.
- Reporter confirmed DMI ASUS / B9406CAA and that this exact quirk restored sound (downstream Chimera Linux kernel).
- Charles: “Yeah that is the correct fix.”
- Separate later UCM/mute-LED discussion is unrelated to this quirk.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: Standalone 1/1. Same family as 4dab2b904414f and later laptop rows. No other patches required for this DMI entry.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: lore.kernel.org/stable WebFetch returned 403. UNVERIFIED whether it was discussed on stable@. On the GitHub issue, Charles said the original ghost-Realtek table should be forwarded to stable because 7.1 already had the topology switch. That is context, not a substitute for this patch’s own merit.
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: No function body changes. Data only: adr_remap_quirk_table[] using existing ghost_realtek[]. Consumer: sdw_dmi_override_adr().
Step 5.2: TRACE CALLERS
Record:
- sdw_dmi_override_adr() is bus->ops->override_adr for Intel (drivers/soundwire/intel_auxdevice.c).
- Called from find_slave() in drivers/soundwire/slave.c during ACPI enumeration.
- Context: device probe / SoundWire bus init, not IRQ.
Step 5.3: TRACE CALLEES
Record: dmi_first_match(), then table walk. If ADR matches, replace with remapped value (0 for ghost Realtek).
Step 5.4: FOLLOW THE CALL CHAIN
Record: Boot/probe of Intel SOF SoundWire (Panther Lake Expertbook). Userspace cannot trigger it except by using the laptop. Reachable on that hardware every boot. Confirmed by dmesg in the issue.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: Same ghost_realtek DMI rows for UX5406AA, 83QK, 83SF, later UX8407AA / GX651AR / GX651AX. Systematic ACPI ghost-device problem, not a one-off.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record: Yes. Local tree is v7.3-rc4 (7.3.0-rc4). ghost_realtek[] and remap-to-zero skip are present. Function topology on PTL (snd_soc_acpi_intel_no_function_topology in soc-acpi-intel-ptl- match.c) is present — that is what made the ghost ACPI entry fatal from 7.1. The B9406CAA row is already in this checkout at lines 189–195 of dmi-quirks.c (git merge-base --is-ancestor 90af3209742db HEAD succeeded). The bug class exists here; this tree already contains the fix because it is 7.3 mainline.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: Clean apply on this tree. Same table layout as the patch. No rework needed. (Would need ghost_realtek[] on a tree older than v7.2.)
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: Base table 4dab2b904414f is here. No alternate B9406CAA fix besides this row. Later extra laptops are independent.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: [SoundWire DMI quirks / Intel SOF audio] [IMPORTANT for affected laptops, PERIPHERAL globally]. Not core mm/net, but complete audio loss on a shipping Panther Lake laptop.
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: Active: multiple 2026 ghost-Realtek DMI additions. Maintainer- applied. Mature quirk file since v5.13.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: Driver/platform-specific: Asus Expertbook B9406CAA (DMI board name). CONFIG_SOUNDWIRE_INTEL + SOF PTL machine driver.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Every boot on that laptop once function topology is used (7.1+). Not a race. Not unprivileged-attack surface. Reporter reproduced on 7.1.1.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record: [No audio / card probe failure] [HIGH for that hardware]. Not a panic. User-visible: dummy output, deferred probe -517, or failed DAI/sysfs setup. Confirmed in issue 5828.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record: Benefit high for those users (restores sound). Risk very low:
7-line DMI entry, existing remap table, DMI-gated. Ratio strongly favors applying it on trees that already have ghost_realtek.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
FOR:
- Hardware quirk / DMI workaround — listed as a stable exception.
- Real user bug: complete audio failure; reporter tested this exact match.
- Maintainer applied; SOF issue closed with this approach.
- 7 lines, existing ghost_realtek[], no new API.
- ghost_realtek and remap-to-0 skip exist in this 7.3 tree.
- Same pattern as other accepted laptop rows.
AGAINST:
- Not a crash/UAF/security bug (audio probe failure).
- Affects one laptop model.
- No Fixes:/Cc: stable (expected for this review pipeline).
- This 7.3-rc4 checkout already contains the commit (mainline source, not a reason to reject on merit).
UNRESOLVED:
- lore.kernel.org WebFetch 403; stable@ discussion not independently confirmed beyond GitHub.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? PASS — same remap table; user confirmed on B9406CAA; maintainer applied.
2. Fixes a real bug that affects users? PASS — no sound since 7.1 on that Expertbook.
3. Important issue? PASS — HIGH: total audio loss, not a panic; still a serious hardware enablement/regression for that machine.
4. Small and contained? PASS — +7 lines, one file, one DMI entry.
5. No new features or APIs? PASS — table row only.
6. Can apply to the local tree? PASS — ghost_realtek and sdw_dmi_override_adr exist; patch matches current table form.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: Hardware quirk / DMI workaround for broken ACPI. Automatically qualifies.
Step 9.4: MAKE YOUR DECISION
This tree (v7.3-rc4) has the buggy ACPI path, function topology, and ghost_realtek. The change is a one-row DMI quirk that restores audio on a shipping laptop. That is exactly the stable-acceptable quirk class.
What it solves: ACPI advertises a non-existent RT722; sof_sdw then fails to build the card. The quirk remaps that _ADR to 0 so discovery skips it.
Risk vs benefit: benefit is restoring sound; risk is a DMI-gated no-op on every other machine.
No missing prerequisites on this tree.
Verification:
- [Phase 1] Tags: Closes GitHub 5828; SOB Charles Keepax + Vinod Koul; lore msgid link; no Fixes/Cc: stable
- [Phase 2] Diff: +7 lines in adr_remap_quirk_table matching ASUS/B9406CAA → ghost_realtek
- [Phase 2] ghost_realtek remaps 0x000330025d072201 → 0; find_slave() skips !addr
- [Phase 3] git describe HEAD → v7.3-rc4-27-gf0100363d8c37; make kernelversion → 7.3.0-rc4
- [Phase 3] git merge-base --is-ancestor 90af3209742db HEAD → already in this tree (7.3-rc1+)
- [Phase 3] 4dab2b904414f (ghost_realtek) is ancestor of v7.2 and of HEAD; not in v7.1
- [Phase 3] 90af3209742db is in v7.3-rc1, not in v7.2 / v7.2.7
- [Phase 3] Topology commits e0fb794d67f86 / 45cf24da0a10 are in v7.1 (issue’s regression window)
- [Phase 3] blame: B9406CAA block is 90af3209742db; table intro 4dab2b904414f
- [Phase 4] b4 dig: lore patch-id match, v1 only, Vinod “Applied, thanks!”
- [Phase 4] b4 dig -w: Vinod, Pierre-Louis Bossart, Bard Liao, linux- sound
- [Phase 4] GitHub 5828: reporter confirmed quirk; Charles: correct fix; dmesg shows ghost 0x025d:0x0722 on link 3
- [Phase 4] lore.kernel.org WebFetch 403 — stable@ search UNVERIFIED
- [Phase 5] callers: intel_auxdevice .override_adr → find_slave() ACPI enum
- [Phase 6] local dmi-quirks.c already has B9406CAA and ghost_realtek
- [Phase 7] SOUNDWIRE maintainers Vinod Koul / Bard Liao; reviewer Pierre-Louis Bossart
- [Phase 8] Failure: no audio on one Asus PTL laptop; severity HIGH; risk very low
- UNVERIFIED: stable@ mailing list archive contents (HTTP 403)
This is a hardware quirk for a real, user-confirmed audio failure. It is small, already the established ghost_realtek pattern, and the supporting code is in this tree.
**YES**
drivers/soundwire/dmi-quirks.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/soundwire/dmi-quirks.c +7 -0
@@ -178,6 +178,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = { .driver_data = (void *)hp_omen_16, },/* PTL devices */ + { + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUS" ), + DMI_MATCH(DMI_BOARD_NAME, "B9406CAA"), + }, + .driver_data = (void *)ghost_realtek, + }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 ALSA: hda/realtek: Fix ALC700 audio on Intel Hades Canyon
In reply to Sasha LevinFrom: Csaba Budai <[email protected]>
[ Upstream commit 1fcccdc20a76b4639b00124cf2a379b837bd2bf7 ]
On Intel Hades Canyon systems with an ALC700 codec, analog audio can become unusable after rebooting from Windows into Linux.
The affected system uses codec subsystem ID 8086:2073. In the broken state, Realtek coefficient 0x1b has value 0x4a4b. Setting bit 0x0400 changes it to 0x4e4b and immediately restores normal analog playback.
The BIOS also sets this bit after disabling and re-enabling onboard audio, while Windows may leave it cleared. Linux currently does not restore it during codec initialization.
Add a machine-specific fixup for Intel Hades Canyon which sets only bit 0x0400 of coefficient 0x1b during HDA_FIXUP_ACT_INIT.
The fix has been verified across Windows -> Linux reboots on an Intel NUC8i7HNB with an ALC700 codec.
---
LLM Generated explanations, may be completely bogus:
Connection lost, reconnecting to https://agentn.us.api5.cursor.sh
(attempt 1)...
Retry attempt 1...
This is a machine-specific ALSA Realtek quirk for Intel Hades Canyon. The local tree is **6.12.111**; the same Realtek tables exist here, just in sound/pci/hda/patch_realtek.c instead of later alc269.c.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
Step 1.1: PARSE THE SUBJECT LINE
Record: **[ALSA: hda/realtek]** **[Fix]** **ALC700 analog audio unusable on Intel Hades Canyon after Windows reboot**
Step 1.2: PARSE ALL COMMIT MESSAGE TAGS
Record:
- **Signed-off-by:** Csaba Budai \<[email protected]\> (author)
- **Link:**
https://patch.msgid.link/[email protected]
- **Signed-off-by:** Takashi Iwai \<[email protected]\> (ALSA maintainer, applied the patch)
- **No Fixes:** tag (expected)
- **No Cc: stable** (expected)
- **No Reported-by / Tested-by / Reviewed-by / Acked-by**
- Author states the fix was verified on an Intel NUC8i7HNB (in the body, not a Tested-by tag)
- Ignore any pipeline-added Sasha Levin SOB / Upstream-commit markers if present
Step 1.3: ANALYZE THE COMMIT BODY TEXT
Record:
- **Bug:** On Intel Hades Canyon (codec SSID **8086:2073**, ALC700), analog audio can become unusable after rebooting from Windows into Linux.
- **Symptom:** Analog playback does not work until a BIOS-level audio disable/enable or until coef 0x1b bit 0x0400 is set.
- **Root cause:** Windows may leave Realtek coefficient 0x1b as **0x4a4b** (bit 0x0400 clear). BIOS sets that bit (value becomes **0x4e4b**). Linux never restores it at codec init.
- **Fix:** Machine-specific HDA fixup that sets only bit 0x0400 of coef 0x1b at HDA_FIXUP_ACT_INIT.
- **Version info:** None in the message. Hardware is the 2018 Intel NUC8i7HNB; ALC700 support has been in-tree since 2016.
Step 1.4: DETECT HIDDEN BUG FIXES
Record: **Not a hidden fix.** The subject and body are an explicit hardware-quirk bug fix. It is not cleanup, refactoring, or a new feature.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
Step 2.1: INVENTORY THE CHANGES
Record:
- **File (upstream):** sound/hda/codecs/realtek/alc269.c (**+20 / -0**)
- **Functions/tables:**
1. Enum: add ALC700_FIXUP_INTEL_HADES_CANYON
2. New alc700_fixup_intel_hades_canyon()
3. alc269_fixups[] entry (HDA_FIXUP_FUNC)
4. alc269_fixup_tbl[] PCI quirk SND_PCI_QUIRK(0x8086, 0x2073, ...)
- **Scope:** Single-file surgical hardware quirk. No API, no data- structure, no locking changes.
Step 2.2: UNDERSTAND THE CODE FLOW CHANGE
Record:
- **Before:** SSID 8086:2073 has no match in alc269_fixup_tbl. patch_alc269() still probes ALC700 (0x10ec0700) but never restores coef 0x1b bit 0x0400. After a Windows boot that left the bit clear, analog playback stays broken across Linux boot.
- **After:** snd_hda_pick_fixup() matches 8086:2073. During alc_init() → snd_hda_apply_fixup(..., HDA_FIXUP_ACT_INIT), the new function does alc_update_coef_idx(codec, 0x1b, 0x0400, 0x0400), which is (val & ~0x0400) | 0x0400 — set one bit, leave the rest.
- **Path:** Codec init (probe and resume), not an error path. Gated to this SSID only.
Step 2.3: IDENTIFY THE BUG MECHANISM
Record:
- **Category:** Hardware quirk / logic correctness (missing codec-init restore of a vendor coefficient).
- **Mechanism:** Windows leaves a vendor bit cleared; Linux did not put it back. The fix is the standard Realtek INIT coef update used by many existing fixups (e.g. alc269vb_fixup_aspire_e1_coef).
Step 2.4: ASSESS THE FIX QUALITY
Record:
- **Quality:** Obviously correct and matches existing INIT-coef fixups. Mask/set of a single bit is the intended alc_update_coef_idx usage (verified in __alc_update_coefex_idx: (val & ~mask) | bits_set).
- **Regression risk:** Very low. Only SSID 8086:2073 is changed. Other machines are untouched. Worst case on this SKU is a wrong vendor bit; author and BIOS both indicate that bit should be set.
- **No public API / no locking / no refcount changes.**
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
Step 3.1: BLAME THE CHANGED LINES
Record:
- Surrounding enum: ALC700_FIXUP_INTEL_REFERENCE from **b84e843644f211** (PeiSen Hou, 2017-09-01).
- Neighboring NUC 8 quirk 8086:2074 from **d1ee66c5d3c5a0** (2021, "fix mic boost on Intel NUC 8") — already in this tree.
- ALC700 codec ID HDA_CODEC_ENTRY(0x10ec0700, "ALC700", patch_alc269) from **6fbae35a3170c** (2016-05-30).
- The “buggy” state is missing a quirk that was never present; the codec path has existed since **v4.8-era / 2016**.
Step 3.2: FOLLOW THE FIXES: TAG
Record: **No Fixes: tag.** Not applicable. This is a missing machine quirk, not a regression from a specific earlier commit.
Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES
Record:
- This tree already carries many Realtek Add quirk backports in patch_realtek.c.
- Related ALC700 history in-tree: 6fbae35a3170c (add ALC700), 2d7fe6185722b (ALC700 no-sound), b84e843644f21 (ALC700 jack detect).
- Upstream file split **aeeb85f26c3bb** (“ALSA: hda: Split Realtek HD- audio codec driver”, 2025-07-11) is **not** an ancestor of this 6.12 tree — that is why the path differs.
- **Standalone** patch (not X/Y). No later follow-up on origin/master targeting Hades Canyon / 8086:2073.
Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS
Record: Csaba Budai has this one ALSA commit on origin/master. Not the subsystem maintainer. **Takashi Iwai** (ALSA maintainer) applied it with “Applied now. Thanks.”
Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS
Record:
- Required pieces **are already here:** alc_update_coef_idx, HDA_FIXUP_ACT_INIT, alc269_fixups[], alc269_fixup_tbl[], ALC700_FIXUP_INTEL_REFERENCE, patch_alc269 for 0x10ec0700, alc_init() calling snd_hda_apply_fixup(..., HDA_FIXUP_ACT_INIT).
- **No functional prerequisites.** Only a path rewrite (alc269.c → patch_realtek.c). Insertion anchors exist: enum after ALC700_FIXUP_INTEL_REFERENCE, quirk table immediately before 0x8086, 0x2074. alc287_fixup_lenovo_yoga_book_9i() (the function above the new helper upstream) **does** exist in this tree.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION
Record:
- **b4 dig -c 1fcccdc20a76b:**
https://patch.msgid.link/[email protected]
- **b4 dig -a:** single **v1**, no later revisions.
- Maintainer reply (Takashi Iwai, 2026-08-23): **“Applied now. Thanks.”** No NAK, no requested changes, no stable discussion.
- Direct lore.kernel.org WebFetch returned **403**; thread recovered via b4 dig -m.
Step 4.2: CHECK WHO REVIEWED THE PATCH
Record (**b4 dig -w**): Csaba Budai, Jaroslav Kysela, Takashi Iwai, linux-sound@, linux-kernel@. Right maintainers were on To/Cc. Applied by Takashi.
Step 4.3: SEARCH FOR THE BUG REPORT
Record: No bugzilla/syzbot link. Evidence is the author’s dual-boot report plus BIOS/Windows coefficient comparison (0x4a4b vs 0x4e4b). Severity from the reporter: analog audio unusable until the bit is set.
Step 4.4: CHECK FOR RELATED PATCHES AND SERIES
Record: Standalone v1. No series companions. No later origin/master commits touching this SSID.
Step 4.5: CHECK STABLE MAILING LIST HISTORY
Record: lore.kernel.org/stable WebFetch returned **403**. No stable-list discussion recovered via b4. **UNVERIFIED:** whether anyone already requested this on stable@ (does not change the technical merit).
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
Step 5.1: IDENTIFY KEY FUNCTIONS IN THE DIFF
Record: New alc700_fixup_intel_hades_canyon(). Tables: enum, alc269_fixups[], alc269_fixup_tbl[]. Semcode MCP not available; identified from hunks and grep.
Step 5.2: TRACE CALLERS
Record:
- snd_hda_pick_fixup() in patch_alc269() (sound/pci/hda/patch_realtek.c ~12583) selects the quirk from PCI/codec SSID.
- alc_init() (spec->init / .init = alc_init) calls snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_INIT) (~954). That runs on codec init (probe and resume).
- Impact surface: **only** devices matching **8086:2073**.
Step 5.3: TRACE CALLEES
Record: alc_update_coef_idx → alc_update_coefex_idx (NID 0x20, mutex) → __alc_update_coefex_idx: read-modify-write vendor coef. Standard, already used throughout this file.
Step 5.4: FOLLOW THE CALL CHAIN
Record: Userspace does not need a special syscall. Booting Linux on this NUC (especially after Windows) enumerates HDA → patch_alc269 → INIT fixup. **Reachable from normal device use.** Dual-boot is a realistic trigger.
Step 5.5: SEARCH FOR SIMILAR PATTERNS
Record: Many INIT-time alc_update_coef_idx fixups already exist (alc269_fixup_hweq, alc269vb_fixup_aspire_e1_coef, alc269_fixup_stereo_dmic). Same pattern. No other 8086:2073 / Hades Canyon quirk in this tree.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?
Record:
- **Yes.** Local tree: **pending-6.12**, git describe **p-6.12-3-gc504cf0baa3d8**, make kernelversion **6.12.111**.
- ALC700 + patch_alc269 present since 6fbae35a3170c (in this tree).
- **No** ALC700_FIXUP_INTEL_HADES_CANYON and **no** SND_PCI_QUIRK(0x8086, 0x2073, ...).
- git merge-base --is-ancestor 1fcccdc20a76b HEAD → **not present**.
- Bug is a long-standing missing restore, not something introduced after 6.12 branched.
Step 6.2: CHECK FOR BACKPORT COMPLICATIONS
Record: **Minor path rewrite, otherwise clean.** Upstream file sound/hda/codecs/realtek/alc269.c is the post-2025 split; 6.12 still has sound/pci/hda/patch_realtek.c. All four hunks have matching context (enum order, ALC700_FIXUP_INTEL_REFERENCE verbs, 8086:2074 quirk). This is the same class of adjustment already used for other Realtek quirk backports in this tree.
Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE
Record: **No.** Grep found no Hades Canyon / 0x2073 / ALC700_FIXUP_INTEL_HADES_CANYON. Neighboring NUC 8 quirk (2074) is unrelated (mic boost on a different SKU).
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY
Record: **ALSA HD-audio / Realtek codec** (sound/pci/hda/). **IMPORTANT** for users of this hardware (common laptop/NUC audio stack), **PERIPHERAL** in the sense that only one SSID is affected. Not core mm/VFS.
Step 7.2: ASSESS SUBSYSTEM ACTIVITY
Record: Very active: this 6.12 tree already has a long stream of Realtek quirk backports. The pattern is mature and well-understood.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
Step 8.1: DETERMINE WHO IS AFFECTED
Record: **Driver/platform-specific:** Intel Hades Canyon NUC (NUC8i7HNB / SSID 8086:2073) with ALC700. Dual-boot Windows→Linux users are the ones who hit the broken coefficient. Other machines unchanged.
Step 8.2: DETERMINE THE TRIGGER CONDITIONS
Record: Reboot from Windows into Linux (Windows left coef 0x1b bit 0x0400 clear). Not every boot if BIOS left the bit set. Not a race. Unprivileged users do not need a special exploit; they just have no analog sound.
Step 8.3: DETERMINE THE FAILURE MODE SEVERITY
Record: Analog audio **unusable** (no playback) until BIOS toggle or this coef write. **MEDIUM** for the kernel as a whole, **HIGH** for those users (device functionally broken). Not a panic/UAF, but a real hardware functional failure — the exact class stable regularly takes as HDA quirks.
Step 8.4: CALCULATE RISK-BENEFIT RATIO
Record:
- **Benefit:** Restores analog audio on a shipping Intel NUC after dual- boot. Matches BIOS. Tested on the machine.
- **Risk:** Very low (20 lines, SSID-gated, one bit set, standard helper).
- **Ratio:** Strongly favors backport.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
Step 9.1: COMPILE THE EVIDENCE
**FOR backporting:**
- Real user-visible bug: analog playback dead after Windows→Linux reboot.
- Explicit hardware quirk (SSID + INIT coef), the documented stable exception.
- Small (+20), obviously correct, SSID-scoped.
- ALC700 and all helpers exist in 6.12; bug is not post-branch.
- Maintainer Takashi Iwai applied v1 with no objections.
- Same style as many quirks already in this tree.
**AGAINST backporting:**
- Affects one NUC SKU, mainly dual-boot.
- Upstream path differs; cherry-pick needs a file-path adjustment.
- No syzbot/CVE/crash.
**UNRESOLVED:**
- Could not read lore.kernel.org/stable (403). No evidence it was rejected for stable.
Step 9.2: APPLY THE STABLE RULES CHECKLIST
1. Obviously correct and tested? **PASS** — bit set matches measured 0x4a4b→0x4e4b; verified on NUC8i7HNB; maintainer applied.
2. Fixes a real bug that affects users? **PASS** — analog audio unusable after dual-boot.
3. Important issue? **PASS** — hardware-quirk class; functional audio failure on a real product (not a crash, but in-scope for stable quirks).
4. Small and contained? **PASS** — 20 lines, one file, one SSID.
5. No new features or APIs? **PASS** — quirk only.
6. Can apply to the local tree? **PASS** — needs path rewrite to patch_realtek.c; context matches.
Step 9.3: CHECK FOR EXCEPTION CATEGORIES
Record: **Hardware quirk / workaround** (HDA/Realtek codec quirk table). This is an automatic YES category in the stable rules given above.
Step 9.4: MAKE YOUR DECISION
This should be backported to this 6.12 tree. The ALC700 path is old; only the Hades Canyon restore is missing. The upstream split into alc269.c is after 6.12, so the backport is the same hunks in sound/pci/hda/patch_realtek.c.
------------------------------------------------
What problem it solves and why it matters
------------------------------------------------
On Intel Hades Canyon (SSID 8086:2073), Windows can leave Realtek coef 0x1b with bit 0x0400 clear. Linux never sets it, so analog playback stays dead across boot. Dual-boot NUC users on 6.12 hit this today. The fix restores that one BIOS bit at codec INIT.
Risk vs benefit
------------------------------------------------
Benefit is restoring audio on that SKU. Risk is a one-bit vendor coef write gated by PCI quirk, using an existing helper. Path rewrite is mechanical.
------------------------------------------------
Verification
------------------------------------------------
- [Phase 1] Parsed tags: SOB Csaba Budai, Link msgid, SOB Takashi Iwai; no Fixes/Cc-stable/Reported-by.
- [Phase 2] Diff: +20 in one file; enum + INIT func + fixup table + SND_PCI_QUIRK(0x8086, 0x2073).
- [Phase 2] __alc_update_coefex_idx: (val & ~mask) | bits_set with mask=bits_set=0x0400 sets one bit.
- [Phase 3] git describe HEAD / make kernelversion: p-6.12-3, **6.12.111**.
- [Phase 3] git merge-base --is-ancestor 1fcccdc20a76b HEAD: **not in this tree**.
- [Phase 3] git merge-base --is-ancestor 6fbae35a3170c HEAD: ALC700 support **is** in this tree (2016).
- [Phase 3] git merge-base --is-ancestor aeeb85f26c3bb HEAD: codec split **not** in this tree (old path).
- [Phase 3] Blame: ALC700_FIXUP_INTEL_REFERENCE from b84e843644f211; 8086:2074 from d1ee66c5d3c5a0.
- [Phase 4] b4 dig -c 1fcccdc20a76b: lore/msgid match; v1 only; Takashi “Applied now. Thanks.”
- [Phase 4] b4 dig -w: linux-sound + Takashi Iwai + Jaroslav Kysela.
- [Phase 4] WebFetch lore: **403**; thread via b4 dig -m /tmp/hades- canyon.mbox.
- [Phase 5] Callers: patch_alc269 → snd_hda_pick_fixup → alc_init → HDA_FIXUP_ACT_INIT.
- [Phase 6] Grep: no 0x2073 / Hades Canyon / HADES_CANYON in patch_realtek.c; insertion points present.
- [Phase 8] Failure: analog playback unusable; SSID-scoped; not a crash.
- UNVERIFIED: stable@ mailing list discussion (HTTP 403).
**YES**
sound/hda/codecs/realtek/alc269.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
sound/hda/codecs/realtek/alc269.c +20 -0
@@ -3820,6 +3820,7 @@ enum {ALC225_FIXUP_DELL_WYSE_MIC_NO_PRESENCE ,ALC225_FIXUP_S3_POP_NOISE ,ALC700_FIXUP_INTEL_REFERENCE , +ALC700_FIXUP_INTEL_HADES_CANYON ,ALC274_FIXUP_DELL_BIND_DACS ,ALC274_FIXUP_DELL_AIO_LINEOUT_VERB , ALC298_FIXUP_TPT470_DOCK_FIX,
@@ -4040,6 +4041,19 @@ static void alc287_fixup_lenovo_yoga_book_9i(struct hda_codec *codec,__snd_hda_apply_fixup (codec, id, action,0 ); } +static void alc700_fixup_intel_hades_canyon (struct hda_codec *codec, +const struct hda_fixup *fix, +int action) +{ +/* +* Windows may leave coef 0x1b bit 0x0400 cleared, causing broken +* analog playback after rebooting into Linux. Restore the bit +* during codec initialization. +*/ +if (action ==HDA_FIXUP_ACT_INIT ) +alc_update_coef_idx (codec,0x1b ,0x0400 ,0x0400 ); +} +static const struct hda_fixup alc269_fixups[] = { [ALC233_FIXUP_WUJIE_SPEAKERS ] = { .type =HDA_FIXUP_PINS ,
@@ -5092,6 +5106,10 @@ static const struct hda_fixup alc269_fixups[] = { {} } }, + [ALC700_FIXUP_INTEL_HADES_CANYON] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc700_fixup_intel_hades_canyon, + }, [ALC274_FIXUP_DELL_BIND_DACS] = { .type = HDA_FIXUP_FUNC, .v.func = alc274_fixup_bind_dacs,
@@ -7653,6 +7671,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x2782 ,0xa128 ,"Positivo N15RPE-S" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x2782 ,0xa212 ,"Lunnen Ground 14" ,ALC269VC_FIXUP_LUNNEN_GROUND_14 ),SND_PCI_QUIRK (0x7017 ,0x2014 ,"Star Labs StarFighter" ,ALC233_FIXUP_STARLABS_STARFIGHTER ), +SND_PCI_QUIRK (0x8086 ,0x2073 ,"Intel NUC 8 Hades Canyon" , +ALC700_FIXUP_INTEL_HADES_CANYON ),SND_PCI_QUIRK (0x8086 ,0x2074 ,"Intel NUC 8" ,ALC233_FIXUP_INTEL_NUC8_DMIC ),SND_PCI_QUIRK (0x8086 ,0x2080 ,"Intel NUC 8 Rugged" ,ALC256_FIXUP_INTEL_NUC8_RUGGED ), SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", ALC256_FIXUP_INTEL_NUC10),
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 usb: musb: host: clear stale RX interrupt on three-strikes error
In reply to Sasha LevinFrom: Lucas Martins Alves <[email protected]>
[ Upstream commit 3a3a48487344a653f46a4aadc9ba296386eb3541 ]
Unplugging a busy USB Ethernet adapter can leave a stale RX interrupt pending while the host handles MUSB_RXCSR_H_ERROR. On AM335x/DSPS platforms this can retrigger the same three-strikes error before the disconnect path completes, flooding the log and potentially leaving the host port stuck until reboot.
Clear the pending endpoint RX interrupt when aborting the transfer so the error storm is broken, and rate limit the error message to avoid spamming the log while the fault path completes.
---
LLM Generated explanations, may be completely bogus:
## Local tree
This checkout is **Linux 7.3.0-rc4** (v7.3-rc4-27-gf0100363d8c37), i.e. current mainline, not a -stable branch. The candidate is already in this history as 3a3a48487344a. The verdict below is whether **this** tree’s code still has the bug and whether the fix is a suitable stable backport of that code — not whether some other series should take it.
---
## Phase 1: Commit message forensics
**Step 1.1 — Subject**
- Subsystem: usb: musb: host:
- Action verbs: **clear** (stale IRQ), plus body **rate limit**
- Intent: stop a leftover RX IRQ from re-firing the three-strikes error path after unplug
Record: [usb/musb host] [clear] [ACK leftover RX IRQ on three-strikes so unplug cannot storm/wedge the host]
**Step 1.2 — Tags**
- Signed-off-by: Lucas Martins Alves <[email protected]> (author)
- `Link: https://patch.msgid.link/20260714134941.18508-1-
[email protected]`
- Signed-off-by: Greg Kroah-Hartman <[email protected]> (USB maintainer merge)
- No Fixes:, Reported-by:, Tested-by:, Reviewed-by:, Acked- by:, or Cc: stable (absence is expected for this pipeline)
Record: author SOB + lore msgid + Greg KH SOB. No syzbot, no Fixes tag.
**Step 1.3 — Body**
- Bug: unplug of a **busy USB Ethernet adapter** leaves a pending RX interrupt while MUSB_RXCSR_H_ERROR is handled.
- Symptom: on **AM335x/DSPS**, the same three-strikes error retriggers before disconnect finishes → **log flood** and **host port stuck until reboot**.
- Root cause (author): stale endpoint RX interrupt not cleared on abort.
- Fix: musb_platform_clear_ep_rxintr() plus dev_err_ratelimited.
Record: [interrupt storm / wedged MUSB host port on unplug] [log spam + port dead until reboot] [AM335x/DSPS] [stale RX IRQ reasserts H_ERROR]
**Step 1.4 — Hidden bug fix?**
Not hidden. It is an explicit hardware-IRQ abort fix. Rate-limit is secondary hardening for the same storm.
Record: [Not a disguised cleanup; it is a stated interrupt-storm / hang fix]
---
## Phase 2: Diff analysis
**Step 2.1 — Inventory**
- File: drivers/usb/musb/musb_host.c only (+13 / -1)
- Function: musb_host_rx()
- Scope: single-file, one error branch
Record: [musb_host.c +13/-1] [musb_host_rx] [surgical single-file]
**Step 2.2 — Flow**
Before: on MUSB_RXCSR_H_ERROR, log with dev_err, set -ESHUTDOWN, zero RX interval, clear H_ERROR in RXCSR, then fall through to the existing fault abort (musb_h_flush_rxfifo / giveback).
After: same abort, but (1) dev_err_ratelimited with a trailing \n, and (2) musb_platform_clear_ep_rxintr(musb, epnum) after clearing RXCSR.
Record: [H_ERROR branch: abort URB as before → also ACK platform RX IRQ and rate-limit the printk]
**Step 2.3 — Bug mechanism**
Category: **hardware interrupt storm / stale IRQ** (same family as resource-leak-on-error, but the resource is a latched IRQ).
Verified mechanism:
1. dsps_interrupt() reads epintr_status, ACKs it, then calls musb_interrupt() → musb_host_rx().
2. If the Mentor core re-latches RX while H_ERROR is still being unwound, DSPS delivers another RX IRQ before disconnect.
3. dsps_musb_clear_ep_rxintr() writes (1 << epnum) << wrp->rxep_shift to epintr_status — the same ACK used in musb_cleanup_urb() (“clear the endpoint's irq status here to avoid bogus irqs”).
4. The helper is a **no-op** unless ops->clear_ep_rxintr is set; only DSPS implements it.
Record: [stale IRQ storm] [ACK DSPS ep RX status after H_ERROR so musb_host_rx is not re-entered]
**Step 2.4 — Fix quality**
Obviously correct: it reuses a 2017 platform hook already used for the same “bogus RX IRQ” class. No API/data-structure change. Regression risk is low: non-DSPS platforms no-op; DSPS only ACKs the endpoint whose error was just handled. Rate-limit cannot change USB behavior. Adding \n only fixes printk formatting.
Record: [minimal, matches existing abort path] [low regression risk]
---
## Phase 3: Git history
**Step 3.1 — Blame**
- H_ERROR handling exists since 550a7375fe720 (Felipe Balbi, 2008).
- -ESHUTDOWN / “three-strikes” comment: 1b967691ecdcf (Bin Liu, 2020-05-25, v5.7-rc6 era) — same disconnect/storm class.
- This patch only owns the new call and the ratelimited log.
Record: `[buggy H_ERROR path: 2008; incomplete storm mitigation:1b967691ecdcf ~v5.7] [long-lived]`
**Step 3.2 — Fixes: tag**
None. The incomplete predecessor is 1b967691ecdcf (“return -ESHUTDOWN … three-strikes”), present in this tree (git merge-base --is-ancestor succeeded).
Record: [no Fixes tag; predecessor 1b967691ecdcf is in this tree]
**Step 3.3 — File history**
Related:
- dbac5d07d13e3 (2016): don’t start next RX URB on failure — **system freeze** on USB-UART unplug / RX IRQ flood.
- 6def85a396ce7 + c48400baa0215 (2017, v4.10): add/implement clear_ep_rxintr for bogus RX IRQ during DMA teardown; **already Cc:
stable # 4.1+**.
- No later musb_host.c commits after this candidate.
Record: [standalone; same storm family as 2016/2017/2020 musb host fixes] [no later conflicting musb_host.c commits]
**Step 3.4 — Author**
Lucas Martins Alves has only this USB commit in-tree. Merge via Greg KH. Recipients included Bin Liu ([email protected], long-time MUSB/DSPS author).
Record: [outside contributor; Greg KH merged; TI musb maintainer was on Cc]
**Step 3.5 — Prerequisites**
Needs musb_platform_clear_ep_rxintr() / ops->clear_ep_rxintr. Both are ancestors of HEAD (6def85a396ce7, c48400baa0215). Call site in musb_cleanup_urb() already exists. Applies standalone.
Record: [depends on 2017 helper, present here] [standalone apply yes]
---
## Phase 4: Mailing list / external
**Step 4.1**b4 dig -c 3a3a48487344a → v1 only:
https://patch.msgid.link/20260714134941.18508-1-
[email protected]
Submitted 2026-07-14, merged 2026-07-17. Saved mbox is **only the patch**; no replies, NAKs, or Cc: stable discussion. WebFetch to lore returned **403** (verified).
Record: [lore msgid above] [v1 only, no review comments in thread] [no NAK]
**Step 4.2**b4 dig -w: To/Cc Lucas, [email protected], [email protected], linux-usb, linux-kernel.
Record: [USB maintainer + TI musb author + linux-usb were on the original To/Cc]
**Step 4.3**
No Reported-by / bugzilla / syzbot. Body reads as first-hand AM335x unplug. User-count beyond the author is **unverified**.
Record: [no public bugzilla/syzbot] [UNVERIFIED: how many users besides the author]
**Step 4.4**b4 dig -a: single standalone v1, not a series.
Record: [standalone, not patch X/Y]
**Step 4.5**
lore.kernel.org/stable WebFetch: **403**. No stable-list discussion verified.
Record: [UNVERIFIED: stable@ discussion]
---
## Phase 5: Semantic / call graph
**Step 5.1**
Modified: musb_host_rx(). New call: musb_platform_clear_ep_rxintr() → dsps_musb_clear_ep_rxintr() on DSPS.
**Step 5.2 — Callers** (from drivers/usb/musb/musb_core.c)
- musb_interrupt(): host IRQ, for_each_set_bit on int_rx
- musb_dma_completion(): DMA completion RX path
Called from hardirq / DMA completion under musb->lock. Common host RX path, not init-only.
**Step 5.3 — Callees in the hunk**dev_err_ratelimited, musb_writeb (interval), musb_writew (RXCSR), musb_platform_clear_ep_rxintr. Fault path still does musb_h_flush_rxfifo when status != 0.
**Step 5.4 — Reachability**
Yes: USB Ethernet bulk IN while the device is yanked. Unprivileged physical unplug. DSPS glue is CONFIG_USB_MUSB_DSPS (ARCH_OMAP2PLUS — AM335x BeagleBone / Sitara class).
**Step 5.5 — Similar pattern**
Same helper already used in musb_cleanup_urb() for DMA abort. TX H_ERROR still uses musb_dbg and does **not** clear RX IRQ (TX path; out of this patch’s scope). Historical RX-flood fixes: dbac5d07d13e3, 1b967691ecdcf.
Record: [musb_host_rx from IRQ/DMA] [userspace-triggerable unplug] [same helper as cleanup_urb]
---
## Phase 6: This checkout
**Step 6.1**
Buggy H_ERROR branch is in musb_host_rx() here. Helper and DSPS callback exist. Bug class dates to 2008; -ESHUTDOWN mitigation from ~5.7 did not clear the DSPS RX IRQ.
Record: [yes, musb_host.c H_ERROR path] [introduced 2008 / incomplete 2020]
**Step 6.2**
Context around the hunk matches the candidate 1:1. musb_platform_clear_ep_rxintr already declared. Expected apply:
**clean**.
Record: [clean apply on this tree]
**Step 6.3**
No later musb_host.c commit supersedes this. 2016/2020 patches are related but **not** equivalent (they stop URB resubmit / next URB start; they do not ACK epintr_status).
Record: [no substitute fix already covering the stale DSPS RX IRQ]
---
## Phase 7: Subsystem
**Step 7.1**drivers/usb/musb — Mentor USB OTG host on TI DSPS/AM335x. Criticality:
**IMPORTANT** for those platforms (USB host), **PERIPHERAL** globally. Not staging.
**Step 7.2**
Mature driver (2008+), still getting probe/UAF/of_node fixes. This is a late bug in old code, not a new-subsystem feature.
Record: [usb/musb] [IMPORTANT for AM335x/DSPS host] [mature]
---
## Phase 8: Impact and risk
**Step 8.1**
Affected: MUSB **host** on platforms with clear_ep_rxintr (DSPS/AM335x). Rate-limit also helps any MUSB host that hits three- strikes. Trigger is USB Ethernet (and similar always-IN gadgets) unplug.
Record: [driver/platform-specific: USB_MUSB_DSPS / AM335x; logging on all musb host]
**Step 8.2**
Trigger: unplug busy USB-Ethernet while IN URBs are posted — realistic. Timing-dependent vs disconnect. Unprivileged user can do it physically.
Record: [common unplug of busy NIC] [not a theoretical race only] [physical unplug]
**Step 8.3**
Failure: IRQ retrigger → printk flood + **host port unusable until reboot**. Same family previously described as **system freeze** (dbac5d07d13e3: hub never reports disconnect because RX ISR never yields).
Record: [hang / wedged USB host (+ log flood)] [HIGH, hang-class]
**Step 8.4**
Benefit: high for AM335x/BeagleBone/industrial Sitara USB hosts.
Risk: very low (13 lines, existing no-op-safe hook, error path only).
Record: [high benefit / very low risk]
---
## Phase 9: Synthesis
**Step 9.1 — Evidence**
FOR:
- Real, user-visible hang: USB host stuck until reboot after unplugging a busy USB Ethernet adapter.
- Interrupt storm on a path already known to freeze the machine (2016/2020 musb host history).
- 13-line change in one function; reuses musb_platform_clear_ep_rxintr() from 2017 (stable-bound then).
- No-op on glues without the ops hook.
- Merged by Greg KH; TI musb author was CCd.
- Prerequisites exist in this tree; no series dependency.
AGAINST:
- No Reported-by / public repro beyond the commit text.
- Affects DSPS/AM335x, not every USB user.
- Thread had no review replies (Greg merged v1 quickly).
UNRESOLVED:
- Could not fetch lore HTML (403); mbox had no replies.
- Could not search stable@ (403).
- Number of independent reporters unverified.
**Step 9.2 — Stable rules**
1. Obviously correct and tested? **PASS** — same ACK used in musb_cleanup_urb; merged to mainline.
2. Real bug affecting users? **PASS** — unplug of busy USB Ethernet on AM335x.
3. Important (crash/security/corruption/deadlock)? **PASS** — host port hang until reboot / IRQ storm (HIGH).
4. Small and contained? **PASS** — +13/-1, one file, one branch.
5. No new features/APIs? **PASS** — uses existing ops hook; rate-limit is logging only.
6. Applies to this tree? **PASS** — helper, DSPS callback, and hunk context all present.
**Step 9.3 — Exceptions**
Not a device-ID/DT/build/docs exception. Closest: **hardware workaround** (ACK platform IRQ the Mentor core leaves asserted). Qualifies on ordinary bug-fix rules anyway.
**Step 9.4 — Decision**
This is a small, contained fix for a real disconnect-time IRQ storm that can leave MUSB host unusable until reboot. It matches prior musb stable- worthy storm fixes and uses an already-stable helper. Benefit outweighs risk.
---
### What it solves for stable users
On TI DSPS/AM335x, yanking a busy USB Ethernet adapter can re-assert endpoint RX IRQ while musb_host_rx() is still handling MUSB_RXCSR_H_ERROR. The host keeps taking the same three-strikes error, floods the log, and can leave the port dead until reboot. Clearing the platform RX IRQ (and rate-limiting the error) breaks that loop so disconnect can finish.
### Risk vs benefit
Very low risk (no-op elsewhere, existing helper, error path only) versus high benefit (avoid a wedged USB host on a widely deployed SoC class).
### Concerns
None that block backport on this tree: no missing helpers, no series, no API change. User-count beyond the author is unverified and does not outweigh the hang severity plus the 2016/2020 precedent.
---
## Verification
- [Phase 1] Parsed tags: author SOB, msgid Link, Greg KH SOB; no Fixes/Reported-by/Cc stable
- [Phase 1] git log -1 --format on 3a3a48487344a: subject/body match the candidate
- [Phase 2] Diff: +13/-1 in musb_host_rx() H_ERROR branch; dev_err → dev_err_ratelimited; add musb_platform_clear_ep_rxintr
- [Phase 2] Read musb_host.c fault path: status = -ESHUTDOWN still leads to flush/abort
- [Phase 2] Read musb_core.h: helper no-ops if ops hook NULL
- [Phase 2] Read dsps_musb_clear_ep_rxintr: writes endpoint bit to epintr_status
- [Phase 2] Read dsps_interrupt: ACK all epintr then musb_interrupt() → re-latch can retrigger
- [Phase 2] musb_cleanup_urb already calls the same helper “to avoid bogus irqs”
- [Phase 3] git blame -L 1770,1810 musb_host.c: H_ERROR from 2008; ESHUTDOWN from 1b967691ecdcf
- [Phase 3] git merge-base --is-ancestor 6def85a396ce7 / c48400baa0215 / 1b967691ecdcf / 3a3a48487344a vs HEAD: all true
- [Phase 3] git show 6def85a396ce7 / c48400baa0215: helper added for bogus RX IRQ; Cc stable 4.1+
- [Phase 3] git show dbac5d07d13e3: earlier RX ISR flood freeze on unplug
- [Phase 3] git log 3a3a48487344a..HEAD -- musb_host.c: empty (no follow-up)
- [Phase 3] git log --author='Lucas Martins Alves' -- drivers/usb/:
only this commit
- [Phase 4] b4 dig -c/-a/-w/-m: v1 msgid, recipients Bin Liu + Greg KH
+ linux-usb, mbox has patch only
- [Phase 4] WebFetch lore/stable: 403 — UNVERIFIED HTML thread beyond mbox
- [Phase 5] git grep musb_host_rx: callers musb_interrupt, musb_dma_completion
- [Phase 5] git grep clear_ep_rxintr: only DSPS implements the ops
- [Phase 6] git describe HEAD / make kernelversion: v7.3-rc4 / 7.3.0-rc4
- [Phase 6] Pre-patch hunk via git show 3a3a48487344a^:drivers/usb/musb/musb_host.c: helper already existed
- [Phase 7] Kconfig USB_MUSB_DSPS: ARCH_OMAP2PLUS / TI DSPS
- [Phase 8] Failure mode from commit text + 2016 freeze commit: IRQ storm / wedged host, HIGH
- UNVERIFIED: independent user count; stable@ mailing list discussion; lore HTML (403)
The fix is small, uses an existing platform ACK, and prevents a real USB-host hang on unplug.
**YES**
drivers/usb/musb/musb_host.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/usb/musb/musb_host.c +13 -1
@@ -1774,7 +1774,8 @@ void musb_host_rx(struct musb *musb, u8 epnum) status = -EPIPE ; }else if (rx_csr &MUSB_RXCSR_H_ERROR ) { -dev_err (musb->controller,"ep%d RX three-strikes error" , epnum); +dev_err_ratelimited (musb->controller, +"ep%d RX three-strikes error\n" , epnum);/* * The three-strikes error could only happen when the USB
@@ -1788,6 +1789,17 @@ void musb_host_rx(struct musb *musb, u8 epnum) rx_csr &= ~MUSB_RXCSR_H_ERROR ;musb_writew (epio,MUSB_RXCSR , rx_csr); +/* +* Unplugging a USB-Ethernet adapter while it is busy can make +* the controller keep re-asserting the three-strikes error for +* this endpoint before the disconnect is processed. That floods +* the log and can wedge the host port until reboot. Drop the +* stale pending RX interrupt on platforms that support it (e.g. +* AM335x/DSPS) to break the storm; the transfer is still +* aborted below via the fault path. +*/ +musb_platform_clear_ep_rxintr (musb, epnum); + }else if (rx_csr &MUSB_RXCSR_DATAERROR ) {if (USB_ENDPOINT_XFER_ISOC != qh->type) {
Signature · 1 line
2.53.0
[email protected]
AI reviewRe: [PATCH AUTOSEL 6.18-5.10] usb: musb: host: clear stale RX interrupt on three-strikes error
Sashiko has reviewed this patch and found no issues.
Quoted 10 lines
From: Lucas Martins Alves <[email protected]>
[ Upstream commit
3a3a48487344a653f46a4aadc9ba296386eb3541]Unplugging a busy USB Ethernet adapter can leave a stale RX interrupt pending while the host handles
MUSB_RXCSR_H_ERROR. On AM335x/DSPS platforms this can retrigger the same three-strikes error before the disconnect path completes, flooding the log and potentially leaving the host port stuck until reboot.
Quoted 8 lines
Clear the pending endpoint RX interrupt when aborting the transfer so the error storm is broken, and rate limit the error message to avoid spamming the log while the fault path completes.
Signed-off-by Lucas Martins Alves <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Sasha Levin
maintainerPATCH 1/1 iio: hid-sensor: als: scale each channel individually
In reply to Sasha LevinFrom: Daniel Schaefer <[email protected]>
[ Upstream commit cad928dad9a4c26aa56b4223dc2a29bca517fb5f ]
Some sensors have multiple channels (not just brightness but color ALS sensors) with different scaling factors.
---
LLM Generated explanations, may be completely bogus:
The local tree is **Linux 7.3-rc4** (mainline). Color ALS channels exist here (since v6.9), and this is a small per-channel IIO scale correctness fix with a real user report. Full phase walkthrough follows.
===============================================================
PHASE 1: COMMIT MESSAGE FORENSICS
===============================================================
**Step 1.1: PARSE THE SUBJECT LINE**
Record: **[iio/hid-sensor-als] [scale] scale each ALS channel individually rather than using one illuminance scale for every channel**
- Subsystem: iio: hid-sensor: als
- Verb: “scale” (correctness of IIO in_*_scale, not a refactor)
- Claimed intent: color ALS sensors have per-channel scaling factors; the driver used a single shared scale
**Step 1.2: PARSE ALL COMMIT MESSAGE TAGS**
Record: tags (ignoring pipeline Signed-off-by: Sasha Levin / [Upstream commit …]):
- **Signed-off-by:** Daniel Schaefer <[email protected]> (author, Framework)
- **Link:** https://gitlab.freedesktop.org/hadess/iio-sensor- proxy/-/merge_requests/413
- **Tested-by:** Sven Vainküla (Asus ProArt PX13)
- **Acked-by:** Srinivas Pandruvada (HID sensor hub maintainer)
- **Signed-off-by:** Jonathan Cameron (IIO maintainer)
- **No Fixes:** (expected for this review)
- **No Cc: stable:** (expected)
- **No Reported-by / syzbot / KASAN**
Notable: real hardware Tested-by, userspace (iio-sensor-proxy) link, maintainer Ack.
**Step 1.3: ANALYZE THE COMMIT BODY TEXT**
Record:
- **Bug:** some HID ALS devices are color ALS (illuminance + color temperature + chromaticity), not brightness-only, and those extra channels have different HID unit/exponent than illuminance.
- **Symptom:** userspace (iio-sensor-proxy, compositors) applies the illuminance scale to color-temp/chromaticity raw values → wrong physical units (night light / color management broken or nonsense).
- **Version info:** none in the message. Color/chromaticity channels themselves landed in v6.9.
- **Root cause:** hid_sensor_format_scale() was called only on als[CHANNEL_SCAN_INDEX_INTENSITY] and that one scale was returned for every channel.
**Step 1.4: DETECT HIDDEN BUG FIXES**
Record: **Not a hidden cleanup.** It is an explicit correctness fix:
wrong IIO SCALE sysfs values for extra ALS channels. Same class as 8b518cdb03f5f (“iio: hid-sensor-prox: support multi-channel SCALE calculation”), which had Cc: stable and Fixes:.
===============================================================
PHASE 2: DIFF ANALYSIS - LINE BY LINE
===============================================================
**Step 2.1: INVENTORY THE CHANGES**
Record:
- **File:** drivers/iio/light/hid-sensor-als.c only
- **Size:** 12 insertions, 10 deletions (net +2)
- **Functions:** struct als_state, als_read_raw(), als_parse_report()
- **Scope:** single-file surgical driver fix
**Step 2.2: UNDERSTAND THE CODE FLOW CHANGE**
Record:
1. **State:** scale_pre_decml / scale_post_decml / scale_precision become arrays of CHANNEL_SCAN_INDEX_MAX.
2. **als_read_raw IIO_CHAN_INFO_SCALE:** used to return the one illuminance scale for any channel; now indexes by chan->scan_index, with a bounds check.
3. **als_parse_report:** scale is computed **inside** the per-usage loop with st->als[i] (that channel’s units/exponent), instead of once afterward from intensity only.
**Step 2.3: IDENTIFY THE BUG MECHANISM**
Record: **[Logic / correctness]** IIO SCALE ABI wrong for color ALS.
hid_sensor_format_scale() (verified in hid-sensor-attributes.c) matches usage_id (still the ALS sensor usage 0x200041) **and** attr_info->units, then applies attr_info->unit_expo. The per-channel difference is those HID attribute fields. Intensity/illuminance share HID_USAGE_SENSOR_LIGHT_ILLUM; color-temp and chromaticity have different attributes, so they must not reuse intensity’s exponent.
Classic brightness-only ALS is unchanged: both intensity and illum still use the same HID usage and therefore the same scale.
**Step 2.4: ASSESS THE FIX QUALITY**
Record:
- **Quality:** obviously correct; same pattern as hid-sensor-prox (scale_pre_decml[index] + format_scale in the parse loop).
- **Minimal:** no unrelated edits.
- **Regression risk:** low. Traditional ALS behavior is preserved. Color-temp/chromaticity SCALE sysfs values change from wrong to correct (intended).
- **Known limitation (discussed on-list, not a NAK):** IIO_CHAN_INFO_SCALE stays info_mask_shared_by_type, so chromaticity X and Y share one sysfs scale. Jonathan Cameron: that only matters if X and Y scales differ; the reported bug is illuminance vs color-temp. Author: “in practice it's probably not needed and the patch works as is.” No v2 was required; v1 was applied.
===============================================================
PHASE 3: GIT HISTORY INVESTIGATION
===============================================================
**Step 3.1: BLAME THE CHANGED LINES**
Record:
- Shared scale fields date to **36783d09f1a5c** (“iio: hid-sensors:
ALS: adjust scale and offset”, 2014) — correct when there was only illuminance.
- Extra channels: **3765d426fe864** color temperature, **2ec17b1950bb8** chromaticity, both **v6.9-rc1**. That is when one scale became wrong.
- Dynamic channel assignment: **f2a71ebdf2312** (v6.9).
**Step 3.2: FOLLOW THE FIXES: TAG**
Record: **No Fixes: tag.** Closest introduction of the bug is the v6.9 color-temp/chromaticity additions. Those commits **are** ancestors of this 7.3-rc4 tree (git merge-base --is-ancestor not required for each; git describe --contains shows v6.9-rc1).
**Step 3.3: CHECK FILE HISTORY FOR RELATED CHANGES**
Record: recent ALS history includes channel init refactor, timestamp alignment, probe race fix. **No prerequisite series** for this patch (standalone v1). **No follow-ups** on this file after cad928dad9a4c.
**Step 3.4: CHECK THE AUTHOR'S OTHER COMMITS**
Record: Daniel Schaefer has this single IIO commit in-tree. Not the subsystem maintainer. Weight comes from **Acked-by Srinivas Pandruvada** and **SOB Jonathan Cameron**.
**Step 3.5: CHECK FOR DEPENDENT/PREREQUISITE COMMITS**
Record: needs existing als[] per-channel attribute array, CHANNEL_SCAN_INDEX_*, and hid_sensor_format_scale() — all present here since v6.9 / much earlier. **Applies standalone.** Prox analog 8b518cdb03f5f is a sibling pattern, not a dependency.
===============================================================
PHASE 4: MAILING LIST AND EXTERNAL RESEARCH
===============================================================
**Step 4.1: FIND THE ORIGINAL PATCH DISCUSSION**
Record:
- **b4 dig:** https://patch.msgid.link/20260723-chromaticity-v1-1-
[email protected]
- **Series:** v1 only (no v2/v3 despite author briefly offering a v2 for info_mask_separate)
- **Jonathan Cameron (2026-07-26):** SCALE shared-by-type is OK unless chromaticity X/Y differ; “the change here looks fine”; queued on iio.git testing.
- **Srinivas Pandruvada:** Acked-by.
- **David Lechner:** explained testing-branch means accepted/applied.
- **No NAK.** No reviewer asked for Cc: stable.
- **Sashiko bot:** flagged shared-by-type (addressed in discussion) and a **pre-existing** buffer-layout concern, not introduced by this patch.
**Step 4.2: CHECK WHO REVIEWED THE PATCH**
Record: To/Cc included Jonathan Cameron, Srinivas Pandruvada, David Lechner, Nuno Sá, Andy Shevchenko, linux-iio, linux-input. Right maintainers were in the loop.
**Step 4.3: SEARCH FOR THE BUG REPORT**
Record: GitLab iio-sensor-proxy MR 413 returned **HTTP 403** (UNVERIFIED beyond the Link tag). Hardware evidence that **is** verified: Tested-by on Asus ProArt PX13; Framework author; iio-sensor-proxy is the standard userspace for laptop ALS.
**Step 4.4: CHECK FOR RELATED PATCHES AND SERIES**
Record: standalone, not N/M. Prox multi-channel SCALE (8b518cdb03f5f, v6.15-rc6) is the same bug class and **was** Cc: stable.
**Step 4.5: CHECK STABLE MAILING LIST HISTORY**
Record: no “stable” in the lore mbox. UNVERIFIED whether linux-stable@ discussed it separately (no lore.kernel.org/stable hit via b4 thread).
===============================================================
PHASE 5: CODE SEMANTIC ANALYSIS
===============================================================
**Step 5.1: IDENTIFY KEY FUNCTIONS**
Record: als_read_raw, als_parse_report; struct als_state. Probe
path: hid_als_probe → als_parse_report. Sysfs/read path: IIO core → als_info.read_raw → als_read_raw.
**Step 5.2: TRACE CALLERS**
Record:
- als_parse_report: only from hid_als_probe (HID-SENSOR-200041 / LISS-0041 platform devices).
- als_read_raw: IIO read_raw for sysfs (in_illuminance_scale, in_colortemp_scale, in_chromaticity_x_scale, etc.) and buffered metadata. **Userspace-reachable**, not IRQ-hot.
**Step 5.3: TRACE CALLEES**
Record: hid_sensor_format_scale() → unit table + adjust_exponent_nano(); sensor_hub_input_get_attribute_info() fills per-channel units/unit_expo.
**Step 5.4: FOLLOW THE CALL CHAIN**
Record: unprivileged users can read IIO sysfs on a system with this HID ALS. Color ALS on recent AMD/laptop HID sensor hubs (v6.9+ channels). **Reachable from userspace.**
**Step 5.5: SEARCH FOR SIMILAR PATTERNS**
Record: hid-sensor-prox already uses per-channel scale arrays. Other hid-sensor drivers (accel, gyro, press, temp) still use a single scale because they are not mixed-unit multi-channel in the same way. ALS was the leftover mismatch after v6.9 extra channels.
===============================================================
PHASE 6: CROSS-REFERENCING AGAINST THE LOCAL TREE
===============================================================
**Step 6.1: DOES THE BUGGY CODE EXIST IN THIS TREE?**
Record:
- **Tree:** git describe HEAD = v7.3-rc4-27-gf0100363d8c37; make kernelversion = **7.3.0-rc4** (Linus mainline, not an LTS branch).
- Color ALS channels **are** in hid-sensor-als.c.
- Commit **cad928dad9a4c is already an ancestor of HEAD** (working tree already has per-channel arrays). That is the mainline landing of this fix during 7.3, **not** a reason to reject it on technical merit (pipeline “already selected” markers ignored).
- Bug introduced **v6.9** (2024), long before this tree.
**Step 6.2: CHECK FOR BACKPORT COMPLICATIONS**
Record: against **this** 7.3 tree the change is already applied / would apply cleanly. Context in the submitted v1 still used als_adjust_channel_bit_mask; this tree uses iio_scan_type initializer (cded217233845). For **this** checkout that is already resolved. No extra commits required for the logic of the fix.
**Step 6.3: CHECK IF RELATED FIXES ARE ALREADY HERE**
Record: this exact commit is in HEAD. No later revert or competing fix. No other ALS scale fix in git log cad928dad9a4c..HEAD -- drivers/iio/light/hid-sensor-als.c.
===============================================================
PHASE 7: SUBSYSTEM AND MAINTAINER CONTEXT
===============================================================
**Step 7.1: IDENTIFY THE SUBSYSTEM AND ITS CRITICALITY**
Record: **IIO light / HID sensor hub ALS** — **PERIPHERAL to IMPORTANT** depending on hardware. Laptop ambient/color light (Framework, Asus ProArt, HID sensor hubs). Not mm/net/fs core, but commonly used on notebooks via iio-sensor-proxy.
**Step 7.2: ASSESS SUBSYSTEM ACTIVITY**
Record: mature driver (2012), still getting channel and race fixes. Color ALS is several years old (v6.9), not brand-new staging code.
===============================================================
PHASE 8: IMPACT AND RISK ASSESSMENT
===============================================================
**Step 8.1: DETERMINE WHO IS AFFECTED**
Record: **driver-specific / config-specific** (CONFIG_HID_SENSOR_ALS). Users of HID color ALS (not every illuminance-only ALS). Confirmed: Asus ProArt PX13; likely other color-ALS HID laptops.
**Step 8.2: DETERMINE THE TRIGGER CONDITIONS**
Record: **Every read of IIO SCALE** for color-temp/chromaticity, and every userspace conversion of those raw values. Not a race. Unprivileged users with IIO device node/sysfs access can observe it. Common on affected laptops at session start (iio-sensor-proxy).
**Step 8.3: DETERMINE THE FAILURE MODE SEVERITY**
Record: **Wrong sensor physical values** (color temperature / chromaticity), not oops/UAF/deadlock. Userspace brightness for classic ALS is unaffected (same HID usage). Compositor color/night-light using color ALS can be wrong. **Severity: MEDIUM** — real, user-visible, “oh that’s not good,” not CRITICAL.
**Step 8.4: CALCULATE RISK-BENEFIT RATIO**
Record:
- **Benefit:** correct IIO scale on color ALS; unbreaks iio-sensor- proxy/hardware that already exists in this lineage.
- **Risk:** very low (≈20-line, one file, no locking/API).
- **Ratio:** favorable. Same class already taken for stable in prox.
===============================================================
PHASE 9: FINAL SYNTHESIS
===============================================================
**Step 9.1: COMPILE THE EVIDENCE**
**FOR backporting**
- Real userspace-visible bug: mixed-unit color ALS channels reused illuminance scale.
- Hit on real hardware (Asus ProArt PX13 Tested-by); iio-sensor-proxy MR linked.
- Small, obviously correct, acked by HID-sensor maintainer, applied by IIO maintainer.
- Identical prox bug was explicitly Cc: stable.
- This tree **has** the v6.9 color/chromaticity channels, so the bug class exists in this lineage.
- Traditional ALS unchanged; only extra channels’ SCALE change.
- Fits documented stable bar: “real bug that bothers people” / “oh, that’s not good.”
**AGAINST**
- Not a crash, UAF, deadlock, or security issue.
- No Fixes:/Cc: stable (not a negative per review rules).
- SCALE still shared-by-type for chromaticity X/Y (accepted by maintainer as OK for the reported bug).
- Peripheral driver, not core kernel.
- GitLab MR body UNVERIFIED (403).
**UNRESOLVED**
- Exact HID unit/exponent values on the PX13 (not in-tree).
- Whether chromaticity X vs Y ever differ on some firmware (maintainers assumed no).
**Step 9.2: APPLY THE STABLE RULES CHECKLIST**
1. Obviously correct and tested? **PASS** — Tested-by, Acked-by, IIO maintainer queued v1.
2. Fixes a real bug that affects users? **PASS** — wrong IIO scale on color ALS; userspace conversion broken.
3. Important issue? **PASS** (medium “oh that’s not good,” not CRITICAL crash) — wrong physical units for sensors userspace actually uses.
4. Small and contained? **PASS** — one file, +12/−10.
5. No new features or APIs? **PASS** — corrects SCALE for channels that already exist; no new sysfs ABI.
6. Can apply to the local tree? **PASS** — affected code is in 7.3-rc4; change is already the current code here.
**Step 9.3: CHECK FOR EXCEPTION CATEGORIES**
Record: not a device-ID/quirk/DT/build/docs exception. Ordinary driver correctness fix.
**Step 9.4: MAKE YOUR DECISION**
This tree’s ALS driver includes color-temperature and chromaticity channels added in v6.9 but, until this change, advertised a single illuminance-derived IIO scale for all of them. That is a real, tested userspace bug (wrong color ALS readings via iio-sensor-proxy), not a feature or cleanup. The patch is small, matches the already-stable- worthy prox multi-channel SCALE fix, and does not change classic illuminance ALS. Benefit outweighs the low regression risk.
### What the commit solves and why it matters here
Color HID ALS devices expose extra channels with different HID units/exponents. The driver formatted scale only from the intensity attribute, so in_colortemp_scale / chromaticity scale were wrong. On this 7.3-rc4 tree those channels exist, so the fix is applicable and is the right stable-style correctness change for that hardware.
### Risk vs benefit
Benefit: correct sensor units for color ALS on laptops that already use this driver. Risk: a few array/index changes on the sysfs read path; illuminance-only devices keep the same scale.
### Concerns
No crash-level severity; chromaticity X/Y still share type-wide scale (explicitly accepted). Neither blocks backport of this contained fix.
Verification:
- [Phase 1] Parsed tags: Tested-by Sven Vainküla (Asus ProArt PX13); Acked-by Srinivas Pandruvada; SOB Jonathan Cameron; Link to iio- sensor-proxy MR 413; no Fixes/Cc:stable
- [Phase 2] Diff: 12+/10- in hid-sensor-als.c; scalar scale → per- scan_index arrays; format_scale moved into parse loop over st->als[i]
- [Phase 2] Verified hid_sensor_format_scale() uses attr_info->units and unit_expo; ALS unit table only has ALS+0 and ALS+LUX
- [Phase 3] git describe HEAD = v7.3-rc4-27-gf0100363d8c37; kernelversion 7.3.0-rc4
- [Phase 3] git merge-base --is-ancestor cad928dad9a4c HEAD → already in this tree (mainline landing)
- [Phase 3] Color temp 3765d426fe864 and chromaticity 2ec17b1950bb8 contained in v6.9-rc1
- [Phase 3] Prox analog 8b518cdb03f5f had Cc: stable + Fixes
- [Phase 3] No follow-up commits on hid-sensor-als.c after cad928dad9a4c
- [Phase 4] b4 dig -c cad928dad9a4c: lore https://patch.msgid.link/202
[email protected]
- [Phase 4] b4 dig -a: v1 only
- [Phase 4] b4 dig -w: IIO + HID-sensor maintainers on To/Cc
- [Phase 4] mbox: Jonathan OK with shared-by-type; Srinivas Ack; no NAK; no stable nomination in thread
- [Phase 4] GitLab MR fetch: 403, body UNVERIFIED
- [Phase 5] semcode: not available; grep shows als_read_raw only from als_info; hid_als_probe only caller of als_parse_report
- [Phase 6] Working tree already has per-channel scale arrays at lines 36–38 and 332–334
- [Phase 8] Failure mode: wrong IIO SCALE for color ALS → incorrect userspace conversion; severity MEDIUM
- UNVERIFIED: exact PX13 HID unit/exponent values; linux-stable@ discussion outside this thread
**YES**
drivers/iio/light/hid-sensor-als.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/iio/light/hid-sensor-als.c +12 -10
@@ -33,9 +33,9 @@ struct als_state {u32 illum[CHANNEL_SCAN_INDEX_MAX ];aligned_s64 timestamp; } scan; -int scale_pre_decml; -int scale_post_decml; -int scale_precision; +int scale_pre_decml[CHANNEL_SCAN_INDEX_MAX ]; +int scale_post_decml[CHANNEL_SCAN_INDEX_MAX ]; +int scale_precision[CHANNEL_SCAN_INDEX_MAX ];int value_offset;int num_channels;s64 timestamp;
@@ -186,9 +186,11 @@ static int als_read_raw(struct iio_dev *indio_dev, ret_type =IIO_VAL_INT ;break ;case IIO_CHAN_INFO_SCALE : - *val = als_state->scale_pre_decml; - *val2 = als_state->scale_post_decml; - ret_type = als_state->scale_precision; +if (chan->scan_index >=CHANNEL_SCAN_INDEX_MAX ) +return -EINVAL ; + *val = als_state->scale_pre_decml[chan->scan_index]; + *val2 = als_state->scale_post_decml[chan->scan_index]; + ret_type = als_state->scale_precision[chan->scan_index];break ;case IIO_CHAN_INFO_OFFSET : *val = als_state->value_offset;
@@ -338,6 +340,10 @@ static int als_parse_report(struct platform_device *pdev,als_adjust_channel_bit_mask (channels, index, st->als[i].size); ++index; + st->scale_precision[i] =hid_sensor_format_scale (usage_id, + &st->als[i], &st->scale_pre_decml[i], + &st->scale_post_decml[i]); +dev_dbg (&pdev->dev,"als %x:%x\n" , st->als[i].index, st->als[i].report_id); }
@@ -347,10 +353,6 @@ static int als_parse_report(struct platform_device *pdev,if (index) ret =0 ; - st->scale_precision =hid_sensor_format_scale (usage_id, - &st->als[CHANNEL_SCAN_INDEX_INTENSITY ], - &st->scale_pre_decml, &st->scale_post_decml); -return ret; }
Signature · 1 line
2.53.0