linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] usb: gadget: functionfs: DMABUF import interface
@ 2023-03-14 10:52 Paul Cercueil
  2023-03-14 10:52 ` [PATCH 1/2] usb: gadget: Support already-mapped DMA SGs Paul Cercueil
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Paul Cercueil @ 2023-03-14 10:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Sumit Semwal, Christian König
  Cc: michael.hennerich, nuno.sa, linux-usb, linux-kernel, linux-media,
	dri-devel, linaro-mm-sig, Paul Cercueil

Hi,

This small patchset adds three new IOCTLs that can be used to attach,
detach, or transfer from/to a DMABUF object.

This was surprisingly easy to add, as the functionfs code only uses
scatterlists for transfers and allows specifying the number of bytes to
transfer. The bulk of the code is then for general DMABUF accounting.

The patchset isn't tagged RFC but comments are very welcome, there are
some things I am not 100% sure about: ffs_dma_resv_lock (with no
ww_acquire_ctx), and I'm using pr_debug which feels wrong. Also, I
should probably add documentation? The current IOCTLs for functionfs
were not documented, as far as I can tell.

We use it with DMABUFs created with udmabuf, that we attach to the
functionfs interface and to IIO devices (with a DMABUF interface for
IIO, on its way to upstream too), to transfer samples from high-speed
transceivers to USB in a zero-copy fashion.

Cheers,
-Paul


Paul Cercueil (2):
  usb: gadget: Support already-mapped DMA SGs
  usb: gadget: functionfs: Add DMABUF import interface

 drivers/usb/gadget/function/f_fs.c  | 398 ++++++++++++++++++++++++++++
 drivers/usb/gadget/udc/core.c       |   7 +-
 include/linux/usb/gadget.h          |   2 +
 include/uapi/linux/usb/functionfs.h |  14 +-
 4 files changed, 419 insertions(+), 2 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-19 11:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-14 10:52 [PATCH 0/2] usb: gadget: functionfs: DMABUF import interface Paul Cercueil
2023-03-14 10:52 ` [PATCH 1/2] usb: gadget: Support already-mapped DMA SGs Paul Cercueil
2023-03-14 10:52 ` [PATCH 2/2] usb: gadget: functionfs: Add DMABUF import interface Paul Cercueil
2023-03-14 11:59   ` Christian König
2023-03-19 11:54     ` Paul Cercueil
2023-03-14 13:41   ` kernel test robot
2023-03-14 13:45     ` Paul Cercueil
2023-03-15  4:10   ` kernel test robot
2023-03-15  8:36   ` kernel test robot
2023-03-15 21:36   ` kernel test robot
2023-03-14 12:01 ` [PATCH 0/2] usb: gadget: functionfs: " Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).