serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Kernel/USB: Reorganize UHCI schedule structure

Open b14ckcat opened this issue 3 years ago • 1 comments

Currently in the UHCI code, when a queued (interrupt/bulk/control) transfer is submitted, it will attach itself to the corresponding queue head which is linked into the schedule for execution by the hardware controller, overwriting any previous transfers that are occupying that memory spot. This means only one transfer of each type can be executed simultaneously, and also opens the door to other problems like memory leaks and transfers that never complete. The first commit fixes this by transforming the schedule as set up by the software into a linked list with sentinel values ("anchors") to insert new transfers in front of as needed, while maintaining the correct transfer type ordering. When a transfer & transfer descriptor chain is created, it is also allocated a queue head to link to it and link into the schedule list. The second commit further prepares the schedule for the implementation of interrupt transfers, which are up next after async transfers. It creates several separate interrupt queue head anchors, each designated a different power-of-two latency between 2^0 and 2^10 milliseconds, to allow for interrupt transfers with different execution periods to be queued up.

b14ckcat avatar Jul 25 '22 01:07 b14ckcat

Hello!

One or more of the commit messages in this PR do not match the SerenityOS code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why. Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.

BuggieBot avatar Jul 25 '22 01:07 BuggieBot

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions!

stale[bot] avatar Aug 15 '22 10:08 stale[bot]

Not stale :)

b14ckcat avatar Aug 15 '22 16:08 b14ckcat