diff mbox series

[v2] MIPS: mm: remove function __uncached_access()

Message ID 20210124073755.1287129-1-siyanteng@loongson.cn (mailing list archive)
State Superseded
Headers show
Series [v2] MIPS: mm: remove function __uncached_access() | expand

Commit Message

Yanteng Si Jan. 24, 2021, 7:37 a.m. UTC
MIPS uses this logic because loongson2e override the
definition of unchached. However, now the logic of
loongson2e has been removed, so MIPS is no longer needed.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
---
 arch/mips/loongson2ef/common/mem.c | 11 -----------
 arch/mips/mm/cache.c               |  8 --------
 drivers/char/mem.c                 |  7 -------
 3 files changed, 26 deletions(-)

Comments

Thomas Bogendoerfer Jan. 26, 2021, 2:37 p.m. UTC | #1
On Sun, Jan 24, 2021 at 03:37:55PM +0800, Yanteng Si wrote:
> MIPS uses this logic because loongson2e override the
> definition of unchached. However, now the logic of
> loongson2e has been removed, so MIPS is no longer needed.
> 
> Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
> ---
>  arch/mips/loongson2ef/common/mem.c | 11 -----------

it might help to split this patch into two patches. Put the
loogonson2ef stuff into the first patch with the explaination, that
we no longer need the MESA workaround (which shouldn't be there in
the first place, IMHO)

>  arch/mips/mm/cache.c               |  8 --------
>  drivers/char/mem.c                 |  7 -------

and the rest into a second patch, with a comment that MIPS can now use
the default uncached_access like other archs.

Thomas.
Maciej W. Rozycki Feb. 10, 2021, 10:32 a.m. UTC | #2
On Tue, 26 Jan 2021, Thomas Bogendoerfer wrote:

> it might help to split this patch into two patches. Put the
> loogonson2ef stuff into the first patch with the explaination, that
> we no longer need the MESA workaround (which shouldn't be there in
> the first place, IMHO)
> 
> >  arch/mips/mm/cache.c               |  8 --------
> >  drivers/char/mem.c                 |  7 -------
> 
> and the rest into a second patch, with a comment that MIPS can now use
> the default uncached_access like other archs.

 It might make sense to mention that effectively this is a revert of 
commit 24e9d0b96dac ("[MIPS] Hook for platforms to define cachability of 
/dev/mem regions"), which has become unneeded with the removal of the last 
user (which in turn ultimately was a descendent of commit 42d226c7248a 
("[MIPS] New files for lemote fulong mini-PC support")).

  Maciej
diff mbox series

Patch

diff --git a/arch/mips/loongson2ef/common/mem.c b/arch/mips/loongson2ef/common/mem.c
index 057d58bb470e..fceb3ee47eb0 100644
--- a/arch/mips/loongson2ef/common/mem.c
+++ b/arch/mips/loongson2ef/common/mem.c
@@ -41,14 +41,3 @@  void __init prom_init_memory(void)
 		memblock_add(LOONGSON_HIGHMEM_START, highmemsize << 20);
 #endif /* !CONFIG_64BIT */
 }
-
-/* override of arch/mips/mm/cache.c: __uncached_access */
-int __uncached_access(struct file *file, unsigned long addr)
-{
-	if (file->f_flags & O_DSYNC)
-		return 1;
-
-	return addr >= __pa(high_memory) ||
-		((addr >= LOONGSON_MMIO_MEM_START) &&
-		 (addr < LOONGSON_MMIO_MEM_END));
-}
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 23b16bfd97b2..9cfd432d99f6 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -207,11 +207,3 @@  void cpu_cache_init(void)
 
 	setup_protection_map();
 }
-
-int __weak __uncached_access(struct file *file, unsigned long addr)
-{
-	if (file->f_flags & O_DSYNC)
-		return 1;
-
-	return addr >= __pa(high_memory);
-}
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 43c871dc7477..869b9f5e8e03 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -291,13 +291,6 @@  static int uncached_access(struct file *file, phys_addr_t addr)
 	 * attribute aliases.
 	 */
 	return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
-#elif defined(CONFIG_MIPS)
-	{
-		extern int __uncached_access(struct file *file,
-					     unsigned long addr);
-
-		return __uncached_access(file, addr);
-	}
 #else
 	/*
 	 * Accessing memory above the top the kernel knows about or through a