From patchwork Mon Aug 22 23:47:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andres Salomon X-Patchwork-Id: 1086882 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7MNlxQQ020305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 22 Aug 2011 23:48:19 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QveDd-0004aF-Oc; Mon, 22 Aug 2011 23:47:49 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QveDd-0007Tv-9x; Mon, 22 Aug 2011 23:47:49 +0000 Received: from lunge.queued.net ([173.255.254.236]) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QveDZ-0007Tc-Hi for linux-arm-kernel@lists.infradead.org; Mon, 22 Aug 2011 23:47:46 +0000 Received: from localhost (c-67-183-64-140.hsd1.wa.comcast.net [67.183.64.140]) by lunge.queued.net (Postfix) with ESMTPSA id 4BE342857B4; Mon, 22 Aug 2011 16:47:42 -0700 (PDT) Date: Mon, 22 Aug 2011 16:47:40 -0700 From: Andres Salomon To: Leo Yan Subject: [PATCH] ARM: mmp: map sram as MT_MEMORY rather than MT_DEVICE Message-ID: <20110822164740.5682541b@queued.net> In-Reply-To: <1313377794-26721-2-git-send-email-leoy@marvell.com> References: <1313377794-26721-1-git-send-email-leoy@marvell.com> <1313377794-26721-2-git-send-email-leoy@marvell.com> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110822_194745_736558_E3B33BC1 X-CRM114-Status: GOOD ( 12.15 ) X-Spam-Score: -0.5 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Nicolas Pitre , Russell King , Jon Nettleton , linux-kernel@vger.kernel.org, Haojian Zhuang , Eric Miao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Aug 2011 23:48:19 +0000 (UTC) The sram code allocates memory with ioremap, which assumes MT_DEVICE for memory protections. This explodes when we map sram for power management purposes and then attempt to execute it (jump_to_lp_sram) on the OLPC XO-1.75. Instead, we want to specify MT_MEMORY, which doesn't set the L_PTE_XN bit. Signed-off-by: Andres Salomon --- arch/arm/mach-mmp/sram.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) Eric, this patch is against the devel branch of your pxa tree. diff --git a/arch/arm/mach-mmp/sram.c b/arch/arm/mach-mmp/sram.c index 4304f95..ca4d3c1 100644 --- a/arch/arm/mach-mmp/sram.c +++ b/arch/arm/mach-mmp/sram.c @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -87,7 +88,8 @@ static int __devinit sram_probe(struct platform_device *pdev) info->sram_phys = (phys_addr_t)res->start; info->sram_size = resource_size(res); - info->sram_virt = ioremap(info->sram_phys, info->sram_size); + info->sram_virt = __arm_ioremap(info->sram_phys, info->sram_size, + MT_MEMORY); info->pool_name = kstrdup(pdata->pool_name, GFP_KERNEL); info->granularity = pdata->granularity;