nvidia: fix shadowed agent usb disconnect + suppress teardown replug prompts - #283
Open
lee-reinhardt wants to merge 2 commits into
Open
nvidia: fix shadowed agent usb disconnect + suppress teardown replug prompts#283lee-reinhardt wants to merge 2 commits into
lee-reinhardt wants to merge 2 commits into
Conversation
…connect the wrynose bsp rebase re-imported upstream copies of seven helper functions without removing the agent-aware block, so the later definitions won at runtime. the live disconnect_usb_device was the plain sysfs-only copy, leaving _twiddle_via_agent (and the device-gone idempotency guard) as dead code: provisioning inside the avocado-vm would hang at the first cable-cycle point with no prompt, since the authorized toggle is a no-op through vhci_hcd. six of the seven pairs were byte-identical modulo whitespace; only disconnect_usb_device differed, by exactly the agent path. keep the agent-aware copy and delete the shadowing duplicates.
port of the twiddle-dedup fix from scarthgap (#277), adapted to the wrynose t234/t264 split. the teardown releases in get_final_status_t234 and the end-of-script lingering-device deauthorize ran after flashing completed, so each agent request aged out the host's 120s replug waiter before falling back to the sysfs toggle, adding dead wait to every successful provision. a new optional no-prompt mode on disconnect_usb_device (threaded through unmount_and_release) keeps those call sites on the free sysfs path. the reuse-cycle mode from #277 is intentionally not ported: the back-to-back double disconnect in generate_flash_package that needed it does not exist in the wrynose flow. also print an ACTION NEEDED line before blocking on the agent so cli-driven provisions surface the replug prompt in the terminal instead of stalling silently. with AVOCADO_AGENT_SOCK unset, every call site behaves exactly as before in all modes.
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.
Problem
The wrynose BSP rebase re-imported upstream copies of seven
initrd-flash.shhelper functions without removing the agent-aware block grafted at the top of the file. Bash keeps the later definition, so the livedisconnect_usb_devicewas the plain sysfs-only copy and_twiddle_via_agent(plus the device-gone idempotency guard) was dead code. Any provision running inside the avocado-vm would hang at the first cable-cycle point with no prompt anywhere, since theauthorized=0toggle is a no-op through vhci_hcd.Separately, the teardown-prompt fix from #277 (scarthgap) had not been ported, so once the agent path is live again, the releases in
get_final_status_t234and the end-of-script lingering-device deauthorize would each age out the host's 120s replug waiter after flashing already completed.Change
Commit 1 — remove the duplicates. Six of the seven pairs are byte-identical modulo whitespace; only
disconnect_usb_devicediffers, by exactly the agent path and the device-gone guard. Keep the agent-aware copy, delete the shadowing re-imports. Pure deletion, −202 lines.Commit 2 — port the relevant half of #277:
disconnect_usb_devicegains an optionalno-promptmode (threaded throughunmount_and_release): teardown/cleanup releases never engage the agent, keeping only the free sysfs toggle. Applied toget_final_status_t234's release and the end-of-script deauthorize._twiddle_via_agentprintsACTION NEEDED: unplug and replug the device's USB cable to continue provisioningto stderr before blocking, so CLI-driven provisions surface the prompt in the terminal instead of stalling silently.reuse-cyclemode from nvidia: suppress redundant usb twiddle prompts in initrd-flash #277 is intentionally not ported: the back-to-back double disconnect ingenerate_flash_packagethat required it does not exist in the wrynose flow.With
AVOCADO_AGENT_SOCKunset (bare Linux / CI), every call site behaves exactly as before in all modes.Validation
bash -nclean; no duplicate function definitions remain (verified by scan)._twiddle_via_agent/disconnect_usb_device/unmount_and_releaseextracted from this file, fake agent on a real AF_UNIX socket): mode threading, device-gone idempotency, prompt emission, and no-agent parity all pass.