usb: gadget: functionfs: Wait for fences before enqueueing DMABUF
authorPaul Cercueil <paul@crapouillou.net>
Tue, 2 Apr 2024 11:09:51 +0000 (13:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Apr 2024 13:20:30 +0000 (15:20 +0200)
commit862b416560c348f66d2091c56e71fd5462510cab
tree5d1a3e4253c7362acd87880a56495f2a2524a2cd
parent1500a7b2794d46beadd408132ddb5ef669c5c057
usb: gadget: functionfs: Wait for fences before enqueueing DMABUF

Instead of bailing when fences have already been installed on the
DMABUF, wait for them (with a timeout) when doing a blocking operation.

This fixes the issue where userspace would submit a DMABUF with fences
already installed, with the (correct) expectation that it would just
work.

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-3-paul@crapouillou.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/f_fs.c