Repository navigation
Conversation
sharkwouter
approved these changes
Oct 27, 2026
fjtrujy
force-pushed
the
fix/psp-async-receive-lifecycle
branch
from
October 29, 2026 08:58
33775b2 to
bd55cc8
Compare
Distinguish successful empty completions, cancelled receive requests and retryable errors. Handle detach before async completion, verify USB state before rearming, and retry transient failures through timed event waits without blocking attach/detach processing. Validate receive bounds, mark connected only after successful initial submission and fix event flag cleanup during module shutdown.
fjtrujy
force-pushed
the
fix/psp-async-receive-lifecycle
branch
from
October 29, 2026 09:08
bd55cc8 to
47a5d87
Compare
This branch has not been deployed
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.
Scope
This PR isolates PSP asynchronous USB receive lifecycle and cleanup from the earlier combined #72.
retcode == -3as cancellation (per PSPSDK), not as a transient I/O error; clear the connected state and wait for the usual attach/HELLO handshake instead of resubmitting on a cancelled endpoint.sceKernelDelayThread. Detach/attach events remain serviceable while waiting.sceUsbbdReqRecv()submission while the USB bus remains connected, rather than logging once and permanently losing the receiver.sceUsbGetState() & PSP_USB_CONNECTION_ESTABLISHEDbefore queueing new work.Verification
make -C usbhostfs -j4with the installed PSP SDK: passes.make -C tests test: existing host C regression passes.git diff --check: passes.masterso already merged directory, host handle and PSP bulk-transfer fixes are not reverted or duplicated.Remaining validation
The revised cancelled/error/zero-length completion logic has not been tested on a physical PSP yet. In particular we need to exercise USB disconnect/reconnect, error and cancellation behavior. Build success and a host-side test do not validate the PSP's kernel USB request lifecycle.
The independently investigated long-idle hang remains tracked in #74; this PR does not claim to fix its root cause. Please re-review the revised async error handling before merging.