The patch titled Subject: mm/dev_pfn: exclude MEMORY_DEVICE_PRIVATE while computing virtual address has been added to the -mm tree. Its filename is mm-dev_pfn-exclude-memory_device_private-while-computing-virtual-address.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-dev_pfn-exclude-memory_device_private-while-computing-virtual-address.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-dev_pfn-exclude-memory_device_private-while-computing-virtual-address.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Anshuman Khandual <anshuman.khandual@xxxxxxx> Subject: mm/dev_pfn: exclude MEMORY_DEVICE_PRIVATE while computing virtual address The presence of struct page does not guarantee linear mapping for the pfn physical range. Device private memory which is non-coherent is excluded from linear mapping during devm_memremap_pages() though they will still have struct page coverage. Change pfn_t_to_virt() to just check for device private memory before giving out virtual address for a given pfn. pfn_t_to_virt() actually has no callers. Let's fix it for the 5.2 kernel and remove it in 5.3. Link: http://lkml.kernel.org/r/1558089514-25067-1-git-send-email-anshuman.khandual@xxxxxxx Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: Dan Williams <dan.j.williams@xxxxxxxxx> Cc: Jérôme Glisse <jglisse@xxxxxxxxxx> Cc: Laurent Dufour <ldufour@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/pfn_t.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/linux/pfn_t.h~mm-dev_pfn-exclude-memory_device_private-while-computing-virtual-address +++ a/include/linux/pfn_t.h @@ -68,7 +68,7 @@ static inline phys_addr_t pfn_t_to_phys( static inline void *pfn_t_to_virt(pfn_t pfn) { - if (pfn_t_has_page(pfn)) + if (pfn_t_has_page(pfn) && !is_device_private_page(pfn_t_to_page(pfn))) return __va(pfn_t_to_phys(pfn)); return NULL; } _ Patches currently in -mm which might be from anshuman.khandual@xxxxxxx are mm-dev_pfn-exclude-memory_device_private-while-computing-virtual-address.patch