Re: [PATCH 03/13] DSPBRIDGE: Moving functions from mem.c to drv.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kanigeri, Hari had written, on 04/16/2010 06:46 AM, the following:
Ivan,

In the commit 702b94bff3c50542a6e4ab9a4f4cef093262fe65 (2.6.34) the
functions
dmac_inv_range and dmac_clean_range were removed.

I'm wondering how to fix this in order to rebase to 2.6.34.

Thanks

Sharing with a wider audience my experiments:

2 options:

1. Replace dmac_inv_range and dmac_clean_range functions with the new dma map
>and unmap functions. These are supposed to be the new functions to do the same > functionality, but in our limited testing some time ago, the dma_unmap function
> wasn't invalidating the cache. You can check this at your end.

I tried doing this with pm-wip-opp(.34-rc4) branch in kevin's tree with the attached patch on SDP3430.

result log.txt - test results using just the userspace from
http://dev.omapzoom.org/?p=tidspbridge/userspace-dspbridge.git;a=summary
short story:
ping - pass
dmmcopy - fail - this is inline with what Hari mentioned - in short, using map/unmap as a direct replacement is a no-go,


2. Revert the patch that deprecated these APIs to unblock you temporarily.
git revert 702b94bff3c50542a6e4ab9a4f4cef093262fe65 works.. but ofcourse would be a temporary hack for those interested in moving on..

Will leave Hari/Omar to summarize some of the ideas they have.

--
Regards,
Nishanth Menon
>From ea35037b8bf9af0ef068248f74ce6c9dcde4df6c Mon Sep 17 00:00:00 2001
From: Nishanth Menon <nm@xxxxxx>
Date: Wed, 21 Apr 2010 14:49:28 -0500
Subject: [PATCH] DSPBRIDGE: mem: no more cache handling

quick hack to use map and unmap to handle invalid and clean ops

Signed-off-by: Nishanth Menon <nm@xxxxxx>
---
 drivers/dsp/bridge/services/mem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dsp/bridge/services/mem.c b/drivers/dsp/bridge/services/mem.c
index 916a49f..49033e7 100644
--- a/drivers/dsp/bridge/services/mem.c
+++ b/drivers/dsp/bridge/services/mem.c
@@ -224,13 +224,13 @@ void mem_flush_cache(void *pMemBuf, u32 byte_size, s32 FlushType)
 	switch (FlushType) {
 		/* invalidate only */
 	case PROC_INVALIDATE_MEM:
-		dmac_inv_range(pMemBuf, pMemBuf + byte_size);
+		dmac_unmap_area(pMemBuf, byte_size, DMA_TO_DEVICE);
 		outer_inv_range(__pa((u32) pMemBuf), __pa((u32) pMemBuf +
 							  byte_size));
 		break;
 		/* writeback only */
 	case PROC_WRITEBACK_MEM:
-		dmac_clean_range(pMemBuf, pMemBuf + byte_size);
+		dmac_map_area(pMemBuf, byte_size, DMA_FROM_DEVICE);
 		outer_clean_range(__pa((u32) pMemBuf), __pa((u32) pMemBuf +
 							    byte_size));
 		break;
-- 
1.6.3.3

# ./cexec.out ddspbase_tiomap3430.dof64P
DSP device detected !! 
proc_load: Processor Loaded ddspbase_tiomap3430.dof64P
omap mailbox rev 4.0
proc_start: dsp in running state
DSPProcessor_Start succeeded.procwrap_detach: deprecated dspbridge ioctl

Hit any key to terminate cexec.

# ./cexec.out dynbase_tiomap3430.dof64P
DSP device detected !! 
proc_load: Processor Loaded dynbase_tiomap3430.dof64P
omap mailbox rev 4.0
proc_start: dsp in running state
DSPProcessor_Start succeeded.procwrap_detach: deprecated dspbridge ioctl

Hit any key to terminate cexec.

# ./dynreg.out -r pingdyn_3430.dll64P
# ./ping.out 
DSP device detected !! 
DSPNodeCreate succeeded 
DSPNode_registerNotify succeeded 
DSPNode_run succeeded 
Ping: Id 1.000000 Msg 0.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 1.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 2.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 3.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 4.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 5.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 6.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 7.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 8.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 9.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 10.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 11.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 12.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 13.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 14.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 15.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 16.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 17.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 18.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 19.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 20.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 21.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 22.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 23.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 24.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 25.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 26.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 27.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 28.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 29.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 30.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 31.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 32.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 33.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 34.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 35.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 36.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 37.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 38.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 39.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 40.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 41.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 42.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 43.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 44.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 45.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 46.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 47.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 48.000000 Mem 14816.000000
Ping: Id 1.000000 Msg 49.000000 Mem 14816.000000
procwrap_detach: deprecated dspbridge ioctl

# ./dynreg.out -r dmmcopydyn_3430.dll64P
# du -h /dspbridge/test-input
10.0M	/dspbridge/test-input

# ./dmmcopy.out /dspbridge/test-input /dspbridge/test-output
DSP device detected !! 
DSPProcessor_Attach succeeded.
DSPNode_Allocate succeeded.
DSPNode_Create succeeded.
DSPNode_Run succeeded.
DSPProcessor_ReserveMemory succeeded. dspAddrSend= 0x203f0000 
DSPProcessor_ReserveMemory succeeded. dspAddrdRecv= 0x2040a000 
DSPProcessor_Map succeeded.
DSPProcessor_Map succeeded.
Sending DMM BUFs to DSP cmd=SETUP, DspRecvBuf=0x203f02e8, DspSendBuf=0x2040a2f0 
Read 102400 bytes from input file.
Writing 102400 bytes to output file.
Read 102400 bytes from input file.
Writing 102400 bytes to output file.
Sent and received buffers don't match 
Press any key to continue 


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux