summaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-gadget.h
diff options
context:
space:
mode:
authorSanket Parmar <sparmar@cadence.com>2021-03-22 11:26:30 +0100
committerPeter Chen <peter.chen@kernel.org>2021-04-12 20:19:22 +0800
commit8430e98f2c877e2034e5a5adaa6bf0b4a3041e1d (patch)
tree0ec0f483c7e0f20b07da649264047c6596462877 /drivers/usb/cdns3/cdns3-gadget.h
parentb9b1eae761eeae665824ca6ef7f91da4fc798ebb (diff)
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 <a-govindraju@ti.com> Signed-off-by: Sanket Parmar <sparmar@cadence.com> Signed-off-by: Peter Chen <peter.chen@kernel.org>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-gadget.h')
-rw-r--r--drivers/usb/cdns3/cdns3-gadget.h2
1 files changed, 2 insertions, 0 deletions
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 <linux/usb/gadget.h>
+#include <linux/dma-direction.h>
/*
* 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;
};