From patchwork Thu Jan 8 01:22:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 17271 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 22C8A47D74 for ; Thu, 8 Jan 2009 12:23:53 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from VA3EHSOBE004.bigfish.com (outbound-va3.frontbridge.com [216.32.180.16]) by ozlabs.org (Postfix) with ESMTP id 6E7D14767C; Thu, 8 Jan 2009 12:22:35 +1100 (EST) Received: from mail111-va3-R.bigfish.com (10.7.14.245) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 8.1.291.1; Thu, 8 Jan 2009 01:22:31 +0000 Received: from mail111-va3 (localhost.localdomain [127.0.0.1]) by mail111-va3-R.bigfish.com (Postfix) with ESMTP id E5C196D02E0; Thu, 8 Jan 2009 01:22:30 +0000 (UTC) X-BigFish: VPS3(zcb8kzzzzzz2fh6bh61h) X-Spam-TCS-SCL: 0:0 Received: by mail111-va3 (MessageSwitch) id 1231377748478401_8852; Thu, 8 Jan 2009 01:22:28 +0000 (UCT) Received: from mail8.fw-sd.sony.com (mail8.fw-sd.sony.com [160.33.66.75]) by mail111-va3.bigfish.com (Postfix) with ESMTP id 4739A600052; Thu, 8 Jan 2009 01:22:28 +0000 (UTC) Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-sd.sony.com (8.14.2/8.14.2) with ESMTP id n081MRAT011745; Thu, 8 Jan 2009 01:22:27 GMT Received: from ussdixhub21.spe.sony.com (ussdixhub21.spe.sony.com [43.130.141.76]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id n081MPT8022567; Thu, 8 Jan 2009 01:22:27 GMT Received: from USSDIXRG02.am.sony.com (43.130.140.32) by ussdixhub21.spe.sony.com (43.130.141.76) with Microsoft SMTP Server id 8.1.291.1; Wed, 7 Jan 2009 17:22:08 -0800 Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXRG02.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 7 Jan 2009 17:22:08 -0800 Received: from [192.168.1.10] ([43.135.148.226]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 7 Jan 2009 17:22:07 -0800 Message-ID: <4965553F.8050801@am.sony.com> Date: Wed, 7 Jan 2009 17:22:07 -0800 From: Geoff Levand User-Agent: Thunderbird 2.0.0.18 (X11/20081119) MIME-Version: 1.0 To: Benjamin Herrenschmidt References: <4963CDCA.4080802@am.sony.com> In-Reply-To: <4963CDCA.4080802@am.sony.com> X-Enigmail-Version: 0.95.7 X-OriginalArrivalTime: 08 Jan 2009 01:22:07.0992 (UTC) FILETIME=[85DB6780:01C9712F] X-SEL-encryption-scan: scanned Cc: David Woodhouse , Arnd Bergmann , Jim Paris , linuxppc-dev@ozlabs.org, Geert Uytterhoeven , Vivien Chappelier , cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] [patch] mtd/ps3vram: Use _PAGE_NO_CACHE in memory ioremap X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org 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 --- 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 +#include #include #include #include @@ -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);