linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/2] highmem/ARM: kmap_atomic cleanups
@ 2021-03-03 11:45 Thomas Gleixner
  2021-03-03 11:45 ` [patch 1/2] ARM: mm: Replace kmap_atomic_pfn() Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Gleixner @ 2021-03-03 11:45 UTC (permalink / raw)
  To: LKML; +Cc: Russell King, linux-arm-kernel, Andrew Morton, linux-mm

The last users of kmap_atomic_pfn() are in arch/arm and none of them
requires the kmap_atomic semantics. Replace them with kmap_local_pfn() and
remove kmap_atomic_pfn().

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 1/2] ARM: mm: Replace kmap_atomic_pfn()
  2021-03-03 11:45 [patch 0/2] highmem/ARM: kmap_atomic cleanups Thomas Gleixner
@ 2021-03-03 11:45 ` Thomas Gleixner
  2021-03-03 11:45 ` [patch 2/2] highmem: Remove kmap_atomic_pfn() Thomas Gleixner
  2021-03-09 15:01 ` [patch 0/2] highmem/ARM: kmap_atomic cleanups Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2021-03-03 11:45 UTC (permalink / raw)
  To: LKML; +Cc: Russell King, linux-arm-kernel, Andrew Morton, linux-mm

From: Thomas Gleixner <tglx@linutronix.de>

There is no requirement to disable pagefaults and preemption for these
cache management mappings.

Replace kmap_atomic_pfn() with kmap_local_pfn(). This allows to remove
kmap_atomic_pfn() in the next step.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm/mm/cache-feroceon-l2.c |    6 +++---
 arch/arm/mm/cache-xsc3l2.c      |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -49,9 +49,9 @@ static inline unsigned long l2_get_va(un
 	 * we simply install a virtual mapping for it only for the
 	 * TLB lookup to occur, hence no need to flush the untouched
 	 * memory mapping afterwards (note: a cache flush may happen
-	 * in some circumstances depending on the path taken in kunmap_atomic).
+	 * in some circumstances depending on the path taken in kunmap_local).
 	 */
-	void *vaddr = kmap_atomic_pfn(paddr >> PAGE_SHIFT);
+	void *vaddr = kmap_local_pfn(paddr >> PAGE_SHIFT);
 	return (unsigned long)vaddr + (paddr & ~PAGE_MASK);
 #else
 	return __phys_to_virt(paddr);
@@ -61,7 +61,7 @@ static inline unsigned long l2_get_va(un
 static inline void l2_put_va(unsigned long vaddr)
 {
 #ifdef CONFIG_HIGHMEM
-	kunmap_atomic((void *)vaddr);
+	kunmap_local((void *)vaddr);
 #endif
 }
 
--- a/arch/arm/mm/cache-xsc3l2.c
+++ b/arch/arm/mm/cache-xsc3l2.c
@@ -59,7 +59,7 @@ static inline void l2_unmap_va(unsigned
 {
 #ifdef CONFIG_HIGHMEM
 	if (va != -1)
-		kunmap_atomic((void *)va);
+		kunmap_local((void *)va);
 #endif
 }
 
@@ -75,7 +75,7 @@ static inline unsigned long l2_map_va(un
 		 * in place for it.
 		 */
 		l2_unmap_va(prev_va);
-		va = (unsigned long)kmap_atomic_pfn(pa >> PAGE_SHIFT);
+		va = (unsigned long)kmap_local_pfn(pa >> PAGE_SHIFT);
 	}
 	return va + (pa_offset >> (32 - PAGE_SHIFT));
 #else




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 2/2] highmem: Remove kmap_atomic_pfn()
  2021-03-03 11:45 [patch 0/2] highmem/ARM: kmap_atomic cleanups Thomas Gleixner
  2021-03-03 11:45 ` [patch 1/2] ARM: mm: Replace kmap_atomic_pfn() Thomas Gleixner
@ 2021-03-03 11:45 ` Thomas Gleixner
  2021-03-09 15:01 ` [patch 0/2] highmem/ARM: kmap_atomic cleanups Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2021-03-03 11:45 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, linux-mm, Russell King, linux-arm-kernel

From: Thomas Gleixner <tglx@linutronix.de>

No more users.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
---
 include/linux/highmem-internal.h |   12 ------------
 1 file changed, 12 deletions(-)

--- a/include/linux/highmem-internal.h
+++ b/include/linux/highmem-internal.h
@@ -99,13 +99,6 @@ static inline void *kmap_atomic(struct p
 	return kmap_atomic_prot(page, kmap_prot);
 }
 
-static inline void *kmap_atomic_pfn(unsigned long pfn)
-{
-	preempt_disable();
-	pagefault_disable();
-	return __kmap_local_pfn_prot(pfn, kmap_prot);
-}
-
 static inline void __kunmap_atomic(void *addr)
 {
 	kunmap_local_indexed(addr);
@@ -193,11 +186,6 @@ static inline void *kmap_atomic_prot(str
 	return kmap_atomic(page);
 }
 
-static inline void *kmap_atomic_pfn(unsigned long pfn)
-{
-	return kmap_atomic(pfn_to_page(pfn));
-}
-
 static inline void __kunmap_atomic(void *addr)
 {
 #ifdef ARCH_HAS_FLUSH_ON_KUNMAP




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch 0/2] highmem/ARM: kmap_atomic cleanups
  2021-03-03 11:45 [patch 0/2] highmem/ARM: kmap_atomic cleanups Thomas Gleixner
  2021-03-03 11:45 ` [patch 1/2] ARM: mm: Replace kmap_atomic_pfn() Thomas Gleixner
  2021-03-03 11:45 ` [patch 2/2] highmem: Remove kmap_atomic_pfn() Thomas Gleixner
@ 2021-03-09 15:01 ` Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-03-09 15:01 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: LKML, Russell King, Linux ARM, Andrew Morton, Linux-MM

On Wed, Mar 3, 2021 at 12:45 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>
> The last users of kmap_atomic_pfn() are in arch/arm and none of them
> requires the kmap_atomic semantics. Replace them with kmap_local_pfn() and
> remove kmap_atomic_pfn().

Looks good to me, both patches

Reviewed-by: Arnd Bergmann <arnd@arndb.de>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-09 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 11:45 [patch 0/2] highmem/ARM: kmap_atomic cleanups Thomas Gleixner
2021-03-03 11:45 ` [patch 1/2] ARM: mm: Replace kmap_atomic_pfn() Thomas Gleixner
2021-03-03 11:45 ` [patch 2/2] highmem: Remove kmap_atomic_pfn() Thomas Gleixner
2021-03-09 15:01 ` [patch 0/2] highmem/ARM: kmap_atomic cleanups Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).