summaryrefslogtreecommitdiff
path: root/arch/loongarch/include/asm/pgtable-bits.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-10-19 11:02:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-10-19 11:02:28 -0700
commit74e9347ebc5be452935fe4f3eddb150aa5a6f4fe (patch)
tree3c53003fe01b58c7cb90359edccd8343b1d2c864 /arch/loongarch/include/asm/pgtable-bits.h
parent54fb58aec47a49a80534d2ccabd319334d6b0ef8 (diff)
parent278be83601dd1725d4732241f066d528e160a39d (diff)
Merge tag 'loongarch-fixes-6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch fixes from Huacai ChenL "Fix 4-level pagetable building, disable WUC for pgprot_writecombine() like ioremap_wc(), use correct annotation for exception handlers, and a trivial cleanup" * tag 'loongarch-fixes-6.6-3' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Disable WUC for pgprot_writecombine() like ioremap_wc() LoongArch: Replace kmap_atomic() with kmap_local_page() in copy_user_highpage() LoongArch: Export symbol invalid_pud_table for modules building LoongArch: Use SYM_CODE_* to annotate exception handlers
Diffstat (limited to 'arch/loongarch/include/asm/pgtable-bits.h')
-rw-r--r--arch/loongarch/include/asm/pgtable-bits.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/loongarch/include/asm/pgtable-bits.h b/arch/loongarch/include/asm/pgtable-bits.h
index 35348d4c4209..21319c1e045c 100644
--- a/arch/loongarch/include/asm/pgtable-bits.h
+++ b/arch/loongarch/include/asm/pgtable-bits.h
@@ -105,13 +105,15 @@ static inline pgprot_t pgprot_noncached(pgprot_t _prot)
return __pgprot(prot);
}
+extern bool wc_enabled;
+
#define pgprot_writecombine pgprot_writecombine
static inline pgprot_t pgprot_writecombine(pgprot_t _prot)
{
unsigned long prot = pgprot_val(_prot);
- prot = (prot & ~_CACHE_MASK) | _CACHE_WUC;
+ prot = (prot & ~_CACHE_MASK) | (wc_enabled ? _CACHE_WUC : _CACHE_SUC);
return __pgprot(prot);
}