From: Geoff Levand <geoffrey.levand@am•sony.com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: David Woodhouse <David.Woodhouse@intel•com>,
Arnd Bergmann <arnd@arndb•de>, Jim Paris <jim@jtan•com>,
linuxppc-dev@ozlabs•org,
Geert Uytterhoeven <Geert.Uytterhoeven@sonycom•com>,
Vivien Chappelier <vivien.chappelier@free•fr>,
cbe-oss-dev@ozlabs•org
Subject: [patch] mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap
Date: Wed, 7 Jan 2009 17:22:07 -0800 [thread overview]
Message-ID: <4965553F.8050801@am.sony.com> (raw)
In-Reply-To: <4963CDCA.4080802@am.sony.com>
Use _PAGE_NO_CACHE for gpu memory ioremap. Also,
add __iomem attribute to gpu memory pointer and
change use of memset() to memset_io().
Signed-off-by: Geoff Levand <geoffrey.levand@am•sony.com>
---
drivers/mtd/devices/ps3vram.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--- a/drivers/mtd/devices/ps3vram.c
+++ b/drivers/mtd/devices/ps3vram.c
@@ -6,6 +6,7 @@
*/
#include <linux/io.h>
+#include <linux/mm.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/list.h>
@@ -69,7 +70,7 @@ struct ps3vram_priv {
u64 context_handle;
u32 *ctrl;
u32 *reports;
- u8 *base;
+ u8 __iomem *ddr_base;
u8 *xdr_buf;
u32 *fifo_base;
@@ -425,7 +426,7 @@ static int ps3vram_erase(struct mtd_info
ps3vram_cache_flush(mtd);
/* Set bytes to 0xFF */
- memset(priv->base + instr->addr, 0xFF, instr->len);
+ memset_io(priv->ddr_base + instr->addr, 0xFF, instr->len);
mutex_unlock(&priv->lock);
@@ -628,8 +629,9 @@ static int __devinit ps3vram_probe(struc
goto out_free_context;
}
- priv->base = ioremap(ddr_lpar, ddr_size);
- if (!priv->base) {
+ priv->ddr_base = ioremap_flags(ddr_lpar, ddr_size, _PAGE_NO_CACHE);
+
+ if (!priv->ddr_base) {
dev_err(&dev->core, "%s:%d: ioremap failed\n", __func__,
__LINE__);
ret = -ENOMEM;
@@ -702,7 +704,7 @@ out_unmap_reports:
out_unmap_ctrl:
iounmap(priv->ctrl);
out_unmap_vram:
- iounmap(priv->base);
+ iounmap(priv->ddr_base);
out_free_context:
lv1_gpu_context_free(priv->context_handle);
out_free_memory:
@@ -728,7 +730,7 @@ static int ps3vram_shutdown(struct ps3_s
ps3vram_cache_cleanup(&ps3vram_mtd);
iounmap(priv->reports);
iounmap(priv->ctrl);
- iounmap(priv->base);
+ iounmap(priv->ddr_base);
lv1_gpu_context_free(priv->context_handle);
lv1_gpu_memory_free(priv->memory_handle);
ps3_close_hv_device(dev);
prev parent reply other threads:[~2009-01-08 1:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 21:31 [patch 0/6] ps3vram driver patches Geoff Levand
2009-01-07 18:44 ` Arnd Bergmann
2009-01-07 19:23 ` Geoff Levand
2009-01-07 19:53 ` Arnd Bergmann
2009-01-08 10:34 ` Geert Uytterhoeven
2009-01-08 1:22 ` Geoff Levand [this message]
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=4965553F.8050801@am.sony.com \
--to=geoffrey.levand@am$(echo .)sony.com \
--cc=David.Woodhouse@intel$(echo .)com \
--cc=Geert.Uytterhoeven@sonycom$(echo .)com \
--cc=arnd@arndb$(echo .)de \
--cc=benh@kernel$(echo .)crashing.org \
--cc=cbe-oss-dev@ozlabs$(echo .)org \
--cc=jim@jtan$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=vivien.chappelier@free$(echo .)fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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