powerpc/mm: Fix vma_mmu_pagesize() for radix
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 29 Apr 2016 13:26:24 +0000 (23:26 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 11 May 2016 11:53:54 +0000 (21:53 +1000)
Radix doesn't use the slice framework to find the page size. Hence use
vma to find the page size.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/hugetlbpage.c

index 6d910960217e573111d52dd5b3f883ffb00b7ceb..7d677ef510339c55500ffa8e0c2355a69ab8ff1b 100644 (file)
@@ -719,14 +719,14 @@ unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
 {
 #ifdef CONFIG_PPC_MM_SLICES
        unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);
-
-       return 1UL << mmu_psize_to_shift(psize);
-#else
+       /* With radix we don't use slice, so derive it from vma*/
+       if (!radix_enabled())
+               return 1UL << mmu_psize_to_shift(psize);
+#endif
        if (!is_vm_hugetlb_page(vma))
                return PAGE_SIZE;
 
        return huge_page_size(hstate_vma(vma));
-#endif
 }
 
 static inline bool is_power_of_4(unsigned long x)