From 8430e98f2c877e2034e5a5adaa6bf0b4a3041e1d Mon Sep 17 00:00:00 2001 From: Sanket Parmar Date: Mon, 22 Mar 2021 11:26:30 +0100 Subject: usb: cdns3: Optimize DMA request buffer allocation dma_alloc_coherent() might fail on the platform with a small DMA region. To avoid such failure in cdns3_prepare_aligned_request_buf(), dma_alloc_coherent() is replaced with dma_alloc_noncoherent() to allocate aligned request buffer of dynamic length. Reported-by: Aswath Govindraju Signed-off-by: Sanket Parmar Signed-off-by: Peter Chen --- drivers/usb/cdns3/cdns3-gadget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/usb/cdns3/cdns3-gadget.h') diff --git a/drivers/usb/cdns3/cdns3-gadget.h b/drivers/usb/cdns3/cdns3-gadget.h index ecf9b91ccbb9..c5660f2c4293 100644 --- a/drivers/usb/cdns3/cdns3-gadget.h +++ b/drivers/usb/cdns3/cdns3-gadget.h @@ -12,6 +12,7 @@ #ifndef __LINUX_CDNS3_GADGET #define __LINUX_CDNS3_GADGET #include +#include /* * USBSS-DEV register interface. @@ -1205,6 +1206,7 @@ struct cdns3_aligned_buf { void *buf; dma_addr_t dma; u32 size; + enum dma_data_direction dir; unsigned in_use:1; struct list_head list; }; -- cgit v1.2.3