diff options
author | Ian Moffett <industrial.reformer@gmail.com> | 2024-04-03 17:19:48 -0400 |
---|---|---|
committer | Ian Moffett <industrial.reformer@gmail.com> | 2024-04-03 17:19:48 -0400 |
commit | f0275f1b2364648f26bbfcd58ab6a214d4ab1827 (patch) | |
tree | cc5620937df923754605c2ddb29596af23fd0a28 /sys/dev/usb | |
parent | 2af8c13347888c910a89563627b76a4c0cde5ed6 (diff) |
kernel: xhci: Fix cycle bit handling
Set cycle bit initially to 1, invert cycle bit after submitting command
to command ring.
Signed-off-by: Ian Moffett <industrial.reformer@gmail.com>
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/xhci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 90d37fe..a433fb9 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -112,6 +112,7 @@ xhci_submit_cmd(struct xhci_hc *hc, struct xhci_trb trb) /* Push the TRB to the command ring */ cmd_db = XHCI_CMD_DB(hc->base, caps->dboff); hc->cmd_ring[hc->cmd_ptr++] = trb; + hc->cycle = ~hc->cycle; /* Wrap if needed */ if (hc->cmd_ptr >= XHCI_CMDRING_LEN) { @@ -368,7 +369,7 @@ xhci_init_hc(struct xhci_hc *hc) } /* Set cmdring state */ - hc->cycle = 0; + hc->cycle = 1; hc->cmd_ptr = 0; /* Allocate resources and tell the HC about them */ |