]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: DSP: Fix shared memory synchronization
authorTetsuo Yamabe <tetsuo.yamabe@nokia.com>
Mon, 11 Sep 2006 08:12:09 +0000 (17:12 +0900)
committerJuha Yrjola <juha.yrjola@solidboot.com>
Mon, 11 Sep 2006 12:01:23 +0000 (15:01 +0300)
This fix assures DMA domain is kept awake till ARM completes
its access to DSP internal memories.

Signed-off-by: Tetsuo Yamabe <tetsuo.yamabe@nokia.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
arch/arm/plat-omap/dsp/dsp.h
arch/arm/plat-omap/dsp/dsp_mem.c
arch/arm/plat-omap/dsp/task.c

index 0a4876630f791acd9ab6635a136e598d4f34c85b..48974ad271a0cf502c141b356bba625f2137d740 100644 (file)
@@ -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, ...);
index 109d9732c2db306f851dbab0deb38af393a328b4..6d2c8110a67d036dae5979c5322b8dc3be85c2ae 100644 (file)
@@ -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;
 }
 
 /*
index f270939fea51f17251f1e8171843dc705e438eec..9a9595d9d01e0d4ff8be8f99c70abeed7cc08466 100644 (file)
@@ -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;