Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Franck Bui-Huu <vagabon.xyz@gmail.com>
Cc: "tiansm@lemote.com" <tiansm@lemote.com>,
	linux-mips@linux-mips.org, Fuxin Zhang <zhangfx@lemote.com>
Subject: Re: [PATCH 15/15] work around for more than 256MB memory support
Date: Wed, 6 Jun 2007 19:28:14 +0100	[thread overview]
Message-ID: <20070606182814.GD30017@linux-mips.org> (raw)
In-Reply-To: <cda58cb80706060101n64dd973fxdd282379595c0b1@mail.gmail.com>

On Wed, Jun 06, 2007 at 10:01:29AM +0200, Franck Bui-Huu wrote:

> >diff --git a/drivers/char/mem.c b/drivers/char/mem.c
> >index cc9a9d0..a19b46a 100644
> >--- a/drivers/char/mem.c
> >+++ b/drivers/char/mem.c
> >@@ -82,8 +82,12 @@ static inline int uncached_access(struct file *file, 
> >unsigned long addr)
> >         */
> >        if (file->f_flags & O_SYNC)
> >                return 1;
> >+#if defined(CONFIG_LEMOTE_FULONG) && defined(CONFIG_64BIT)
> >+       return (addr >= __pa(high_memory)) || ((addr >=0x10000000) && 
> >(addr < 0x20000000));
> >+#else
> >        return addr >= __pa(high_memory);
> > #endif
> >+#endif
> > }
> 
> That would be nice to have a nice log to justify such a hack....

Unfortunately mem.c is soaked with #ifdef stuff.  So I hope I can justify
one more for another architecture but that'll be it.  So I've put
below patch into the queue tree.  It will allow the Fulong code to
override the function as needed.  I also got this in the queue tree.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

 arch/mips/mm/cache.c |   10 ++++++++++
 drivers/char/mem.c   |    7 +++++++
 2 files changed, 17 insertions(+)

Index: linux-queue/arch/mips/mm/cache.c
===================================================================
--- linux-queue.orig/arch/mips/mm/cache.c
+++ linux-queue/arch/mips/mm/cache.c
@@ -6,6 +6,8 @@
  * Copyright (C) 1994 - 2003, 07 by Ralf Baechle (ralf@linux-mips.org)
  * Copyright (C) 2007 MIPS Technologies, Inc.
  */
+#include <linux/fs.h>
+#include <linux/fcntl.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -164,3 +166,11 @@ void __init cpu_cache_init(void)
 
 	panic(cache_panic);
 }
+
+int __weak __uncached_access(struct file *file, unsigned long addr)
+{
+	if (file->f_flags & O_SYNC)
+		return 1;
+
+	return addr >= __pa(high_memory);
+}
Index: linux-queue/drivers/char/mem.c
===================================================================
--- linux-queue.orig/drivers/char/mem.c
+++ linux-queue/drivers/char/mem.c
@@ -75,6 +75,13 @@ static inline int uncached_access(struct
 	 * On ia64, we ignore O_SYNC because we cannot tolerate memory 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 file pointer

  reply	other threads:[~2007-06-06 18:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-06  6:52 Lemote Loongson 2E patch update [take 2] tiansm
2007-06-06  6:52 ` [PATCH 01/15] new files for lemote fulong mini-PC support tiansm
2007-06-11 15:40   ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 02/15] arch related Makefile update for lemote fulong mini-PC tiansm
2007-06-06  6:52 ` [PATCH 03/15] Kconfig update for lemote fulong miniPC tiansm
2007-06-06  6:52 ` [PATCH 04/15] TO_PHYS_MASK for loongson2 tiansm
2007-06-06 17:41   ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 05/15] add MACH_GROUP_LEMOTE & MACH_LEMOTE_FULONG tiansm
2007-06-06  6:52 ` [PATCH 06/15] define Hit_Invalidate_I to Index_Invalidate_I for loongson2 tiansm
2007-06-06  6:52 ` [PATCH 07/15] add Loongson processor definitions tiansm
2007-06-06  6:52 ` [PATCH 08/15] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 09/15] add serial port definition for lemote fulong tiansm
2007-06-12 12:34   ` Ralf Baechle
2007-06-12 12:57     ` Fuxin Zhang
2007-06-12 13:01       ` Ralf Baechle
2007-06-13 18:57       ` Ralf Baechle
2007-06-06  6:52 ` [PATCH 10/15] make cpu_probe recognize Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 11/15] add Loongson support to /proc/cpuinfo tiansm
2007-06-06  6:52 ` [PATCH 12/15] cheat for support of more than 256MB memory tiansm
2007-06-06  6:52 ` [PATCH 13/15] define MODULE_PROC_FAMILY for Loongson2 tiansm
2007-06-06  6:52 ` [PATCH 14/15] tlb handling support for Loongson2 processor tiansm
2007-06-06  6:52 ` [PATCH 15/15] work around for more than 256MB memory support tiansm
2007-06-06  8:01   ` Franck Bui-Huu
2007-06-06 18:28     ` Ralf Baechle [this message]
2007-06-07  6:04       ` [PATCH] override of arch/mips/mm/cache.c: __uncached_access tiansm
2007-06-07  6:22         ` Fuxin Zhang
2007-06-07 17:05           ` Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070606182814.GD30017@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=linux-mips@linux-mips.org \
    --cc=tiansm@lemote.com \
    --cc=vagabon.xyz@gmail.com \
    --cc=zhangfx@lemote.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox