@@ -1497,7 +1497,8 @@ void debug_dma_alloc_coherent(struct device *dev, size_t size,
entry->type = dma_debug_coherent;
entry->dev = dev;
- entry->pfn = page_to_pfn(virt_to_page(virt));
+ entry->pfn = is_vmalloc_addr(virt) ? vmalloc_to_pfn(virt) :
+ page_to_pfn(virt_to_page(virt)),
entry->offset = offset_in_page(virt);
entry->size = size;
entry->dev_addr = dma_addr;
@@ -1513,7 +1514,8 @@ void debug_dma_free_coherent(struct device *dev, size_t size,
struct dma_debug_entry ref = {
.type = dma_debug_coherent,
.dev = dev,
- .pfn = page_to_pfn(virt_to_page(virt)),
+ .pfn = is_vmalloc_addr(virt) ? vmalloc_to_pfn(virt) :
+ page_to_pfn(virt_to_page(virt)),
.offset = offset_in_page(virt),
.dev_addr = addr,
.size = size,