public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5]
@ 2010-01-27  0:57 Omar Ramirez Luna
  2010-01-27  0:57 ` [PATCH v2 1/5] DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit] Omar Ramirez Luna
  2010-01-29  0:32 ` [PATCH v2 0/5] DSPBRIDGE: centralized services initialization Omar Ramirez Luna
  0 siblings, 2 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

It is more logic to initialize services related modules inside
services layer, even if we are planning to remove it.

v2:
- Fixed crefs build issue (patch 2) if enabling debug

Omar Ramirez Luna (5):
  DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit]
  DSPBRIDGE: remove crefs for SERVICES[Init|Exit]
  DSPBRIDGE: Remove multiple initializations of MEM module
  DSPBRIDGE: Remove multiple initializations of REG module
  DSPBRIDGE: Remove multiple initializations of NTFY module

 drivers/dsp/bridge/gen/gs.c            |    8 +--
 drivers/dsp/bridge/pmgr/dbll.c         |   15 +----
 drivers/dsp/bridge/pmgr/wcd.c          |   17 +-----
 drivers/dsp/bridge/rmgr/dbdcd.c        |   15 +-----
 drivers/dsp/bridge/rmgr/rmm.c          |   17 +-----
 drivers/dsp/bridge/services/mem.c      |   36 ++----------
 drivers/dsp/bridge/services/services.c |  100 ++++++++++++--------------------
 7 files changed, 53 insertions(+), 155 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/5] DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit]
  2010-01-27  0:57 [PATCH v2 0/5] Omar Ramirez Luna
@ 2010-01-27  0:57 ` Omar Ramirez Luna
  2010-01-27  0:57   ` [PATCH v2 2/5] DSPBRIDGE: remove crefs for SERVICES[Init|Exit] Omar Ramirez Luna
  2010-01-29  0:32 ` [PATCH v2 0/5] DSPBRIDGE: centralized services initialization Omar Ramirez Luna
  1 sibling, 1 reply; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

Avoid calling multiple times to SERVICES_[Init|Exit] functions,
these should be called once at probe and exit respectively.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/pmgr/wcd.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index 962cac6..2afe222 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -302,7 +302,6 @@ void WCD_Exit(void)
 		MGR_Exit();
 		RMM_exit();
 		DRV_Exit();
-		SERVICES_Exit();
 	}
 	DBC_Ensure(WCD_cRefs >= 0);
 }
@@ -315,12 +314,10 @@ void WCD_Exit(void)
 bool WCD_Init(void)
 {
 	bool fInit = true;
-	bool fDRV, fDEV, fCOD, fSERVICES, fCHNL, fMSG, fIO;
+	bool fDRV, fDEV, fCOD, fCHNL, fMSG, fIO;
 	bool fMGR, fPROC, fNODE, fDISP, fNTFY, fSTRM, fRMM;
 
 	if (WCD_cRefs == 0) {
-		/* initialize all SERVICES modules */
-		fSERVICES = SERVICES_Init();
 		/* initialize debugging module */
 		DBC_Assert(!WCD_debugMask.flags);
 		GT_create(&WCD_debugMask, "CD");    /* CD for class driver */
@@ -338,13 +335,10 @@ bool WCD_Init(void)
 		fIO = IO_Init();
 		fDEV = DEV_Init();
 		fCOD = COD_Init();
-		fInit = fSERVICES && fDRV && fDEV && fCHNL && fCOD &&
+		fInit = fDRV && fDEV && fCHNL && fCOD &&
 			fMSG && fIO;
 		fInit = fInit && fMGR && fPROC && fRMM;
 		if (!fInit) {
-			if (fSERVICES)
-				SERVICES_Exit();
-
 			if (fDRV)
 				DRV_Exit();
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/5] DSPBRIDGE: remove crefs for SERVICES[Init|Exit]
  2010-01-27  0:57 ` [PATCH v2 1/5] DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit] Omar Ramirez Luna
