mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
* gv100/hbm: log every HBM2 session outcome, not only a verified unlock
On a CMP 100-210 (10de:1df4, 12 GB) FBPA 0..=3 answer with a PRI bus
error, so survey_gv100_hbm() refuses the card. HbmSession::begin() then
returns FailedRolledBack in state SurveyFailed, and pmu_bringup only
logged the Unlocked case: v100_hbm_ndiv=82 did nothing and dmesg said
nothing. The session is write-inhibited from then on, so a later sysfs
write to v100_hbm_ndiv was dropped without a line as well. A PLL that
would not take the new NDIV and was rolled back was equally silent, and
indistinguishable from the survey failure in HbmUnlockStatus.
Core (hbm_clock.rs):
- survey_gv100_hbm_checked() does the same reads in the same order as
survey_gv100_hbm() and returns the first failed check as an
HbmSurveyFault { kind, fbpa, value }: canary mismatch, cfg or coeff
unreadable, PLL not locked, coeff mismatch. survey_gv100_hbm() is now
its .ok(); HbmSession keeps the fault of the start survey.
- HbmSession::outcome() names what a start or live step did: Disabled,
NonStockPll, AlreadyAtTarget, Unlocked, SurveyFailed, RolledBack,
ClockUnknown, WriteInhibited.
Kernel glue (pmu_bringup.rs, gpu_owner.c): every start outcome other
than Unlocked, every live step that does not end in a verified new
clock, and a sysfs write dropped by a write-inhibited session now go to
nv_rs_hbm_clock_outcome_log(). The survey line carries the partition
and raw word, e.g. "survey failed (FBPA 0 PLL config unreadable
(0xbadf2010))". Requested-but-failed outcomes are pr_warn, an
unverified rollback is pr_err, the rest pr_info. The existing unlock
and backoff lines are unchanged. No register is read or written that
was not read or written before.
This reports the failure; it does not make the survey accept a card
with fused-off FBPAs. The GP100/GA100 MultiGenHbmSession path is not
touched.
Tests (host): hbm_survey_reports_the_first_failed_check and
hbm_session_outcome_names_every_start_and_step_result, the latter with
the #399 register values (FBPA 0..=3 = 0xbadf2010, 4..=15 cfg 0x29,
coeff 0x14102) and a PLL mock that drops or loses lock on a write. On
master they do not compile: HbmOutcome, HbmSurveyFault and
HbmSession::outcome do not exist.
Not run: QEMU EDU guest tests (need sudo here), any GPU.
Refs #399
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* gv100/hbm: keep the failed phase in the logged HBM2 outcome
Review of #451 found three session results that were logged as something
else. A start or step whose target did not lock, whose rollback was
verified, and whose survey after the rollback then failed was reported as
"the rollback could not be verified". A survey that refused the card
before any PLL write was reported as "did not lock or read back; rolled
back" when the survey after it passed. And a start whose PMC_BOOT_0
canary read failed right after a good baseline survey was reported as
"PLL is not at a stock coefficient".
The unlock and step helpers now hand the session the read that stopped
them before a write, taken from the reads they already do, so the
register access order is unchanged. A refusal before any write puts the
session in SurveyFailed with that fault. A verified rollback followed by
a failed survey is the new outcome RolledBackSurveyLost (8): the clock
stays unknown and writes stay inhibited, and the log names the survey
fault. A failed canary is the new outcome CanaryFailed (9); NonStockPll
is left for a coefficient the unlock really rejected. The public
unlock_gv100_hbm and set_gv100_hbm_ndiv signatures and results are the
same as before.
Three host tests script the failing read with a mock and fail on the
previous commit.
Refs #399
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* gv100/hbm: keep a canary refusal before the target write out of RolledBack
program_coeff checks the PMC_BOOT_0 canary before it writes the target
coefficient. When that check failed, the caller still ran the rollback
(which rewrites the unchanged baseline), and a verified rollback was then
logged as "did not lock or read back; rolled back", although the target
was never written.
program_coeff now returns the canary fault when it refuses before the
write. unlock_gv100_hbm_noted and set_gv100_hbm_ndiv_noted run the same
rollback as before and pass that fault on, so HbmSession reports the step
as SurveyFailed with the CanaryMismatch fault (the existing "refused
before the target write" path) instead of RolledBack. Register accesses
and their order are unchanged; the public functions keep their
signatures. A host test fails the canary once, just before the target
write, for both the initial unlock and a live step, and checks that the
rollback succeeds and the outcome is SurveyFailed, not RolledBack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* gv100/hbm: say "target coefficient not written" for a survey refusal
The SurveyFailed log line said "clock not touched". Since a canary
refusal just before the target write is reported as SurveyFailed, and
the rollback in that path still rewrites the unchanged baseline
coefficient, that was true of the clock value but not of every PLL
register write. The line now says "target coefficient not written",
which holds in every SurveyFailed case, and the HbmOutcome::SurveyFailed
doc comment says the same.
Log text and a doc comment only; no change to register access, session
state or outcome mapping.
Refs #399
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* gv100/hbm: classify a refused baseline restoration by its skip reason
outcome() reported Disabled whenever the v100_hbm_ndiv value was 0, but
on_user_write(0) with a surveyed baseline steps to the baseline NDIV; a
non-stock coefficient refuses that with Skipped and no fault, and the log
then said "disabled" instead of the refusal. The session now records the
NDIV each start or step acted on (target_ndiv), and outcome() reserves
Disabled for a zero effective target; its requested_ndiv argument, which
only approximated that, is gone.
Test: start at MDIV 3 / NDIV 65, request 80 (rejected), then 0 (baseline
restore, rejected) -> NonStockPll. It fails if step_to stops recording
the target.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Co-authored-by: Scott <scottbphone12@gmail.com>