Merge tag 'powerpc-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[sfrench/cifs-2.6.git] / arch / powerpc / include / asm / nohash / 32 / pgtable.h
index cb1ac02ae8ee0e4aa0873f201cb9eec94f4069c9..70edad44dff6ff4a47269c172faecb5526ec2718 100644 (file)
@@ -256,8 +256,14 @@ static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, p
 
        num = number_of_cells_per_pte(pmd, new, huge);
 
-       for (i = 0; i < num; i++, entry++, new += SZ_4K)
-               *entry = new;
+       for (i = 0; i < num; i += PAGE_SIZE / SZ_4K, new += PAGE_SIZE) {
+               *entry++ = new;
+               if (IS_ENABLED(CONFIG_PPC_16K_PAGES) && num != 1) {
+                       *entry++ = new;
+                       *entry++ = new;
+                       *entry++ = new;
+               }
+       }
 
        return old;
 }