Skip to content

drm/amd/ras: skip the early init service when it is not enabled - #237

Closed
tpatward-amd wants to merge 1 commit into
ROCm:masterfrom
tpatward-amd:user/tpatward-amd/PLAT-213858
Closed

tpatward-amd wants to merge 1 commit into
ROCm:masterfrom
tpatward-amd:user/tpatward-amd/PLAT-213858

Conversation

@tpatward-amd

@tpatward-amd tpatward-amd commented Oct 11, 2026 •

Copy link
Copy Markdown

Motivation

With unified RAS on MI450 (MP1 15.0.8), every GPU logs RAS early init service failure! ret:-95 at every driver load.

amdgpu_ttm_init() calls amdgpu_ras_mgr_early_init_service() on every load so that saved bad pages are reserved before VRAM is handed out. That service needs the RAS EEPROM. ras_core_early_init_service_enabled() is false unless the ASIC supports the service and ras_eeprom_supported is set. When it is false, ras_core_eeprom_early_init_service() returns -EOPNOTSUPP, and the caller reports that as a failure on every GPU and every load.

Two configurations hit this:

  • MP1 13.0.6/12/14 with unified RAS: the early init service is not supported there. Saved pages are reserved later, at hw_init, so the warning is only noise.
  • MP1 15.0.8 (MI450, unified RAS enabled out of tree, e.g. the amdgpu DKMS 7.1.1 package with debug_mask BIT(4)): amdgpu_ras_mgr_create_ras_core() flags the service, but the RAS EEPROM is not enabled yet because amdgpu_ras_mgr_eeprom_is_supported() lists only MP1 13.0.x. Saved pages in the PMFW RAS table are therefore not reserved at all.

Technical Details

amdgpu_ras_mgr_early_init_service() (drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c) now returns 0 without calling the service when the service is not enabled. If the ASIC flags the service but the EEPROM is disabled, it logs RAS EEPROM not enabled, saved bad pages are not reserved once, at info level, instead of reporting a failure. Real failures (-EACCES outside early init, recovery errors) are still reported. The core's -EOPNOTSUPP contract is unchanged.

This PR deliberately does not enable the RAS EEPROM for MP1 15.0.8. If it did, the early-init record load would convert PMFW records with umc_v15_convert_ma_to_pa(), which is still a stub, before the RAS TA is loaded, and would reserve the wrong pages. Once MP1 15.0.8 is added to amdgpu_ras_mgr_eeprom_is_supported(), this guard lets the service run again automatically. On master, unified RAS is not enabled for MP0 15.0.8, so there this change only affects MP1 13.0.x.

Test Plan

  • Independent code review over three rounds. The first round rejected an approach that enabled the EEPROM gate. The final round reported 0 blockers on the same code (only the commit message differs: wording, sign-off). It listed the minor items under Open items below.
  • Compiled the changed file in this tree. Built amdgpu.ko from the amdgpu DKMS 7.1.1 package with the same hunk backported.
  • Hardware test on an AMD Instinct MI450 system with 4 GPUs and unified RAS enabled. The driver was loaded once without the fix and once with it, and dmesg was checked for every GPU.
  • Regression test case: after a unified-RAS load, check that every GPU initializes RAS and reports ready with no early-init failure.

Test Result

  • Before: RAS early init service failure! ret:-95 on all 4 GPUs. The regression test case fails (4 early-init failures).
  • After: 0 early-init failure lines. Each GPU logs RAS EEPROM not enabled, saved bad pages are not reserved once, then AMDGPU RAS Is Ready. (initialized=4, ready=4). With the fix loaded, runtime ACA logging still works: a software-injected MCE record was logged in the ACA log. CPER encoding was not re-checked in this test.
  • The regression test case passes.

