Comment 14 for bug 1823753

Revision history for this message
dann frazier (dannf) wrote :

Why would it fail to init? If CMA allocation fails, the kernel will fulfill the request using alloc_pages_node():

struct page *__dma_direct_alloc_pages(struct device *dev, size_t size,
  dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs)
{
[...]
 /* CMA can be used only in the context which permits sleeping */
 if (gfpflags_allow_blocking(gfp)) {
  page = dma_alloc_from_contiguous(dev, count, page_order,
       gfp & __GFP_NOWARN);
  if (page && !dma_coherent_ok(dev, page_to_phys(page), size)) {
   dma_release_from_contiguous(dev, page, count);
   page = NULL;
  }
 }
 if (!page)
  page = alloc_pages_node(dev_to_node(dev), gfp, page_order);
[...]
}