]> git.baikalelectronics.ru Git - kernel.git/commit
usb: cdns3: Optimize DMA request buffer allocation
authorSanket Parmar <sparmar@cadence.com>
Mon, 22 Mar 2021 10:26:30 +0000 (11:26 +0100)
committerPeter Chen <peter.chen@kernel.org>
Mon, 12 Apr 2021 12:19:22 +0000 (20:19 +0800)
commit511e0cc7b1cfb2d20fc03adc8cbac13f7a296478
tree0ec0f483c7e0f20b07da649264047c6596462877
parentd44bbfd3a52fa325e8c8b7b528d42d482258162d
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>
drivers/usb/cdns3/cdns3-gadget.c
drivers/usb/cdns3/cdns3-gadget.h