]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: core: add dma-noncoherent buffer alloc and free API
authorXu Yang <xu.yang_2@nxp.com>
Fri, 4 Jul 2025 09:57:49 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2025 10:15:56 +0000 (12:15 +0200)
commit488e6eaab88cfa4b6fd2e2bb72fac9cfdc8c403b
tree673c1af8fdcfedf82f0f64d06f986bf11282eb48
parentd1b07cc0868fe14f4540cbc48c1a7c1a8055e284
usb: core: add dma-noncoherent buffer alloc and free API

This will add usb_alloc_noncoherent() and usb_free_noncoherent()
functions to support alloc and free buffer in a dma-noncoherent way.

To explicit manage the memory ownership for the kernel and device,
this will also add usb_dma_noncoherent_sync_for_cpu/device() functions
and call it at proper time.  The management requires the user save
sg_table returned by usb_alloc_noncoherent() to urb->sgt.

Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250704095751.73765-2-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hcd.c
drivers/usb/core/usb.c
include/linux/usb.h