From ee6debc32de6c87595b5f2276da7752a3e8654c8 Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Fri, 15 Dec 2023 12:44:42 +0200 Subject: [PATCH] mpfs_usb.c: Use kernel memory instead of user memory for DMA DMA directly to user (virtual) memory won't work, as the DMA engine(s) don't do address translations, i.e. they require a physical address. Using kernel heap is fine as it is mapped vaddr=paddr. Also, the USB DMA engine does not have any alignment requirements. --- arch/risc-v/src/mpfs/mpfs_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/mpfs/mpfs_usb.c b/arch/risc-v/src/mpfs/mpfs_usb.c index 36d1d3deab469..a419377b82ed1 100644 --- a/arch/risc-v/src/mpfs/mpfs_usb.c +++ b/arch/risc-v/src/mpfs/mpfs_usb.c @@ -1718,7 +1718,7 @@ static void *mpfs_ep_allocbuffer(struct usbdev_ep_s *ep, uint16_t nbytes) { /* There is not special buffer allocation requirement */ - return kumm_malloc(nbytes); + return kmm_malloc(nbytes); } #endif @@ -1745,7 +1745,7 @@ static void mpfs_ep_freebuffer(struct usbdev_ep_s *ep, void *buf) { /* There is not special buffer allocation requirement */ - kumm_free(buf); + kmm_free(buf); } #endif