Open items (from review, not yet addressed)

  • On an SR-IOV VF with MP1 15.0.8 and unified RAS, the new info line would also print, although saved-page reservation does not apply to VFs. An !amdgpu_sriov_vf() guard may be wanted.
  • The new RAS_DEV_INFO line is 105 columns, so checkpatch reports LONG_LINE.

Submission Checklist

🤖 Generated with Claude Code

With unified RAS on MI450 (MP1 15.0.8) every GPU logs
"RAS early init service failure! ret:-95" at driver load.

amdgpu_ttm_init() calls amdgpu_ras_mgr_early_init_service() on every
load to reserve saved bad pages before VRAM is handed out. The service
needs the RAS EEPROM: ras_core_early_init_service_enabled() is false
unless the ASIC supports the service and ras_eeprom_supported is set,
and ras_core_eeprom_early_init_service() then returns -EOPNOTSUPP, which
the caller reports as a failure on every GPU and every load.

Two configurations hit it:
- MP1 13.0.6/12/14 with unified RAS: the early init service is not
  supported there; saved pages are reserved later, at hw_init, so the
  warning is noise.
- MP1 15.0.8 (MI450, unified RAS enabled out of tree, e.g. the amdgpu
  DKMS 7.1.1 package with debug_mask BIT(4)): the service is flagged in
  amdgpu_ras_mgr_create_ras_core(), but the RAS EEPROM is not enabled
  yet (amdgpu_ras_mgr_eeprom_is_supported() lists only MP1 13.0.x), so
  saved pages in the PMFW RAS table are not reserved at all.

Return 0 before calling the service when it is not enabled. When the
ASIC flags the service but the EEPROM is disabled, say so once at info
level instead of reporting a failure. Real failures (-EACCES outside
early init, recovery errors) are still reported.

Enabling the RAS EEPROM for MP1 15.0.8 is left out on purpose: the
early-init record load would convert PMFW records with
umc_v15_convert_ma_to_pa(), which is a stub, before the RAS TA is
loaded, and reserve the wrong pages. On master, unified RAS is not
enabled for MP0 15.0.8, so this change only affects MP1 13.0.x there.

Tested on an AMD Instinct MI450 system (4 GPUs, amdgpu DKMS 7.1.1 with
unified RAS enabled, same hunk backported): the -95 warning goes from
one per GPU to none, each GPU prints the info line once, and RAS
initializes and reports ready on all 4 GPUs.

Signed-off-by: Tapan Patwardhan <tpatward@amd.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@tpatward-amd
tpatward-amd force-pushed the user/tpatward-amd/PLAT-213858 branch 4 times, most recently from bb7f9e4 to 17bf027 Compare October 11, 2026 18:28
@tpatward-amd
tpatward-amd marked this pull request as ready for review October 12, 2026 17:55
@tpatward-amd

Copy link
Copy Markdown
Author

Closing: already fixed upstream.

This warning is already fixed upstream by YiPeng Chai's patch "drm/amd/ras: suppress warning for unsupported early init service" (amd-gfx posting). Tao Zhou reviewed it. It was merged into amd-staging-drm-next as 4e558f67 on 2026-09-28 and is in drm-next as 1c5cac53.

The fix is the same as this PR's. amdgpu_ras_mgr_early_init_service() no longer warns when ras_core_eeprom_early_init_service() returns -EOPNOTSUPP, so the per-GPU RAS early init service failure! ret:-95 line goes away. This PR also returned 0 in that case, but the only caller (amdgpu_ttm_init()) ignores the return value, so that change does nothing.

It is not yet in ROCm/amdgpu master / DKMS 7.1.x; the mirror was last updated 2026-09-21. For PLAT-213858, the remaining step is to cherry-pick 4e558f67 into the DKMS branch the BKC uses.

Neither patch fixes the underlying MI450 gap. The RAS EEPROM is not enabled for MP1 15.0.8, so saved bad pages in the PMFW RAS table are not reserved at load. That needs the MI450 RAS EEPROM bring-up, including the umc_v15_convert_ma_to_pa() stub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant