]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - lib/ioremap.c
Merge branch 'topic/hda-acomp-base' into for-next
[linux.git] / lib / ioremap.c
index 063213685563c30c2575161f4fbc92dc1bb53d64..0a2ffadc6d71e4f0444f63cd6f6900ad10ff02da 100644 (file)
@@ -30,6 +30,8 @@ early_param("nohugeiomap", set_nohugeiomap);
 void __init ioremap_huge_init(void)
 {
        if (!ioremap_huge_disabled) {
+               if (arch_ioremap_p4d_supported())
+                       ioremap_p4d_capable = 1;
                if (arch_ioremap_pud_supported())
                        ioremap_pud_capable = 1;
                if (arch_ioremap_pmd_supported())
@@ -86,6 +88,9 @@ static int ioremap_try_huge_pmd(pmd_t *pmd, unsigned long addr,
        if ((end - addr) != PMD_SIZE)
                return 0;
 
+       if (!IS_ALIGNED(addr, PMD_SIZE))
+               return 0;
+
        if (!IS_ALIGNED(phys_addr, PMD_SIZE))
                return 0;
 
@@ -126,6 +131,9 @@ static int ioremap_try_huge_pud(pud_t *pud, unsigned long addr,
        if ((end - addr) != PUD_SIZE)
                return 0;
 
+       if (!IS_ALIGNED(addr, PUD_SIZE))
+               return 0;
+
        if (!IS_ALIGNED(phys_addr, PUD_SIZE))
                return 0;
 
@@ -166,6 +174,9 @@ static int ioremap_try_huge_p4d(p4d_t *p4d, unsigned long addr,
        if ((end - addr) != P4D_SIZE)
                return 0;
 
+       if (!IS_ALIGNED(addr, P4D_SIZE))
+               return 0;
+
        if (!IS_ALIGNED(phys_addr, P4D_SIZE))
                return 0;