diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 00e9e79b6cb8..0cf1b787f4c9 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -800,7 +800,10 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, *handle = DMA_ERROR_CODE; allowblock = gfpflags_allow_blocking(gfp); cma = allowblock ? dev_get_cma_area(dev) : false; - +#ifdef CONFIG_AMLOGIC_CMA + if (!!(gfp & __GFP_BDEV)) + cma = false; +#endif if (cma) buf->allocator = &cma_allocator; else if (nommu() || is_coherent) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 7c7a79851489..7d5ae4b86f80 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1780,7 +1780,12 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev, * process context, not interrupt context (or so documenation * for usb_set_interface() and usb_set_configuration() claim). */ +#ifdef CONFIG_AMLOGIC_CMA + if (xhci_endpoint_init(xhci, virt_dev, udev, ep, + GFP_NOIO | __GFP_BDEV) < 0) { +#else if (xhci_endpoint_init(xhci, virt_dev, udev, ep, GFP_NOIO) < 0) { +#endif dev_dbg(&udev->dev, "%s - could not initialize ep %#x\n", __func__, ep->desc.bEndpointAddress); return -ENOMEM;