@ 2010-01-27  0:57   ` Omar Ramirez Luna
  2010-01-27  0:57     ` [PATCH v2 3/5] DSPBRIDGE: Remove multiple initializations of MEM module Omar Ramirez Luna
  0 siblings, 1 reply; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

No point in having a module counter if these are called
only once.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/services/services.c |  100 ++++++++++++--------------------
 1 files changed, 37 insertions(+), 63 deletions(-)

diff --git a/drivers/dsp/bridge/services/services.c b/drivers/dsp/bridge/services/services.c
index c3e11b4..3db08e4 100644
--- a/drivers/dsp/bridge/services/services.c
+++ b/drivers/dsp/bridge/services/services.c
@@ -43,8 +43,6 @@
 static struct GT_Mask SERVICES_debugMask = { NULL, NULL };  /* GT trace var. */
 #endif
 
-static u32 cRefs;		/* SERVICES module reference count */
-
 /*
  *  ======== SERVICES_Exit ========
  *  Purpose:
@@ -53,26 +51,16 @@ static u32 cRefs;		/* SERVICES module reference count */
  */
 void SERVICES_Exit(void)
 {
-	DBC_Require(cRefs > 0);
-
-	GT_1trace(SERVICES_debugMask, GT_5CLASS, "SERVICES_Exit: cRefs 0x%x\n",
-		 cRefs);
-
-	cRefs--;
-	if (cRefs == 0) {
-		/* Uninitialize all SERVICES modules here */
-		NTFY_Exit();
-		SYNC_Exit();
-		CLK_Exit();
-		REG_Exit();
-		DBG_Exit();
-		CFG_Exit();
-		MEM_Exit();
-
-		GT_exit();
-	}
-
-	DBC_Ensure(cRefs >= 0);
+	/* Uninitialize all SERVICES modules here */
+	NTFY_Exit();
+	SYNC_Exit();
+	CLK_Exit();
+	REG_Exit();
+	DBG_Exit();
+	CFG_Exit();
+	MEM_Exit();
+
+	GT_exit();
 }
 
 /*
@@ -86,61 +74,47 @@ bool SERVICES_Init(void)
 	bool fCFG, fDBG, fMEM;
 	bool fREG, fSYNC, fCLK, fNTFY;
 
-	DBC_Require(cRefs >= 0);
-
-	if (cRefs == 0) {
+	GT_init();
+	GT_create(&SERVICES_debugMask, "OS");	/* OS for OSal */
 
-		GT_init();
-		GT_create(&SERVICES_debugMask, "OS");	/* OS for OSal */
-
-		GT_0trace(SERVICES_debugMask, GT_ENTER,
+	GT_0trace(SERVICES_debugMask, GT_ENTER,
 			 "SERVICES_Init: entered\n");
 
-		/* Perform required initialization of SERVICES modules. */
-		fMEM = MEM_Init();
-		fREG = REG_Init();
-		fCFG = CFG_Init();
-		fDBG = DBG_Init();
-		fSYNC = SYNC_Init();
-		fCLK  = CLK_Init();
-		fNTFY = NTFY_Init();
+	/* Perform required initialization of SERVICES modules. */
+	fMEM = MEM_Init();
+	fREG = REG_Init();
+	fCFG = CFG_Init();
+	fDBG = DBG_Init();
+	fSYNC = SYNC_Init();
+	fCLK  = CLK_Init();
+	fNTFY = NTFY_Init();
 
-		fInit = fCFG && fDBG &&
-			fMEM && fREG && fSYNC && fCLK;
+	fInit = fCFG && fDBG && fMEM && fREG && fSYNC && fCLK;
 
-		if (!fInit) {
-			if (fNTFY)
-				NTFY_Exit();
+	if (!fInit) {
+		if (fNTFY)
+			NTFY_Exit();
 
-			if (fSYNC)
-				SYNC_Exit();
+		if (fSYNC)
+			SYNC_Exit();
 
-			if (fCLK)
-				CLK_Exit();
+		if (fCLK)
+			CLK_Exit();
 
-			if (fREG)
-				REG_Exit();
+		if (fREG)
+			REG_Exit();
 
-			if (fDBG)
-				DBG_Exit();
+		if (fDBG)
+			DBG_Exit();
 
-			if (fCFG)
-				CFG_Exit();
+		if (fCFG)
+			CFG_Exit();
 
-			if (fMEM)
-				MEM_Exit();
+		if (fMEM)
+			MEM_Exit();
 
-		}
 	}
 
-	if (fInit)
-		cRefs++;
-
-	GT_1trace(SERVICES_debugMask, GT_5CLASS, "SERVICES_Init: cRefs 0x%x\n",
-		 cRefs);
-
-	DBC_Ensure((fInit && (cRefs > 0)) || (!fInit && (cRefs >= 0)));
-
 	return fInit;
 }
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/5] DSPBRIDGE: Remove multiple initializations of MEM module
  2010-01-27  0:57   ` [PATCH v2 2/5] DSPBRIDGE: remove crefs for SERVICES[Init|Exit] Omar Ramirez Luna
@ 2010-01-27  0:57     ` Omar Ramirez Luna
  2010-01-27  0:57       ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Omar Ramirez Luna
  0 siblings, 1 reply; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

