usb: fix freeze on sync commit for inactive pipes

Performing an asynchronous commit on an inactive pipe would yield
USB_COMMIT_INACTVE and *not* invoke the callback (as intended),
which usb_commit_sync() ignored, causing a freeze.

This issue appeared after a world switch, which (for reasons not yet
known) appear to fail the first writes until a commit, and that commit
would then hit an inactive pipe.
This commit is contained in:
Lephe 2022-11-11 17:47:29 +01:00
parent bbda77769d
commit d110ab608e
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 4 additions and 1 deletions

View File

@ -401,7 +401,10 @@ void usb_commit_sync(int pipe)
while(rc == USB_COMMIT_BUSY);
/* Wait until the commit completes */
while(!flag) sleep();
if(rc == 0)
{
while(!flag) sleep();
}
}
/* usb_pipe_write_bemp(): Callback for the BEMP interrupt on a pipe */