From patchwork Tue May 31 17:09:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sekhar Nori X-Patchwork-Id: 833042 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4VHDag7024143 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 May 2011 17:13:57 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4VHBxYL014529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 May 2011 12:11:59 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep35.itg.ti.com (8.13.7/8.13.8) with ESMTP id p4VHBx4G016096; Tue, 31 May 2011 12:11:59 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3077880627; Tue, 31 May 2011 12:11:59 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dbdp20.itg.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by linux.omap.com (Postfix) with ESMTP id 5A40880626 for ; Tue, 31 May 2011 12:11:56 -0500 (CDT) Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4VHBojL013829; Tue, 31 May 2011 22:41:51 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Tue, 31 May 2011 22:41:50 +0530 From: "Nori, Sekhar" To: Jean-Christophe PLAGNIOL-VILLARD , "linux-arm-kernel@lists.infradead.org" Date: Tue, 31 May 2011 22:39:48 +0530 Subject: RE: [RFC PATCH v4] Consolidate SRAM support Thread-Topic: [RFC PATCH v4] Consolidate SRAM support Thread-Index: AcwbQl/B7Ihf/bzQS8Ob+Hq24DOr5QEbkkqg Message-ID: References: <20110512174546.GB8633@n2100.arm.linux.org.uk> <1306371777-20431-1-git-send-email-plagnioj@jcrosoft.com> In-Reply-To: <1306371777-20431-1-git-send-email-plagnioj@jcrosoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Cc: "davinci-linux-open-source@linux.davincidsp.com" , Russell King - ARM Linux , Tony Lindgren , Sascha Hauer , Russell King , "linux-omap@vger.kernel.org" X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 31 May 2011 17:13:57 +0000 (UTC) Hi Jean-Christophe, On Thu, May 26, 2011 at 06:32:57, Jean-Christophe PLAGNIOL-VILLARD wrote: > From: Russell King - ARM Linux > > We have two SoCs using SRAM, both with their own allocation systems, > and both with their own ways of copying functions into the SRAM. > > Let's unify this before we have additional SoCs re-implementing this > obviously common functionality themselves. > > For this use the generic allocator and the newly introduce > gen_pool_add_virt and gen_pool_virt_to_phys > > Uio_pruss should probably take the SRAM pool pointer via > platform data so that it doesn't have to include Davinci specific > includes. > > Signed-off-by: Russell King > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > Cc: Sekhar Nori > Cc: Kevin Hilman > Cc: Tony Lindgren > Cc: Sascha Hauer I tested this on DA850 using suspend-to-RAM and audio, it works well! > arch/arm/Kconfig | 2 + > arch/arm/mach-davinci/da850.c | 2 +- > arch/arm/mach-davinci/dm355.c | 2 +- > arch/arm/mach-davinci/dm365.c | 2 +- > arch/arm/mach-davinci/dm644x.c | 2 +- > arch/arm/mach-davinci/dm646x.c | 2 +- > arch/arm/mach-davinci/include/mach/common.h | 2 +- > arch/arm/mach-davinci/include/mach/sram.h | 13 +---- > arch/arm/mach-davinci/pm.c | 21 +++---- > arch/arm/mach-davinci/sram.c | 57 +++++-------------- > arch/arm/plat-mxc/include/mach/iram.h | 28 ++++++++-- > .../plat-mxc/{include/mach/iram.h => iram_alloc.c} | 40 ++++++++------ I had trouble applying the plat-mxc stuff on v3.0-rc1. Can you please check? I also found some check patch errors. Feel free to merge the attached patch. With these, please add my: Acked-by: Sekhar Nori Thanks, Sekhar ----8<------- diff --git a/arch/arm/plat-mxc/include/mach/iram.h b/arch/arm/plat-mxc/include/mach/iram.h index 8279c47..aae5e35 100644 --- a/arch/arm/plat-mxc/include/mach/iram.h +++ b/arch/arm/plat-mxc/include/mach/iram.h @@ -31,7 +31,7 @@ static inline void *iram_alloc(size_t size, phys_addr_t *phys) *phys = gen_pool_virt_to_phys(iram_pool, addr); - return (void*)addr; + return (void *) addr; } static inline void iram_free(void *addr, size_t size) diff --git a/arch/arm/plat-omap/include/plat/sram.h b/arch/arm/plat-omap/include/plat/sram.h index 52b9b5c..cc99397 100644 --- a/arch/arm/plat-omap/include/plat/sram.h +++ b/arch/arm/plat-omap/include/plat/sram.h @@ -27,7 +27,7 @@ extern struct gen_pool *omap_gen_pool; size_t _sz = size; \ void *_sram = gen_pool_alloc(omap_gen_pool, _sz); \ _res = (_sram ? fncpy(_sram, &(funcp), _sz) : NULL); \ - if (!_res) \ + if (!_res) \ pr_err("Not enough space in SRAM\n"); \ _res; \ }) diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index db486cc..444176e 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -153,7 +153,7 @@ static int __devinit pruss_probe(struct platform_device *dev) goto out_free; } - gdev->sram_vaddr = (void*)gen_pool_alloc(davinci_gen_pool, sram_pool_sz); + gdev->sram_vaddr = (void *)gen_pool_alloc(davinci_gen_pool, sram_pool_sz); if (!gdev->sram_vaddr) { dev_err(&dev->dev, "Could not allocate SRAM pool\n"); goto out_free; diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index dd305a2..1c383ab 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -239,7 +239,7 @@ static int allocate_sram(struct snd_pcm_substream *substream, unsigned size, return 0; ppcm->period_bytes_max = size; - iram_virt = (void*)gen_pool_alloc(davinci_gen_pool, size); + iram_virt = (void *)gen_pool_alloc(davinci_gen_pool, size); if (!iram_virt) goto exit1; iram_phys = gen_pool_virt_to_phys(davinci_gen_pool,