]> git.ipfire.org Git - thirdparty/linux.git/commit
usb: gadget: f_fs: fix DMA-BUF OUT queues
authorSam Day <me@samcday.com>
Wed, 7 Jan 2026 22:30:21 +0000 (08:30 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jan 2026 14:58:22 +0000 (15:58 +0100)
commit0145e7acd29855dfba4a2f387d455b5d9a520f0e
treef046815254f74fea8e8f3e34322ec2b19307a410
parent8e4c1d06183c25022f6b0002a5cab84979ca6337
usb: gadget: f_fs: fix DMA-BUF OUT queues

Currently, DMA_FROM_DEVICE is used when attaching DMABUFs to IN
endpoints and DMA_TO_DEVICE for OUT endpoints. This is inverted from
how it should be.

The result is IOMMU read-only mappings placed on OUT queues,
triggering arm-smmu write faults.

Put differently, OUT endpoints flow data from host -> gadget, meaning
the UDC peripheral needs to have write access to the buffer to fill it
with the incoming data.

This commit flips the directions and updates the implicit-sync helpers
so IN endpoints act as readers and OUT endpoints as writers.

Signed-off-by: Sam Day <me@samcday.com>
Tested-by: David Heidelberg <david@ixit.cz> # OnePlus 6T on sdm845-next-20251119
Link: https://patch.msgid.link/20260108-ffs-dmabuf-ioctl-fix-v1-2-e51633891a81@samcday.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c