PlatformRequestHandler: skip system limit update during init - #1402
Open
SammyTourani wants to merge 1 commit into
Open
SammyTourani wants to merge 1 commit into
SammyTourani wants to merge 1 commit into
Conversation
pfmreqhndlrInitSensors() calls _pfmreqhndlrCallPshareStatus() with bInit set before PSHAREPARAMS has set up the TGPU and PPMD limit counters. When the SBIOS reports UPDATE_LIMIT pending at that point, the bSystemParamLimitUpdate block looks up both counters, gets NV_ERR_INVALID_DATA and logs two assertion failures on every driver load. Both limits are read later in init, once the counters exist. Handle a pending system limit update only at runtime, as the EDPpeak and user configurable TGP blocks in the same function already do.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1360
At boot,
pfmreqhndlrInitSensors()calls_pfmreqhndlrCallPshareStatus(pPlatformRequestHandler, NV_TRUE)before PSHAREPARAMS has set up the TGPU and PPMD limit counters. If the SBIOS reportsUPDATE_LIMITpending in that PSHARESTATUS reply, thebSystemParamLimitUpdateblock calls_pfmreqhndlrUpdateTgpuLimit()and_pfmreqhndlrUpdatePpmdLimit(). Both look up counters that don't exist yet, getNV_ERR_INVALID_DATA, and log the two assertion failures quoted in #1360 on every driver load. #1310 and #1393 quote the same lines. At that point the block can do nothing else: both lookups fail before any_DSMcall or GSP control. Init already reads both limits once the counters exist.pfmreqhndlrInitSensors()samples PPMD right after registering it. The TGPU limit is applied by_pfmreqhndlrThermPmuPostInitWorkItem()(GPS 2.x) or bypfmreqhndlrStateLoad()(1.x).This change adds
&& !bInitto that block, which the EDPpeak and user-configurable-TGP blocks in the same function already have. A pending system limit update is therefore handled only at runtime.bSystemParamLimitUpdateis rewritten from every PSHARESTATUS reply before it is read, so leaving it set after init has no effect. This is the fix proposed in #1360.Verification
I had no affected laptop, so nothing here ran on hardware.
I built the unmodified
platform_request_handler.candplatform_request_handler_ctrl.c, plusnvassert.candnvstatus.c, into a userspace test program. It simulates the SBIOS GPS_DSM(SUPPORT, PSHARESTATUS, PSHAREPARAMS, PCONTROL) and the GSP-RM side of the PRH internal controls. The only other external symbols are small fakes: timer, GPU manager, memory helpers and printing. Each scenario is a driver load followed by a runtime limit change:pfmreqhndlrStateInit(), the GSPPFM_REQ_HNDLR_STATE_SYNCcallbacks, the queued work items, thenpfmreqhndlrStateLoad().pfmreqhndlrControl(DATA_INIT_USING_SBIOS_AND_ACK).The scenarios are GPS 2.x with UPDATE_LIMIT pending at boot, GPS 2.x with nothing pending, and GPS 1.x with UPDATE_LIMIT pending. The checks are: no assertion failures, the SBIOS TGPU limit reaches GSP-RM at load and after the runtime change, and on 2.x the platform power mode is cached at load and notified after the runtime change.
On 615.71.09 the harness prints the two assert lines above (one on 1.x), and 2 of 16 checks fail. With this change there are no asserts and 16 of 16 checks pass. Apart from the removed assert lines, the two runs are identical: every
_DSMcall with its arguments, every GSP-RM control, the PLATFORM_POWER_MODE_CHANGE events, the counter and PPM state, and the TGPU limits applied (87 C at load, 80 C at runtime). The one other difference isbSystemParamLimitUpdate, which stays set after load. The next PSHARESTATUS reply rewrites it before anything reads it.Command:
./verify.sh <checkout> 61dcc937 HEAD(builds the harness fromgit archiveof each revision, runs it, diffs the logs)Result:
I compiled
platform_request_handler_ctrl.cwith the exact command printed bymake -n -C src/nvidia TARGET_OS=Linux TARGET_ARCH=x86_64 CC=clang, run asclang --target=x86_64-linux-gnu.Command:
clang --target=x86_64-linux-gnu <flags from make -n> -c platform_request_handler_ctrl.c, run on the file before and after the change.Result: exit 0 with 0 warnings and 0 errors in both cases. Only
_pfmreqhndlrCallPshareStatuschanges in the object. It gains one test ofbInit, and the other 40 functions are identical.