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 ?
Hi,
When the API that is registered for the probe gets called by the device driver sub-system, 'struct pci_dev *pdev) is passed to that API and ‘&pdev->dev’ can be passed to dma_alloc_coherent() API
You can this code for both with-SMMU and without-SMMU cases
FWIW, pVirt being NULL is not expected. It looks like there is some issue with the dev pointer you are passing to dma_alloc_coherent() API in your code. Please correct that.