diff mbox

[RFC,2/2] DSPBRIDGE: Distinguish between read or write buffers

Message ID 1266532429-30927-3-git-send-email-omar.ramirez@ti.com (mailing list archive)
State Not Applicable
Delegated to:
Headers show

Commit Message

omar ramirez Feb. 18, 2010, 10:33 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/dsp/bridge/rmgr/proc.c b/drivers/dsp/bridge/rmgr/proc.c
index 78a31ef..4fe20ed 100644
--- a/drivers/dsp/bridge/rmgr/proc.c
+++ b/drivers/dsp/bridge/rmgr/proc.c
@@ -71,6 +71,12 @@ 
 
 #define DSP_CACHE_LINE 128
 
+#define BUFMODE_MASK	(3 << 14)
+
+/* Buffer modes from DSP perspective */
+#define RBUF		0x1	/* Input buffer */
+#define WBUF		0x2	/* Output Buffer */
+
 extern char *iva_img;
 
 /*  ----------------------------------- Globals */
@@ -1297,11 +1303,13 @@  DSP_STATUS PROC_Map(DSP_HPROCESSOR hProcessor, void *pMpuAddr, u32 ulSize,
 		 pReqAddr, ulMapAttr, ppMapAddr);
 
 #ifdef CONFIG_BRIDGE_CACHE_LINE_CHECK
-	if (!IS_ALIGNED((u32)pMpuAddr, DSP_CACHE_LINE) ||
-	    !IS_ALIGNED(size, DSP_CACHE_LINE)) {
-		pr_err("%s: not aligned: 0x%x (%d)\n", __func__,
+	if ((ulMapAttr & BUFMODE_MASK) != RBUF) {
+		if (!IS_ALIGNED((u32)pMpuAddr, DSP_CACHE_LINE) ||
+		    !IS_ALIGNED(ulSize, DSP_CACHE_LINE)) {
+			pr_err("%s: not aligned: 0x%x (%d)\n", __func__,
 						(u32)pMpuAddr, ulSize);
-		return -EFAULT;
+			return -EFAULT;
+		}
 	}
 #endif