MEM module should be only initialized by services layer,
removed reference counter for it.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/gen/gs.c       |    8 ++------
 drivers/dsp/bridge/pmgr/dbll.c    |   15 ++-------------
 drivers/dsp/bridge/rmgr/dbdcd.c   |    8 +-------
 drivers/dsp/bridge/rmgr/rmm.c     |   17 ++---------------
 drivers/dsp/bridge/services/mem.c |   36 ++++++------------------------------
 5 files changed, 13 insertions(+), 71 deletions(-)

diff --git a/drivers/dsp/bridge/gen/gs.c b/drivers/dsp/bridge/gen/gs.c
index 5a5684c..1197829 100644
--- a/drivers/dsp/bridge/gen/gs.c
+++ b/drivers/dsp/bridge/gen/gs.c
@@ -52,7 +52,7 @@ void *GS_alloc(u32 size)
  */
 void GS_exit(void)
 {
-	MEM_Exit();
+	/* Do nothing */
 }
 
 /*
@@ -85,9 +85,5 @@ void GS_frees(void *ptr, u32 size)
  */
 void GS_init(void)
 {
-	static bool curInit;
-
-	if (curInit == false) {
-		curInit = MEM_Init(); /* which can't fail currently. */
-	}
+	/* Do nothing */
 }
