USB DMA and RT Kernel

I’m experiencing a problem with the RT kernel and USB DMA, or the lack of it when using a webcam on the BeagleBone Black.

I noticed that both, the CPU load and the RT performance degrades to an unusable level when I plug in and use USB webcam on the Debian Stretch image with RT kernel.

My kernel version is:

$ uname -a
Linux sandybox 4.9.108-bone-rt-r10 #1 PREEMPT RT Thu Jun 14 12:49:42 UTC 2018 armv7l GNU/Linux

I saw one the usb IRQs (irq/202-musb-hd or irq/203-musb-hd) rising to the top of top. Some researched told me that this could be the lack of the USB DMA option being enabled in the kernel.

Are there any options to fix this problem without re-compiling the Linux kernel?

Thanks,
Alexander

Here is a snapshot of top:

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
12304 root 20 0 67924 62956 13936 S 40.2 12.7 0:22.13 rtapi:0
12344 machine+ 20 0 32256 21968 11776 R 17.6 4.4 0:07.81 mkwrapper
86 root -51 0 0 0 0 S 17.4 0.0 7:22.63 irq/203-musb-hd
12324 machine+ 20 0 18300 11136 8276 S 4.7 2.2 0:03.27 hal_temp_ads782
12329 machine+ 20 0 7240 2596 1940 R 4.0 0.5 0:02.32 top
12322 machine+ 20 0 18228 10996 8188 S 3.7 2.2 0:02.87 hal_gpio_mcp230
12343 machine+ 20 0 25632 15500 12956 R 3.7 3.1 0:02.38 milltask
12230 machine+ 20 0 50580 13708 13220 S 2.7 2.8 0:01.92 mjpg_streamer
12323 machine+ 20 0 18292 10936 8132 S 1.2 2.2 0:01.30 hal_pwm_pca9685
11883 machine+ 20 0 8500 2404 1812 S 1.0 0.5 0:00.57 sshd
33 root -51 0 0 0 0 S 0.7 0.0 29:08.61 irq/164-4802a00

Sadly no.. You'll need to rebuild..

diff --git a/patches/defconfig b/patches/defconfig
index 65ce0ab..ca4814f 100644
--- a/patches/defconfig
+++ b/patches/defconfig
@@ -4316,7 +4316,8 @@ CONFIG_USB_MUSB_AM335X_CHILD=y

Okay. What’s the easiest way to build a custom kernel for the BB?

Regards,
Alexander