phys_addr_t instead of dma_addr_t for nvme_dev->cmb_dma_addr

Max Gurtovoy maxg at mellanox.com
Thu Jan 5 02:20:19 PST 2017


hi Guys,
we have noticed that in drivers/nvme/host/pci.c we have the following lines:

"
dma_addr = pci_resource_start(pdev, NVME_CMB_BIR(dev->cmbloc)) + offset;
cmb = ioremap_wc(dma_addr, size);
if (!cmb)
     return NULL;

dev->cmb_dma_addr = dma_addr;
dev->cmb_size = size;

"

in nvme_map_cmb func. pci_resource_start should return resource_size_t 
(phys_addr_t) and not dma_addr_t. I don't have the HW to check this code 
and propose a fix but it's seems buggy for me. In case we need dma 
address we should map it.

thanks,
Max.



More information about the Linux-nvme mailing list