Skip to content

Commit

Permalink
sh/tlb: Fix PGTABLE_LEVELS > 2
Browse files Browse the repository at this point in the history
Geert reported that his SH7722-based Migo-R board failed to boot after
commit:

  c5b27a8 ("sh/tlb: Convert SH to generic mmu_gather")

That commit fell victim to copying the wrong pattern --
__pmd_free_tlb() used to be implemented with pmd_free().

Fixes: c5b27a8 ("sh/tlb: Convert SH to generic mmu_gather")
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Rich Felker <[email protected]>
  • Loading branch information
Peter Zijlstra authored and Rich Felker committed Jul 27, 2020
1 parent 92ed301 commit c7bcbc8
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions arch/sh/include/asm/pgalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern void pgd_free(struct mm_struct *mm, pgd_t *pgd);
extern void pud_populate(struct mm_struct *mm, pud_t *pudp, pmd_t *pmd);
extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);
extern void pmd_free(struct mm_struct *mm, pmd_t *pmd);
#define __pmd_free_tlb(tlb, pmdp, addr) pmd_free((tlb)->mm, (pmdp))
#endif

static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd,
Expand All @@ -33,13 +34,4 @@ do { \
tlb_remove_page((tlb), (pte)); \
} while (0)

#if CONFIG_PGTABLE_LEVELS > 2
#define __pmd_free_tlb(tlb, pmdp, addr) \
do { \
struct page *page = virt_to_page(pmdp); \
pgtable_pmd_page_dtor(page); \
tlb_remove_page((tlb), page); \
} while (0);
#endif

#endif /* __ASM_SH_PGALLOC_H */

0 comments on commit c7bcbc8

Please sign in to comment.