Improve periodic USB transfers (device intr, isoc) used for input
authormglocker <mglocker@openbsd.org>
Sun, 4 Sep 2022 08:42:39 +0000 (08:42 +0000)
committermglocker <mglocker@openbsd.org>
Sun, 4 Sep 2022 08:42:39 +0000 (08:42 +0000)
commita9beb1ed4245313a4b68e10ec33a67c806523ec4
tree34004680228578446ffe48012f2c80e7aa0f4586
parentf804e549ecb56bd1874f9a205fb3830bd480dbca
Improve periodic USB transfers (device intr, isoc) used for input
devices, audio, and video.  It's still not perfect, and will need
further improvements.

High level, the diff contains following changes:

* Sync up with the Linux code base, which did re-work the periodic
  scheduling code path.
* Run the driver in IPL_VM instead of IPL_USB to prioritize us before
  lower/equal interrupts (same what NetBSD does).
* Add two new flags to our USB stack required by the updated driver
  code:
  - 'multi' flag in the usbd_hub structure to keep track whether
    a hub has one Transaction Translator for all ports (single TT)
    or one Transaction Translator per port (multi TT).
  - 'hcpriv' pointer in the usbd_tt structure for the HC driver to
    allocate memory for the scheduling depending on single or multi TT.

"go for it" kettenis@
19 files changed:
sys/arch/octeon/dev/octdwctwo.c
sys/dev/fdt/bcm2835_dwctwo.c
sys/dev/usb/dwc2/dwc2.c
sys/dev/usb/dwc2/dwc2.h
sys/dev/usb/dwc2/dwc2_core.c
sys/dev/usb/dwc2/dwc2_core.h
sys/dev/usb/dwc2/dwc2_coreintr.c
sys/dev/usb/dwc2/dwc2_hcd.c
sys/dev/usb/dwc2/dwc2_hcd.h
sys/dev/usb/dwc2/dwc2_hcdddma.c
sys/dev/usb/dwc2/dwc2_hcdintr.c
sys/dev/usb/dwc2/dwc2_hcdqueue.c
sys/dev/usb/dwc2/dwc2_hw.h
sys/dev/usb/dwc2/dwc2_params.c [new file with mode: 0644]
sys/dev/usb/dwc2/dwc2var.h
sys/dev/usb/dwc2/files.dwc2
sys/dev/usb/dwc2/gcd.h [new file with mode: 0644]
sys/dev/usb/uhub.c
sys/dev/usb/usbdivar.h