What is the right way to allocate a buffer that will be used for DMA from PCI device ?
I tried the following code:
dma_addr_t dma_handle; int size=8192; void *pVirt; pVirt = dma_alloc_coherent (&pdev.dev, size, &dma_handle, GFP_KERNEL);
and got: pVirt = NULL.
This code runs upon ioctl request from user space.
Should I set the value of “dev” ? How ?
Can I use the above code without disabling SMMU in device tree ?