diff options
Diffstat (limited to 'arch/sh/mm/kmap.c')
| -rw-r--r-- | arch/sh/mm/kmap.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/arch/sh/mm/kmap.c b/arch/sh/mm/kmap.c index ec29e14ec5a8..c9f32d5a54b8 100644 --- a/arch/sh/mm/kmap.c +++ b/arch/sh/mm/kmap.c @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * arch/sh/mm/kmap.c * * Copyright (C) 1999, 2000, 2002 Niibe Yutaka * Copyright (C) 2002 - 2009 Paul Mundt - * - * Released under the terms of the GNU GPL v2.0. */ #include <linux/mm.h> #include <linux/init.h> @@ -15,9 +14,6 @@ #include <asm/mmu_context.h> #include <asm/cacheflush.h> -#define kmap_get_fixmap_pte(vaddr) \ - pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), (vaddr)) - static pte_t *kmap_coherent_pte; void __init kmap_coherent_init(void) @@ -26,16 +22,18 @@ void __init kmap_coherent_init(void) /* cache the first coherent kmap pte */ vaddr = __fix_to_virt(FIX_CMAP_BEGIN); - kmap_coherent_pte = kmap_get_fixmap_pte(vaddr); + kmap_coherent_pte = virt_to_kpte(vaddr); } void *kmap_coherent(struct page *page, unsigned long addr) { + struct folio *folio = page_folio(page); enum fixed_addresses idx; unsigned long vaddr; - BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); + BUG_ON(!test_bit(PG_dcache_clean, &folio->flags.f)); + preempt_disable(); pagefault_disable(); idx = FIX_CMAP_END - @@ -64,4 +62,5 @@ void kunmap_coherent(void *kvaddr) } pagefault_enable(); + preempt_enable(); } |
