diff options
Diffstat (limited to 'lib/ioremap.c')
-rw-r--r-- | lib/ioremap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ioremap.c b/lib/ioremap.c index 063213685563..0a2ffadc6d71 100644 --- a/lib/ioremap.c +++ b/lib/ioremap.c | |||
@@ -30,6 +30,8 @@ early_param("nohugeiomap", set_nohugeiomap); | |||
30 | void __init ioremap_huge_init(void) | 30 | void __init ioremap_huge_init(void) |
31 | { | 31 | { |
32 | if (!ioremap_huge_disabled) { | 32 | if (!ioremap_huge_disabled) { |
33 | if (arch_ioremap_p4d_supported()) | ||
34 | ioremap_p4d_capable = 1; | ||
33 | if (arch_ioremap_pud_supported()) | 35 | if (arch_ioremap_pud_supported()) |
34 | ioremap_pud_capable = 1; | 36 | ioremap_pud_capable = 1; |
35 | if (arch_ioremap_pmd_supported()) | 37 | if (arch_ioremap_pmd_supported()) |
@@ -86,6 +88,9 @@ static int ioremap_try_huge_pmd(pmd_t *pmd, unsigned long addr, | |||
86 | if ((end - addr) != PMD_SIZE) | 88 | if ((end - addr) != PMD_SIZE) |
87 | return 0; | 89 | return 0; |
88 | 90 | ||
91 | if (!IS_ALIGNED(addr, PMD_SIZE)) | ||
92 | return 0; | ||
93 | |||
89 | if (!IS_ALIGNED(phys_addr, PMD_SIZE)) | 94 | if (!IS_ALIGNED(phys_addr, PMD_SIZE)) |
90 | return 0; | 95 | return 0; |
91 | 96 | ||
@@ -126,6 +131,9 @@ static int ioremap_try_huge_pud(pud_t *pud, unsigned long addr, | |||
126 | if ((end - addr) != PUD_SIZE) | 131 | if ((end - addr) != PUD_SIZE) |
127 | return 0; | 132 | return 0; |
128 | 133 | ||
134 | if (!IS_ALIGNED(addr, PUD_SIZE)) | ||
135 | return 0; | ||
136 | |||
129 | if (!IS_ALIGNED(phys_addr, PUD_SIZE)) | 137 | if (!IS_ALIGNED(phys_addr, PUD_SIZE)) |
130 | return 0; | 138 | return 0; |
131 | 139 | ||
@@ -166,6 +174,9 @@ static int ioremap_try_huge_p4d(p4d_t *p4d, unsigned long addr, | |||
166 | if ((end - addr) != P4D_SIZE) | 174 | if ((end - addr) != P4D_SIZE) |
167 | return 0; | 175 | return 0; |
168 | 176 | ||
177 | if (!IS_ALIGNED(addr, P4D_SIZE)) | ||
178 | return 0; | ||
179 | |||
169 | if (!IS_ALIGNED(phys_addr, P4D_SIZE)) | 180 | if (!IS_ALIGNED(phys_addr, P4D_SIZE)) |
170 | return 0; | 181 | return 0; |
171 | 182 | ||