From: Tetsuo Yamabe Date: Mon, 11 Sep 2006 08:12:09 +0000 (+0900) Subject: ARM: OMAP: DSP: Fix shared memory synchronization X-Git-Tag: v2.6.18-omap1~73 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=49ce7d35bf09e08235dc6e6c43cb5e84113c68bf;p=linux-2.6-omap-h63xx.git ARM: OMAP: DSP: Fix shared memory synchronization This fix assures DMA domain is kept awake till ARM completes its access to DSP internal memories. Signed-off-by: Tetsuo Yamabe Signed-off-by: Juha Yrjola --- diff --git a/arch/arm/plat-omap/dsp/dsp.h b/arch/arm/plat-omap/dsp/dsp.h index 0a4876630f7..48974ad271a 100644 --- a/arch/arm/plat-omap/dsp/dsp.h +++ b/arch/arm/plat-omap/dsp/dsp.h @@ -170,7 +170,7 @@ extern void dsp_dbg_stop(void); extern int ipbuf_is_held(unsigned char tid, unsigned short bid); -extern void dsp_mem_sync_inc(void); +extern int dsp_mem_sync_inc(void); extern int dsp_mem_sync_config(struct mem_sync_struct *sync); extern enum dsp_mem_type_e dsp_mem_type(void *vadr, size_t len); extern int dsp_address_validate(void *p, size_t len, char *fmt, ...); diff --git a/arch/arm/plat-omap/dsp/dsp_mem.c b/arch/arm/plat-omap/dsp/dsp_mem.c index 109d9732c2d..6d2c8110a67 100644 --- a/arch/arm/plat-omap/dsp/dsp_mem.c +++ b/arch/arm/plat-omap/dsp/dsp_mem.c @@ -155,17 +155,18 @@ static __inline__ unsigned long lineup_offset(unsigned long adr, return newadr; } -void dsp_mem_sync_inc(void) +int dsp_mem_sync_inc(void) { - /* - * FIXME: dsp_mem_enable()!!! - */ + if (dsp_mem_enable((void *)dspmem_base) < 0) + return -1; if (mem_sync.DARAM) mem_sync.DARAM->ad_arm++; if (mem_sync.SARAM) mem_sync.SARAM->ad_arm++; if (mem_sync.SDRAM) mem_sync.SDRAM->ad_arm++; + dsp_mem_disable((void *)dspmem_base); + return 0; } /* diff --git a/arch/arm/plat-omap/dsp/task.c b/arch/arm/plat-omap/dsp/task.c index f270939fea5..9a9595d9d01 100644 --- a/arch/arm/plat-omap/dsp/task.c +++ b/arch/arm/plat-omap/dsp/task.c @@ -1914,7 +1914,11 @@ int dsp_tadd(unsigned char minor, unsigned long adr) arg.argc = 2; arg.argv = argv; - dsp_mem_sync_inc(); + if (dsp_mem_sync_inc() < 0) { + printk(KERN_ERR "omapdsp: memory sync failed!\n"); + ret = -EBUSY; + goto fail_out; + } dsp_mbcmd_send_and_wait_exarg(&mb, &arg, &cfg_wait_q); tid = cfg_tid;