Hello everyone,I'm taking another stab at fixing the DMA bug in the sur40 driver which has been present for some time now.
The bug was introduced as a side effect of this commit: https://github.com/torvalds/linux/commit/6eb0233ec2d0df288fe8515d5b0b2b15562e05bb
The sur40 is a bit of an odd duck which uses USB bulk transfers for video data, so AFAICT there is no other driver I could use as an example for this combination.
I've tried the following variants: - videobuf2-dma-sg (this is the currently broken in-kernel version): Fails with error -22 (EINVAL) in usb_sg_init, because sgt->nents is 0. Can't tell what the root cause is, but based on the message of the breaking commit, I would assume that using dma-sg directly for USB devices is simply not supported? - videobuf2-vmalloc: Fails with dmesg error: ehci-pci: rejecting DMA map of vmalloc memory (this is sort of understandable, I guess, just wanted to be sure). - videobuf2-dma-contig: Fails with dmesg error: dma alloc of size 520192 failed. This seems quite low, it shouldn't be an issue to map 500k of contiguous memory somewhere?So, in summary, my question is: how should I use the videobuf2 framework to get USB bulk data into V4L2 buffers as efficiently as possible? Because it does seem that none of the "obvious" solutions works...
Thank you and best, Florian -- SENT FROM MY DEC VT50 TERMINAL
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature