usb: gadget: functionfs: Fix inverted DMA fence direction
authorPaul Cercueil <paul@crapouillou.net>
Tue, 2 Apr 2024 11:09:50 +0000 (13:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 13:20:30 +0000 (15:20 +0200)
commit1500a7b2794d46beadd408132ddb5ef669c5c057
tree34fab47223c741728fe947592e0e788d6c957b18
parentce4c8d21054ae9396cd759fe6e8157b525616dc4
usb: gadget: functionfs: Fix inverted DMA fence direction

A "read" fence was installed when the DMABUF was to be written to,
and a "write" fence was installed when the DMABUF was to be read from.

Besides, dma_resv_usage_rw() should only be used when waiting for
fences.

Fixes: 7b07a2a7ca02 ("usb: gadget: functionfs: Add DMABUF import interface")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20240402110951.16376-2-paul@crapouillou.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c