Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755491Ab2JDLtP (ORCPT ); Thu, 4 Oct 2012 07:49:15 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:36769 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755249Ab2JDLtO (ORCPT ); Thu, 4 Oct 2012 07:49:14 -0400 Message-ID: <506D7799.2090307@ti.com> Date: Thu, 4 Oct 2012 17:18:41 +0530 From: Sekhar Nori User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Matt Porter CC: Greg Kroah-Hartman , "Hans J. Koch" , Russell King , Linux Kernel Mailing List , Linux ARM Kernel List , Linux DaVinci Kernel List , Ben Gardiner Subject: Re: [PATCH v3 1/6] ARM: davinci: sram: ioremap the davinci_soc_info specified sram regions References: <1349276133-26408-1-git-send-email-mporter@ti.com> <1349276133-26408-2-git-send-email-mporter@ti.com> In-Reply-To: <1349276133-26408-2-git-send-email-mporter@ti.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2707 Lines: 86 On 10/3/2012 8:25 PM, Matt Porter wrote: > From: Ben Gardiner > > The current davinci init sets up SRAM in iotables. There has been an observed > failure to boot a da850 with 128K specified in the iotable. > > Make the davinci sram allocator -- now based on RMK's consolidated SRAM > support -- do an ioremap of the region specified by the entries in The part about being based on RMK's consolidated SRAM support should be dropped. > davinci_soc_info before registering with gen_pool_add_virt(). > > This commit breaks runtime of davinci boards since the regions that > the sram init is now trying to ioremap have been iomapped by their > iotable entries. The iotable entries will be removed in the patches > to come. I would prefer merging 2/6 into this for this reason. > > Signed-off-by: Ben Gardiner > [rebased to mainline as the consolidated SRAM support was dropped] > Signed-off-by: Matt Porter > --- > arch/arm/mach-davinci/sram.c | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c > index db0f778..0e8ca4f 100644 > --- a/arch/arm/mach-davinci/sram.c > +++ b/arch/arm/mach-davinci/sram.c > @@ -10,6 +10,7 @@ > */ > #include > #include > +#include > #include > > #include > @@ -32,7 +33,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma) > return NULL; > > if (dma) > - *dma = dma_base + (vaddr - SRAM_VIRT); > + *dma = gen_pool_virt_to_phys(sram_pool, vaddr); > return (void *)vaddr; > > } > @@ -53,8 +54,10 @@ EXPORT_SYMBOL(sram_free); > */ > static int __init sram_init(void) > { > + phys_addr_t phys = davinci_soc_info.sram_dma; > unsigned len = davinci_soc_info.sram_len; > int status = 0; > + void *addr; > > if (len) { > len = min_t(unsigned, len, SRAM_SIZE); > @@ -62,8 +65,16 @@ static int __init sram_init(void) > if (!sram_pool) > status = -ENOMEM; > } > - if (sram_pool) > - status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1); > + > + if (sram_pool) { > + addr = ioremap(phys, len); > + if (!addr) > + return -ENOMEM; > + if((status = gen_pool_add_virt(sram_pool, (unsigned)addr, > + phys, len, -1))) Nit: prefer to set status outside of if(). Looks good otherwise. Thanks for reviving this. Thanks, Sekhar -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/