diff --git a/drivers/dsp/bridge/pmgr/dbll.c b/drivers/dsp/bridge/pmgr/dbll.c
index 5422d21..80ca4d4 100644
--- a/drivers/dsp/bridge/pmgr/dbll.c
+++ b/drivers/dsp/bridge/pmgr/dbll.c
@@ -317,7 +317,6 @@ void DBLL_exit(void)
 		  cRefs);
 
 	if (cRefs == 0) {
-		MEM_Exit();
 		GH_exit();
 #if GT_TRACE
 		DBLL_debugMask.flags = NULL;
@@ -468,30 +467,20 @@ DSP_STATUS DBLL_getSect(struct DBLL_LibraryObj *lib, char *name, u32 *pAddr,
  */
 bool DBLL_init(void)
 {
-	bool retVal = true;
-
 	DBC_Require(cRefs >= 0);
 
 	if (cRefs == 0) {
 		DBC_Assert(!DBLL_debugMask.flags);
 		GT_create(&DBLL_debugMask, "DL"); 	/* "DL" for dbDL */
 		GH_init();
-		retVal = MEM_Init();
-		if (!retVal)
-			MEM_Exit();
-
 	}
 
-	if (retVal)
-		cRefs++;
-
+	cRefs++;
 
 	GT_1trace(DBLL_debugMask, GT_5CLASS, "DBLL_init(), ref count:  0x%x\n",
 		 cRefs);
 
-	DBC_Ensure((retVal && (cRefs > 0)) || (!retVal && (cRefs >= 0)));
-
-	return retVal;
+	return true;
 }
 
 /*
diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index 3d50952..cb244f4 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -352,7 +352,6 @@ void DCD_Exit(void)
 	if (cRefs == 0) {
 		REG_Exit();
 		COD_Exit();
-		MEM_Exit();
 	}
 
 	DBC_Ensure(cRefs >= 0);
@@ -822,7 +821,6 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
  */
 bool DCD_Init(void)
 {
-	bool fInitMEM;
 	bool fInitREG;
 	bool fInitCOD;
 	bool fInit = true;
@@ -834,17 +832,13 @@ bool DCD_Init(void)
 
 	if (cRefs == 0) {
 		/* Initialize required modules. */
-		fInitMEM = MEM_Init();
 		fInitCOD = COD_Init();
 		fInitREG = REG_Init();
 
-		if (!fInitMEM || !fInitCOD || !fInitREG) {
+		if (!fInitCOD || !fInitREG) {
 			fInit = false;
 			GT_0trace(curTrace, GT_6CLASS, "DCD_Init failed\n");
 			/* Exit initialized modules. */
-			if (fInitMEM)
-				MEM_Exit();
-
 			if (fInitCOD)
 				COD_Exit();
 
diff --git a/drivers/dsp/bridge/rmgr/rmm.c b/drivers/dsp/bridge/rmgr/rmm.c
index cdd987a..5c484bc 100644
--- a/drivers/dsp/bridge/rmgr/rmm.c
+++ b/drivers/dsp/bridge/rmgr/rmm.c
@@ -335,9 +335,6 @@ void RMM_exit(void)
 	GT_1trace(RMM_debugMask, GT_5CLASS, "RMM_exit() ref count: 0x%x\n",
 		 cRefs);
 
-	if (cRefs == 0)
-		MEM_Exit();
-
 	DBC_Ensure(cRefs >= 0);
 }
 
@@ -396,31 +393,21 @@ bool RMM_free(struct RMM_TargetObj *target, u32 segid, u32 addr, u32 size,
  */
 bool RMM_init(void)
 {
-	bool retVal = true;
-
 	DBC_Require(cRefs >= 0);
 
 	if (cRefs == 0) {
 		DBC_Assert(!RMM_debugMask.flags);
 		GT_create(&RMM_debugMask, "RM");	/* "RM" for RMm */
 
-		retVal = MEM_Init();
-
-		if (!retVal)
-			MEM_Exit();
-
 	}
 
-	if (retVal)
-		cRefs++;
+	cRefs++;
 
 	GT_1trace(RMM_debugMask, GT_5CLASS,
 		 "RMM_init(), ref count:  0x%x\n",
 		 cRefs);
 
-	DBC_Ensure((retVal && (cRefs > 0)) || (!retVal && (cRefs >= 0)));
-
-	return retVal;
+	return true;
 }
 
 /*
diff --git a/drivers/dsp/bridge/services/mem.c b/drivers/dsp/bridge/services/mem.c
index 4d01917..cee646a 100644
--- a/drivers/dsp/bridge/services/mem.c
+++ b/drivers/dsp/bridge/services/mem.c
@@ -45,8 +45,6 @@
 static struct GT_Mask MEM_debugMask = { NULL, NULL };	/* GT trace variable */
 #endif
 
-static u32 cRefs;		/* module reference count */
-
 static bool extPhysMemPoolEnabled;
 
 struct extPhysMemPool {
@@ -307,8 +305,6 @@ void *MEM_AllocPhysMem(u32 cBytes, u32 ulAlign, OUT u32 *pPhysicalAddress)
 	void *pVaMem = NULL;
 	dma_addr_t paMem;
 
-	DBC_Require(cRefs > 0);
-
 	GT_2trace(MEM_debugMask, GT_ENTER,
 		  "MEM_AllocPhysMem: cBytes 0x%x\tulAlign"
 		  "0x%x\n", cBytes, ulAlign);
@@ -414,17 +410,9 @@ void *MEM_Calloc(u32 cBytes, enum MEM_POOLATTRS type)
  */
 void MEM_Exit(void)
 {
-	DBC_Require(cRefs > 0);
-
-	GT_1trace(MEM_debugMask, GT_5CLASS, "MEM_Exit: cRefs 0x%x\n", cRefs);
-
-	cRefs--;
 #ifdef MEM_CHECK
-	if (cRefs == 0)
-		MEM_Check();
-
+	MEM_Check();
 #endif
-	DBC_Ensure(cRefs >= 0);
 }
 
 /*
@@ -434,7 +422,7 @@ void MEM_Exit(void)
  */
 void MEM_FlushCache(void *pMemBuf, u32 cBytes, s32 FlushType)
 {
-	if (cRefs <= 0 || !pMemBuf)
+	if (!pMemBuf)
 		return;
 
 	switch (FlushType) {
@@ -546,7 +534,6 @@ void MEM_Free(IN void *pMemBuf)
 void MEM_FreePhysMem(void *pVirtualAddress, u32 pPhysicalAddress,
 		     u32 cBytes)
 {
-	DBC_Require(cRefs > 0);
 	DBC_Require(pVirtualAddress != NULL);
 
 	GT_1trace(MEM_debugMask, GT_ENTER, "MEM_FreePhysMem: pVirtualAddress "
@@ -564,24 +551,13 @@ void MEM_FreePhysMem(void *pVirtualAddress, u32 pPhysicalAddress,
  */
 bool MEM_Init(void)
 {
-	DBC_Require(cRefs >= 0);
-
-	if (cRefs == 0) {
-		GT_create(&MEM_debugMask, "MM");	/* MM for MeM module */
+	GT_create(&MEM_debugMask, "MM");	/* MM for MeM module */
 
 #ifdef MEM_CHECK
-		mMan.lst.head.next = &mMan.lst.head;
-		mMan.lst.head.prev = &mMan.lst.head;
-		spin_lock_init(&mMan.lock);
+	mMan.lst.head.next = &mMan.lst.head;
+	mMan.lst.head.prev = &mMan.lst.head;
+	spin_lock_init(&mMan.lock);
 #endif
 
-	}
-
-	cRefs++;
-
-	GT_1trace(MEM_debugMask, GT_5CLASS, "MEM_Init: cRefs 0x%x\n", cRefs);
-
-	DBC_Ensure(cRefs > 0);
-
 	return true;
 }
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module
  2010-01-27  0:57     ` [PATCH v2 3/5] DSPBRIDGE: Remove multiple initializations of MEM module Omar Ramirez Luna
@ 2010-01-27  0:57       ` Omar Ramirez Luna
  2010-01-27  0:57         ` [PATCH v2 5/5] DSPBRIDGE: Remove multiple initializations of NTFY module Omar Ramirez Luna
  2010-01-27  1:46         ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Guzman Lugo, Fernando
  0 siblings, 2 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

REG module should be only initialized by services layer.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/rmgr/dbdcd.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c b/drivers/dsp/bridge/rmgr/dbdcd.c
index cb244f4..caa57f1 100644
--- a/drivers/dsp/bridge/rmgr/dbdcd.c
+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
@@ -350,7 +350,6 @@ void DCD_Exit(void)
 
 	cRefs--;
 	if (cRefs == 0) {
-		REG_Exit();
 		COD_Exit();
 	}
 
@@ -821,7 +820,6 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
  */
 bool DCD_Init(void)
 {
-	bool fInitREG;
 	bool fInitCOD;
 	bool fInit = true;
 
@@ -833,18 +831,13 @@ bool DCD_Init(void)
 	if (cRefs == 0) {
 		/* Initialize required modules. */
 		fInitCOD = COD_Init();
-		fInitREG = REG_Init();
 
-		if (!fInitCOD || !fInitREG) {
+		if (!fInitCOD) {
 			fInit = false;
 			GT_0trace(curTrace, GT_6CLASS, "DCD_Init failed\n");
 			/* Exit initialized modules. */
 			if (fInitCOD)
 				COD_Exit();
-
-			if (fInitREG)
-				REG_Exit();
-
 		}
 	}
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 5/5] DSPBRIDGE: Remove multiple initializations of NTFY module
  2010-01-27  0:57       ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Omar Ramirez Luna
@ 2010-01-27  0:57         ` Omar Ramirez Luna
  2010-01-27  1:46         ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Guzman Lugo, Fernando
  1 sibling, 0 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  0:57 UTC (permalink / raw)
  To: linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Nishanth Menon,
	Omar Ramirez Luna

NTFY module should be only initialized by services layer.

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
---
 drivers/dsp/bridge/pmgr/wcd.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c
index 2afe222..b92386a 100644
--- a/drivers/dsp/bridge/pmgr/wcd.c
+++ b/drivers/dsp/bridge/pmgr/wcd.c
@@ -295,7 +295,6 @@ void WCD_Exit(void)
 		MSG_Exit();
 		IO_Exit();
 		STRM_Exit();
-		NTFY_Exit();
 		DISP_Exit();
 		NODE_Exit();
 		PROC_Exit();
@@ -315,7 +314,7 @@ bool WCD_Init(void)
 {
 	bool fInit = true;
 	bool fDRV, fDEV, fCOD, fCHNL, fMSG, fIO;
-	bool fMGR, fPROC, fNODE, fDISP, fNTFY, fSTRM, fRMM;
+	bool fMGR, fPROC, fNODE, fDISP, fSTRM, fRMM;
 
 	if (WCD_cRefs == 0) {
 		/* initialize debugging module */
@@ -327,7 +326,6 @@ bool WCD_Init(void)
 		fPROC = PROC_Init();
 		fNODE = NODE_Init();
 		fDISP = DISP_Init();
-		fNTFY = NTFY_Init();
 		fSTRM = STRM_Init();
 		fRMM = RMM_init();
 		fCHNL = CHNL_Init();
@@ -357,9 +355,6 @@ bool WCD_Init(void)
 			if (fDISP)
 				DISP_Exit();
 
-			if (fNTFY)
-				NTFY_Exit();
-
 			if (fCHNL)
 				CHNL_Exit();
 
-- 
1.6.2.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module
  2010-01-27  0:57       ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Omar Ramirez Luna
  2010-01-27  0:57         ` [PATCH v2 5/5] DSPBRIDGE: Remove multiple initializations of NTFY module Omar Ramirez Luna
@ 2010-01-27  1:46         ` Guzman Lugo, Fernando
  2010-01-27  1:53           ` Omar Ramirez Luna
  1 sibling, 1 reply; 9+ messages in thread
From: Guzman Lugo, Fernando @ 2010-01-27  1:46 UTC (permalink / raw)
  To: Ramirez Luna, Omar, linux-omap
  Cc: Ameya Palande, Hiroshi Doyu, Felipe Contreras, Menon, Nishanth



Hi,

>-----Original Message-----
>From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>owner@vger.kernel.org] On Behalf Of Ramirez Luna, Omar
>Sent: Tuesday, January 26, 2010 6:57 PM
>To: linux-omap
>Cc: Ameya Palande; Hiroshi Doyu; Felipe Contreras; Menon, Nishanth; Ramirez
>Luna, Omar
>Subject: [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG
>module
>
>REG module should be only initialized by services layer.
>
>Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
>---
> drivers/dsp/bridge/rmgr/dbdcd.c |    9 +--------
> 1 files changed, 1 insertions(+), 8 deletions(-)
>
>diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c
>b/drivers/dsp/bridge/rmgr/dbdcd.c
>index cb244f4..caa57f1 100644
>--- a/drivers/dsp/bridge/rmgr/dbdcd.c
>+++ b/drivers/dsp/bridge/rmgr/dbdcd.c
>@@ -350,7 +350,6 @@ void DCD_Exit(void)
>
> 	cRefs--;
> 	if (cRefs == 0) {
>-		REG_Exit();
> 		COD_Exit();
> 	}
>
>@@ -821,7 +820,6 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER
>*hDcdMgr,
>  */
> bool DCD_Init(void)
> {
>-	bool fInitREG;
> 	bool fInitCOD;
> 	bool fInit = true;
>
>@@ -833,18 +831,13 @@ bool DCD_Init(void)
> 	if (cRefs == 0) {
> 		/* Initialize required modules. */
> 		fInitCOD = COD_Init();
>-		fInitREG = REG_Init();
>
>-		if (!fInitCOD || !fInitREG) {
>+		if (!fInitCOD) {
> 			fInit = false;
> 			GT_0trace(curTrace, GT_6CLASS, "DCD_Init failed\n");
> 			/* Exit initialized modules. */
> 			if (fInitCOD)
> 				COD_Exit();
>-
>-			if (fInitREG)
>-				REG_Exit();
>-
> 		}
> 	}

Now DCD_Init() is only initializing COD module maybe you can remove DCD_Init and just call COD_Init(), if it is not good for consistency you can replace the function for something like this:

bool DCD_Init(void)
{
	return COD_Init();
}

All the other stuff are not needed.



Regards,
Fernando.



>
>--
>1.6.2.4
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module
  2010-01-27  1:46         ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Guzman Lugo, Fernando
@ 2010-01-27  1:53           ` Omar Ramirez Luna
  0 siblings, 0 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-27  1:53 UTC (permalink / raw)
  To: Guzman Lugo, Fernando
  Cc: linux-omap, Ameya Palande, Hiroshi Doyu, Felipe Contreras,
	Menon, Nishanth

On 1/26/2010 7:46 PM, Guzman Lugo, Fernando wrote:
>
>
> Hi,
>
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org [mailto:linux-omap-
>> owner@vger.kernel.org] On Behalf Of Ramirez Luna, Omar
>> Sent: Tuesday, January 26, 2010 6:57 PM
>> To: linux-omap
>> Cc: Ameya Palande; Hiroshi Doyu; Felipe Contreras; Menon, Nishanth; Ramirez
>> Luna, Omar
>> Subject: [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG
>> module
>>
>> REG module should be only initialized by services layer.
>>
>> Signed-off-by: Omar Ramirez Luna<omar.ramirez@ti.com>
>> ---
>> drivers/dsp/bridge/rmgr/dbdcd.c |    9 +--------
>> 1 files changed, 1 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/dsp/bridge/rmgr/dbdcd.c
>> b/drivers/dsp/bridge/rmgr/dbdcd.c
>> index cb244f4..caa57f1 100644
>> --- a/drivers/dsp/bridge/rmgr/dbdcd.c
>> +++ b/drivers/dsp/bridge/rmgr/dbdcd.c
>> @@ -350,7 +350,6 @@ void DCD_Exit(void)
>>
>> 	cRefs--;
>> 	if (cRefs == 0) {
>> -		REG_Exit();
>> 		COD_Exit();
>> 	}
>>
>> @@ -821,7 +820,6 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER
>> *hDcdMgr,
>>   */
>> bool DCD_Init(void)
>> {
>> -	bool fInitREG;
>> 	bool fInitCOD;
>> 	bool fInit = true;
>>
>> @@ -833,18 +831,13 @@ bool DCD_Init(void)
>> 	if (cRefs == 0) {
>> 		/* Initialize required modules. */
>> 		fInitCOD = COD_Init();
>> -		fInitREG = REG_Init();
>>
>> -		if (!fInitCOD || !fInitREG) {
>> +		if (!fInitCOD) {
>> 			fInit = false;
>> 			GT_0trace(curTrace, GT_6CLASS, "DCD_Init failed\n");
>> 			/* Exit initialized modules. */
>> 			if (fInitCOD)
>> 				COD_Exit();
>> -
>> -			if (fInitREG)
>> -				REG_Exit();
>> -
>> 		}
>> 	}
>
> Now DCD_Init() is only initializing COD module maybe you can remove DCD_Init and just call COD_Init(), if it is not good for consistency you can replace the function for something like this:
>
> bool DCD_Init(void)
> {
> 	return COD_Init();
> }
>
> All the other stuff are not needed.
>

Agree, but this should be a separate patch as this series only touch 
services layer init functions.

- omar


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 0/5] DSPBRIDGE: centralized services initialization
  2010-01-27  0:57 [PATCH v2 0/5] Omar Ramirez Luna
  2010-01-27  0:57 ` [PATCH v2 1/5] DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit] Omar Ramirez Luna
@ 2010-01-29  0:32 ` Omar Ramirez Luna
  1 sibling, 0 replies; 9+ messages in thread
From: Omar Ramirez Luna @ 2010-01-29  0:32 UTC (permalink / raw)
  To: Ramirez Luna, Omar
  Cc: linux-omap, Ameya Palande, Hiroshi Doyu, Felipe Contreras,
	Menon, Nishanth

On 1/26/2010 6:57 PM, Ramirez Luna, Omar wrote:
> It is more logic to initialize services related modules inside
> services layer, even if we are planning to remove it.
>
> v2:
> - Fixed crefs build issue (patch 2) if enabling debug
>
> Omar Ramirez Luna (5):
>    DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit]
>    DSPBRIDGE: remove crefs for SERVICES[Init|Exit]
>    DSPBRIDGE: Remove multiple initializations of MEM module
>    DSPBRIDGE: Remove multiple initializations of REG module
>    DSPBRIDGE: Remove multiple initializations of NTFY module
>
>   drivers/dsp/bridge/gen/gs.c            |    8 +--
>   drivers/dsp/bridge/pmgr/dbll.c         |   15 +----
>   drivers/dsp/bridge/pmgr/wcd.c          |   17 +-----
>   drivers/dsp/bridge/rmgr/dbdcd.c        |   15 +-----
>   drivers/dsp/bridge/rmgr/rmm.c          |   17 +-----
>   drivers/dsp/bridge/services/mem.c      |   36 ++----------
>   drivers/dsp/bridge/services/services.c |  100 ++++++++++++--------------------
>   7 files changed, 53 insertions(+), 155 deletions(-)
>

Pushed to dspbridge.

- omar

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-01-29  0:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-27  0:57 [PATCH v2 0/5] Omar Ramirez Luna
2010-01-27  0:57 ` [PATCH v2 1/5] DSPBRIDGE: Avoid multiple calls to SERVICES_[Init|Exit] Omar Ramirez Luna
2010-01-27  0:57   ` [PATCH v2 2/5] DSPBRIDGE: remove crefs for SERVICES[Init|Exit] Omar Ramirez Luna
2010-01-27  0:57     ` [PATCH v2 3/5] DSPBRIDGE: Remove multiple initializations of MEM module Omar Ramirez Luna
2010-01-27  0:57       ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Omar Ramirez Luna
2010-01-27  0:57         ` [PATCH v2 5/5] DSPBRIDGE: Remove multiple initializations of NTFY module Omar Ramirez Luna
2010-01-27  1:46         ` [PATCH v2 4/5] DSPBRIDGE: Remove multiple initializations of REG module Guzman Lugo, Fernando
2010-01-27  1:53           ` Omar Ramirez Luna
2010-01-29  0:32 ` [PATCH v2 0/5] DSPBRIDGE: centralized services initialization Omar Ramirez Luna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox