dwc_otg interrupt rate
I was looking through some of the processes on my RevPi Connect+ and I noticed the interrupt handler for the dwc_otg driver occurs about 300 times per second. Comparing this to other Pi based devices, the interrupt occurs between 1000 - 8000 times per second. What is different on the Connect+ that reduces this rate so much lower and how do the USB devices continue to work (such as the ethernet ports)?
I found a setting that affects the dwc_otg interrupt rate. In the file /boot/cmdline.txt , if it contains this "dwc_fiq_enable=N" the interrupt rate approximately triples.
Right, the driver for the USB host controller (dwc_otg) uses the FIQ (Fast Interrupt) to handle the about 8000 SOF interrupts occurring per second, which improves performance. If you disable this feature or use the dwc2 driver instead of dwc_otg, you'll see more interrupts and higher CPU load. The feature was added to the dwc_otg driver by the Raspberry Pi Foundation, however they only added it to the out-of-tree dwc_otg driver, not the dwc2 driver in the mainline kernel. We use the Foundation's kernel as a basis, hence benefit from the feature as well. Unfortunately the Foundation doesn't test it with realtime kernels, so whenever we upgrade to a newer kernel, we have to debug and fix incompatibilities between dwc_otg and the RT patches.
If I were to build a Kernel using the Kernel Bakery on GitHub and re-flash the Connect+ , would it have the fixes or do those fixes only exist on the factory image?
Yes, from https://github.com/RevolutionPi you can get the stable version for Connect+, which is revpi-4.9.
The factory image is also built from source code of this repository.
The factory image is also built from source code of this repository.
Simon