|
@@ -933,6 +933,11 @@ int pud_set_huge(pud_t *pudp, phys_addr_t phys, pgprot_t prot)
|
|
|
{
|
|
|
pgprot_t sect_prot = __pgprot(PUD_TYPE_SECT |
|
|
|
pgprot_val(mk_sect_prot(prot)));
|
|
|
+
|
|
|
+ /* ioremap_page_range doesn't honour BBM */
|
|
|
+ if (pud_present(READ_ONCE(*pudp)))
|
|
|
+ return 0;
|
|
|
+
|
|
|
BUG_ON(phys & ~PUD_MASK);
|
|
|
set_pud(pudp, pfn_pud(__phys_to_pfn(phys), sect_prot));
|
|
|
return 1;
|
|
@@ -942,6 +947,11 @@ int pmd_set_huge(pmd_t *pmdp, phys_addr_t phys, pgprot_t prot)
|
|
|
{
|
|
|
pgprot_t sect_prot = __pgprot(PMD_TYPE_SECT |
|
|
|
pgprot_val(mk_sect_prot(prot)));
|
|
|
+
|
|
|
+ /* ioremap_page_range doesn't honour BBM */
|
|
|
+ if (pmd_present(READ_ONCE(*pmdp)))
|
|
|
+ return 0;
|
|
|
+
|
|
|
BUG_ON(phys & ~PMD_MASK);
|
|
|
set_pmd(pmdp, pfn_pmd(__phys_to_pfn(phys), sect_prot));
|
|
|
return 1;
|