diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2020-11-03 12:27:32 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-11-07 01:14:58 +0300 |
commit | 351191ad55c8a1eccaf23e4187c62056229c0779 (patch) | |
tree | a0e113a31093789f7213ddd4283b5868b1168be9 /include/linux/io-mapping.h | |
parent | 3c1016b53c311906878c703af1e2b29855a9a962 (diff) | |
download | linux-351191ad55c8a1eccaf23e4187c62056229c0779.tar.xz |
io-mapping: Cleanup atomic iomap
Switch the atomic iomap implementation over to kmap_local and stick the
preempt/pagefault mechanics into the generic code similar to the
kmap_atomic variants.
Rename the x86 map function in preparation for a non-atomic variant.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: https://lore.kernel.org/r/20201103095858.625310005@linutronix.de
Diffstat (limited to 'include/linux/io-mapping.h')
-rw-r--r-- | include/linux/io-mapping.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 3b0940be72e9..60e7c83e4904 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h @@ -69,13 +69,17 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, BUG_ON(offset >= mapping->size); phys_addr = mapping->base + offset; - return iomap_atomic_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); + preempt_disable(); + pagefault_disable(); + return __iomap_local_pfn_prot(PHYS_PFN(phys_addr), mapping->prot); } static inline void io_mapping_unmap_atomic(void __iomem *vaddr) { - iounmap_atomic(vaddr); + kunmap_local_indexed((void __force *)vaddr); + pagefault_enable(); + preempt_enable(); } static inline void __iomem * |