Skip to contentSkip to conversation

First set of unreviewed patches

PATCH In review Omar Ramirez Luna 3 participants 25 messages Dec 17, 2009 – Dec 22, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover First set of unreviewed patches

These patches need to be reviewed to be included into dspbridge-baseline.

v2:
- Added to series, because of priority fix:
DSPBRIDGE: Fix compile break for WCD debug mask
DSPBRIDGE: enable smart/autoidle for mailbox sysconfig
- Fixed a bracket missing for else (code style):
DSPBRIDGE: Enable peripheral clocks on wake up
- Updated commit message for:
DSPBRIDGE: Implemented Trampoline support for dynamic loader
DSPBRIDGE: Enable/Disable MCBSP_CLOCKS for MCBSP2
- Dropped for rework:
DSPBRIDGE: Avoid REGistry if pDevContext is available

Ernest Ramos Falcon (1):
DSPBRIDGE: check pointer before calling Proc_Detach

Ernesto Ramos Falcon (1):
DSPBRIDGE: Memory leak in Node Register Notify

Fernando Guzman Lugo (3):
DSPBRIDGE: Implemented Trampoline support for dynamic loader
DSPBRIDGE: Enable/Disable MCBSP_CLOCKS for MCBSP2
DSPBRIDGE: support loading 4 dependent DLL

Hiroshi DOYU (1):
DSPBRIDGE: enable smart/autoidle for mailbox sysconfig

Omar Ramirez Luna (11):
DSPBRIDGE: Fix compile break for WCD debug mask
DSPBRIDGE: set PWRERROR notifications as an option
DSPBRIDGE: Enable peripheral clocks on wake up
DSPBRIDGE: Remove long busy-wait loops on PWRST transitions
DSPBRIDGE: Rename usCount to timeout
DSPBRIDGE: Trivial cleanup on DBDCD
DSPBRIDGE: Do not panic on bad page count
DSPBRIDGE: check the status of DMM_GetHandle
DSPBRIDGE: KFILE_Seek & KFILE_Tell, u32 replaced with loff_t
DSPBRIDGE: Delete unused files
DSPBRIDGE: Compilation fixes 2.6.31

Rebecca Schultz Zavin (1):
DSPBRIDGE: Remove preproessor condition that could never work

 arch/arm/mach-omap2/dspbridge.c                |    2 +
 arch/arm/plat-omap/include/dspbridge/dbl.h     |  354 ------
 arch/arm/plat-omap/include/dspbridge/dbof.h    |  117 --
 drivers/dsp/bridge/Kconfig                     |   11 +
 drivers/dsp/bridge/Makefile                    |    3 +-
 drivers/dsp/bridge/dynload/cload.c             |  148 ++-
 drivers/dsp/bridge/dynload/dlclasses_hdr.h     |   41 -
 drivers/dsp/bridge/dynload/dload_internal.h    |  125 +++-
 drivers/dsp/bridge/dynload/reloc.c             |   81 ++-
 drivers/dsp/bridge/dynload/tramp.c             | 1110 +++++++++++++++++++
 drivers/dsp/bridge/dynload/tramp_table_c6000.c |  164 +++
 drivers/dsp/bridge/hw/hw_mbox.c                |   14 +-
 drivers/dsp/bridge/hw/hw_mbox.h                |   22 +
 drivers/dsp/bridge/pmgr/cod.c                  |    4 +-
 drivers/dsp/bridge/pmgr/dbl.c                  | 1385 ------------------------
 drivers/dsp/bridge/pmgr/wcd.c                  |   85 +-
 drivers/dsp/bridge/rmgr/dbdcd.c                |  345 +++---
 drivers/dsp/bridge/rmgr/drv_interface.c        |   11 +-
 drivers/dsp/bridge/rmgr/proc.c                 |   20 +-
 drivers/dsp/bridge/wmd/_tiomap_util.h          |    6 +
 drivers/dsp/bridge/wmd/io_sm.c                 |    1 +
 drivers/dsp/bridge/wmd/tiomap3430.c            |   18 +-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c        |  110 ++-
 drivers/dsp/bridge/wmd/tiomap_sm.c             |    3 +
 drivers/dsp/bridge/wmd/ue_deh.c                |    2 +
 25 files changed, 1982 insertions(+), 2200 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/dbl.h
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/dbof.h
 delete mode 100644 drivers/dsp/bridge/dynload/dlclasses_hdr.h
 create mode 100644 drivers/dsp/bridge/dynload/tramp.c
 create mode 100644 drivers/dsp/bridge/dynload/tramp_table_c6000.c
 delete mode 100644 drivers/dsp/bridge/pmgr/dbl.c
#1 lore raw

PATCH v2 1/18 DSPBRIDGE: Fix compile break for WCD debug mask

If debug mode is enabled compilation will break because WCD debug mask is used before behing defined.

---
 drivers/dsp/bridge/pmgr/wcd.c |   80 ++++++++++++++++++++--------------------
 1 files changed, 40 insertions(+), 40 deletions(-)
drivers/dsp/bridge/pmgr/wcd.c +40 -40
index bb28cd2..3fb5208 100644
@@ -144,46 +144,6 @@
 #define MAX_STREAMS     16
 #define MAX_BUFS	64
 
-static inline void __cp_fm_usr(void *to, const void __user *from,
-			       DSP_STATUS *err, unsigned long bytes)
-{
-	if (DSP_FAILED(*err))
-		return;
-
-	if (unlikely(!from)) {
-		*err = DSP_EPOINTER;
-		return;
-	}
-
-	if (unlikely(copy_from_user(to, from, bytes))) {
-		GT_2trace(WCD_debugMask, GT_7CLASS,
-			  "%s failed, from=0x%08x\n", __func__, from);
-		*err = DSP_EPOINTER;
-	}
-}
-#define cp_fm_usr(to, from, err, n)				\
-	__cp_fm_usr(to, from, &(err), (n) * sizeof(*(to)))
-
-static inline void __cp_to_usr(void __user *to, const void *from,
-			       DSP_STATUS *err, unsigned long bytes)
-{
-	if (DSP_FAILED(*err))
-		return;
-
-	if (unlikely(!to)) {
-		*err = DSP_EPOINTER;
-		return;
-	}
-
-	if (unlikely(copy_to_user(to, from, bytes))) {
-		GT_2trace(WCD_debugMask, GT_7CLASS,
-			  "%s failed, to=0x%08x\n", __func__, to);
-		*err = DSP_EPOINTER;
-	}
-}
-#define cp_to_usr(to, from, err, n)				\
-	__cp_to_usr(to, from, &(err), (n) * sizeof(*(from)))
-
 /* Device IOCtl function pointer */
 struct WCD_Cmd {
 	u32(*fxn)(union Trapped_Args *args);
@@ -265,6 +225,46 @@ static struct WCD_Cmd WCD_cmdTable[] = {
 	{CMMWRAP_GetInfo, CMD_CMM_GETINFO_OFFSET}
 };
 
+static inline void __cp_fm_usr(void *to, const void __user *from,
+			       DSP_STATUS *err, unsigned long bytes)
+{
+	if (DSP_FAILED(*err))
+		return;
+
+	if (unlikely(!from)) {
+		*err = DSP_EPOINTER;
+		return;
+	}
+
+	if (unlikely(copy_from_user(to, from, bytes))) {
+		GT_2trace(WCD_debugMask, GT_7CLASS,
+			  "%s failed, from=0x%08x\n", __func__, from);
+		*err = DSP_EPOINTER;
+	}
+}
+#define cp_fm_usr(to, from, err, n)				\
+	__cp_fm_usr(to, from, &(err), (n) * sizeof(*(to)))
+
+static inline void __cp_to_usr(void __user *to, const void *from,
+			       DSP_STATUS *err, unsigned long bytes)
+{
+	if (DSP_FAILED(*err))
+		return;
+
+	if (unlikely(!to)) {
+		*err = DSP_EPOINTER;
+		return;
+	}
+
+	if (unlikely(copy_to_user(to, from, bytes))) {
+		GT_2trace(WCD_debugMask, GT_7CLASS,
+			  "%s failed, to=0x%08x\n", __func__, to);
+		*err = DSP_EPOINTER;
+	}
+}
+#define cp_to_usr(to, from, err, n)				\
+	__cp_to_usr(to, from, &(err), (n) * sizeof(*(from)))
+
 /*
  *  ======== WCD_CallDevIOCtl ========
  *  Purpose:
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH v2 2/18 DSPBRIDGE: enable smart/autoidle for mailbox sysconfig

From: Hiroshi DOYU <[email protected]>

Enable smart/autoidle for mailbox sysconfig register.

Original patch:
http://patchwork.kernel.org/patch/35628/

[ fg: remove wrapper around restoreSettings ]
---
 drivers/dsp/bridge/hw/hw_mbox.c |   14 +++++++++++++-
 drivers/dsp/bridge/hw/hw_mbox.h |   22 ++++++++++++++++++++++
 drivers/dsp/bridge/wmd/io_sm.c  |    1 +
 3 files changed, 36 insertions(+), 1 deletions(-)
drivers/dsp/bridge/hw/hw_mbox.c +13 -1
index ee79032..5e8e15e 100644
@@ -33,7 +33,19 @@
 /* width in bits of MBOX Id */
 #define HW_MBOX_ID_WIDTH	   2
 
-struct MAILBOX_CONTEXT mboxsetting = {0x4, 0x1, 0x1};
+/* SYSCONFIG: register bit definition */
+#define AUTOIDLE	(1 << 0)
+#define SMARTIDLE	(2 << 3)
+
+struct MAILBOX_CONTEXT mboxsetting = {
+	.sysconfig = SMARTIDLE | AUTOIDLE,
+};
+
+HW_STATUS HW_MBOX_initSettings(void __iomem *baseAddress)
+{
+	MLBMAILBOX_SYSCONFIGWriteRegister32(baseAddress, SMARTIDLE | AUTOIDLE);
+	return RET_OK;
+}
 
 /* Saves the mailbox context */
 HW_STATUS HW_MBOX_saveSettings(void __iomem *baseAddress)
drivers/dsp/bridge/hw/hw_mbox.h +22 -0
index ad1a89c..203964c 100644
@@ -277,6 +277,28 @@ extern HW_STATUS HW_MBOX_EventAck(
 		  );
 
 /*
+* FUNCTION      : HW_MBOX_initSettings
+*
+* INPUTS:
+*
+*   Identifier  : baseAddress
+*   Type	: const u32
+*   Description : Base Address of instance of Mailbox module
+*
+*
+* RETURNS:
+*
+*   Type	: ReturnCode_t
+*   Description : RET_OK	      No errors occured
+*		 RET_BAD_NULL_PARAM  Address/pointer Paramater was set to 0/NULL
+*		 RET_INVALID_ID      Invalid Id used
+*		 RET_EMPTY	   Mailbox empty
+*
+* PURPOSE:      : This function initialize the mailbox configuration.
+*/
+extern HW_STATUS HW_MBOX_initSettings(void __iomem *baseAddres);
+
+/*
 * FUNCTION      : HW_MBOX_saveSettings
 *
 * INPUTS:
drivers/dsp/bridge/wmd/io_sm.c +1 -0
index 0daf93d..a2da528 100644
@@ -284,6 +284,7 @@ DSP_STATUS WMD_IO_Create(OUT struct IO_MGR **phIOMgr,
 		pIOMgr->fSharedIRQ = pMgrAttrs->fShared;
 		IO_DisableInterrupt(hWmdContext);
 		if (devType == DSP_UNIT) {
+			HW_MBOX_initSettings(hostRes.dwMboxBase);
 			/* Plug the channel ISR:. */
                        if ((request_irq(INT_MAIL_MPU_IRQ, IO_ISR, 0,
                                "DspBridge\tmailbox", (void *)pIOMgr)) == 0)
Signature · 1 line
1.6.2.4
#3 lore raw

PATCH v2 3/18 DSPBRIDGE: Remove preproessor condition that could never work

From: Rebecca Schultz Zavin <[email protected]>

This macro can refer to a varible not defined in this scope. gcc 4.4 and later will view this as an error and this code will not compile.

---
 drivers/dsp/bridge/dynload/cload.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/dsp/bridge/dynload/cload.c +0 -6
index ef5d7d9..4fead55 100644
@@ -1475,10 +1475,6 @@ static char *copy_tgt_strings(void *dstp, void *srcp, unsigned charcount)
 #if TARGET_AU_BITS <= BITS_PER_AU
 		/* byte-swapping issues may exist for strings on target */
 		*dst++ = *src++;
-#elif TARGET_ENDIANNESS_DIFFERS(TARGET_BIG_ENDIAN)
-		register TgtAU_t tmp;
-		tmp = *src++;
-		*dst++ = SWAP16BY8(tmp);  /* right for TARGET_AU_BITS == 16 */
 #else
 		*dst++ = *src++;
 #endif
@@ -1486,8 +1482,6 @@ static char *copy_tgt_strings(void *dstp, void *srcp, unsigned charcount)
 	/*apply force to make sure that the string table has null terminator */
 #if (BITS_PER_AU == BITS_PER_BYTE) && (TARGET_AU_BITS == BITS_PER_BYTE)
 	dst[-1] = 0;
-#elif TARGET_BIG_ENDIAN
-	dst[-1] &= ~BYTE_MASK;	/*  big-endian */
 #else
 	dst[-1] &= (1 << (BITS_PER_AU - BITS_PER_BYTE)) - 1; /* little endian */
 #endif
Signature · 1 line
1.6.2.4
#4 lore raw

PATCH v2 4/18 DSPBRIDGE: Implemented Trampoline support for dynamic loader

From: Fernando Guzman Lugo <[email protected]>

"Trampolines" utilize memory space containing a local jump table to hit external locations. Instead of the "near" function call directly calling the external location it "calls" a trampoline entry.

A "near" function call requires the target to be within a signed, 21-bit offset from the current PC so all calls have to be within 4MB of the current execution point.

The trampoline entry (location in memory) contains an unconditional long branch to the external address to be called. When the called function returns, the PC is returned to the original calling location since that is where the link register points, as the trampoline utilizes a branch instruction.

Utilizing this method removes the 4MB location restriction as well since the long branch can be done within all of DSP addressable space.

This doesn't require any change on the dsp side, it is an enhancement for newer DSP side binaries.

---
 drivers/dsp/bridge/Makefile                    |    3 +-
 drivers/dsp/bridge/dynload/cload.c             |  142 +++-
 drivers/dsp/bridge/dynload/dload_internal.h    |  125 +++-
 drivers/dsp/bridge/dynload/reloc.c             |   81 ++-
 drivers/dsp/bridge/dynload/tramp.c             | 1110 ++++++++++++++++++++++++
 drivers/dsp/bridge/dynload/tramp_table_c6000.c |  164 ++++
 6 files changed, 1574 insertions(+), 51 deletions(-)
 create mode 100644 drivers/dsp/bridge/dynload/tramp.c
 create mode 100644 drivers/dsp/bridge/dynload/tramp_table_c6000.c
drivers/dsp/bridge/Makefile +2 -1
index e10a2da..cb6d1ce 100644
@@ -14,7 +14,8 @@ libpmgr = pmgr/chnl.o pmgr/io.o pmgr/msg.o pmgr/cod.o pmgr/dev.o pmgr/wcd.o \
 librmgr = rmgr/dbdcd.o rmgr/disp.o rmgr/drv.o rmgr/mgr.o rmgr/node.o \
 		rmgr/proc.o rmgr/pwr.o rmgr/rmm.o rmgr/strm.o rmgr/dspdrv.o \
 		rmgr/nldr.o rmgr/drv_interface.o
-libdload = dynload/cload.o dynload/getsection.o dynload/reloc.o
+libdload = dynload/cload.o dynload/getsection.o dynload/reloc.o \
+		 dynload/tramp.o
 libhw = hw/hw_prcm.o hw/hw_dspssC64P.o hw/hw_mmu.o hw/hw_mbox.o
 
 bridgedriver-objs = $(libgen) $(libservices) $(libwmd) $(libpmgr) $(librmgr) \
drivers/dsp/bridge/dynload/cload.c +111 -31

253 lines not on this page · raw message

drivers/dsp/bridge/dynload/dload_internal.h +122 -3

153 lines not on this page · raw message

drivers/dsp/bridge/dynload/reloc.c +65 -16

113 lines not on this page · raw message

drivers/dsp/bridge/dynload/tramp.c new file +1110 -0

1,110 lines not on this page · raw message

drivers/dsp/bridge/dynload/tramp_table_c6000.c new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
1.6.2.4
#5 lore raw

PATCH v2 5/18 DSPBRIDGE: Enable/Disable MCBSP_CLOCKS for MCBSP2

From: Fernando Guzman Lugo <[email protected]>

Bridge should enable McBSP_CLKS (using T2 clock) so that DPLL4 can be gated. Once McBSP2 clock is released, it should disable McBSP_CLKS as it prevents PER and CORE domain transitions when OFF is set to target power state.

---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |   73 ++++++++++++++++++++++++++++++-
 1 files changed, 72 insertions(+), 1 deletions(-)
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +72 -1
index 619ed1a..f30da74 100644
@@ -361,6 +361,8 @@ DSP_STATUS DSPPeripheralClkCtrl(struct WMD_DEV_CONTEXT *pDevContext,
 	u32 dspPerClksBefore;
 	DSP_STATUS status = DSP_SOK;
 	DSP_STATUS status1 = DSP_SOK;
+	struct CFG_HOSTRES resources;
+	u32 value;
 
 	DBG_Trace(DBG_ENTER, "Entering DSPPeripheralClkCtrl \n");
 	dspPerClksBefore = pDevContext->uDspPerClks;
@@ -369,6 +371,13 @@ DSP_STATUS DSPPeripheralClkCtrl(struct WMD_DEV_CONTEXT *pDevContext,
 
 	extClk = (u32)*((u32 *)pArgs);
 
+	status = CFG_GetHostResources(
+			(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			&resources);
+
+	if (DSP_FAILED(status))
+		return DSP_EFAIL;
+
 	DBG_Trace(DBG_LEVEL3, "DSPPeripheralClkCtrl : extClk+Cmd = 0x%x \n",
 		 extClk);
 
@@ -399,6 +408,17 @@ DSP_STATUS DSPPeripheralClkCtrl(struct WMD_DEV_CONTEXT *pDevContext,
 			 "DSPPeripheralClkCtrl : Disable CLK for \n");
 		status1 = CLK_Disable(BPWR_Clks[clkIdIndex].intClk);
 		status = CLK_Disable(BPWR_Clks[clkIdIndex].funClk);
+		if (BPWR_CLKID[clkIdIndex] == BPWR_MCBSP1) {
+			/* clear MCBSP1_CLKS, on McBSP1 OFF */
+			value = __raw_readl(resources.dwSysCtrlBase + 0x274);
+			value &= ~(1 << 2);
+			__raw_writel(value, resources.dwSysCtrlBase + 0x274);
+		} else if (BPWR_CLKID[clkIdIndex] == BPWR_MCBSP2) {
+			/* clear MCBSP2_CLKS, on McBSP2 OFF */
+			value = __raw_readl(resources.dwSysCtrlBase + 0x274);
+			value &= ~(1 << 6);
+			__raw_writel(value, resources.dwSysCtrlBase + 0x274);
+		}
 		DSPClkWakeupEventCtrl(BPWR_Clks[clkIdIndex].clkId, false);
 		if ((DSP_SUCCEEDED(status)) && (DSP_SUCCEEDED(status1))) {
 			(pDevContext->uDspPerClks) &=
@@ -413,6 +433,17 @@ DSP_STATUS DSPPeripheralClkCtrl(struct WMD_DEV_CONTEXT *pDevContext,
 			 "DSPPeripheralClkCtrl : Enable CLK for \n");
 		status1 = CLK_Enable(BPWR_Clks[clkIdIndex].intClk);
 		status = CLK_Enable(BPWR_Clks[clkIdIndex].funClk);
+		if (BPWR_CLKID[clkIdIndex] == BPWR_MCBSP1) {
+			/* set MCBSP1_CLKS, on McBSP1 ON */
+			value = __raw_readl(resources.dwSysCtrlBase + 0x274);
+			value |= 1 << 2;
+			__raw_writel(value, resources.dwSysCtrlBase + 0x274);
+		} else if (BPWR_CLKID[clkIdIndex] == BPWR_MCBSP2) {
+			/* set MCBSP2_CLKS, on McBSP2 ON */
+			value = __raw_readl(resources.dwSysCtrlBase + 0x274);
+			value |= 1 << 6;
+			__raw_writel(value, resources.dwSysCtrlBase + 0x274);
+		}
 		DSPClkWakeupEventCtrl(BPWR_Clks[clkIdIndex].clkId, true);
 		if ((DSP_SUCCEEDED(status)) && (DSP_SUCCEEDED(status1))) {
 			(pDevContext->uDspPerClks) |= (1 << clkIdIndex);
@@ -522,14 +553,34 @@ DSP_STATUS PostScale_DSP(struct WMD_DEV_CONTEXT *pDevContext, IN void *pArgs)
 DSP_STATUS DSP_PeripheralClocks_Disable(struct WMD_DEV_CONTEXT *pDevContext,
 					IN void *pArgs)
 {
-
 	u32 clkIdx;
 	DSP_STATUS status = DSP_SOK;
+	struct CFG_HOSTRES resources;
+	u32 value;
+
+	status = CFG_GetHostResources(
+			(struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			&resources);
 
 	for (clkIdx = 0; clkIdx < MBX_PM_MAX_RESOURCES; clkIdx++) {
 		if (((pDevContext->uDspPerClks) >> clkIdx) & 0x01) {
 			/* Disables the interface clock of the peripheral */
 			status = CLK_Disable(BPWR_Clks[clkIdx].intClk);
+			if (BPWR_CLKID[clkIdx] == BPWR_MCBSP1) {
+				/* clear MCBSP1_CLKS, on McBSP1 OFF */
+				value = __raw_readl(resources.dwSysCtrlBase
+								+ 0x274);
+				value &= ~(1 << 2);
+				__raw_writel(value, resources.dwSysCtrlBase
+								+ 0x274);
+			} else if (BPWR_CLKID[clkIdx] == BPWR_MCBSP2) {
+				/* clear MCBSP2_CLKS, on McBSP2 OFF */
+				value = __raw_readl(resources.dwSysCtrlBase
+								+ 0x274);
+				value &= ~(1 << 6);
+				__raw_writel(value, resources.dwSysCtrlBase
+								+ 0x274);
+			}
 			if (DSP_FAILED(status)) {
 				DBG_Trace(DBG_LEVEL7,
 					 "Failed to Enable the DSP Peripheral"
@@ -556,11 +607,31 @@ DSP_STATUS DSP_PeripheralClocks_Enable(struct WMD_DEV_CONTEXT *pDevContext,
 {
 	u32 clkIdx;
 	DSP_STATUS int_clk_status = DSP_EFAIL, fun_clk_status = DSP_EFAIL;
+	struct CFG_HOSTRES resources;
+	u32 value;
+
+	CFG_GetHostResources((struct CFG_DEVNODE *)DRV_GetFirstDevExtension(),
+			&resources);
 
 	for (clkIdx = 0; clkIdx < MBX_PM_MAX_RESOURCES; clkIdx++) {
 		if (((pDevContext->uDspPerClks) >> clkIdx) & 0x01) {
 			/* Enable the interface clock of the peripheral */
 			int_clk_status = CLK_Enable(BPWR_Clks[clkIdx].intClk);
+			if (BPWR_CLKID[clkIdx] == BPWR_MCBSP1) {
+				/* set MCBSP1_CLKS, on McBSP1 ON */
+				value = __raw_readl(resources.dwSysCtrlBase
+								+ 0x274);
+				value |= 1 << 2;
+				__raw_writel(value, resources.dwSysCtrlBase
+								+ 0x274);
+			} else if (BPWR_CLKID[clkIdx] == BPWR_MCBSP2) {
+				/* set MCBSP2_CLKS, on McBSP2 ON */
+				value = __raw_readl(resources.dwSysCtrlBase
+								+ 0x274);
+				value |= 1 << 6;
+				__raw_writel(value, resources.dwSysCtrlBase
+								+ 0x274);
+			}
 			/* Enable the functional clock of the periphearl */
 			fun_clk_status = CLK_Enable(BPWR_Clks[clkIdx].funClk);
 		}
Signature · 1 line
1.6.2.4
#6 lore raw

PATCH v2 6/18 DSPBRIDGE: set PWRERROR notifications as an option

This patch enables/disables the option to register to be notified about bridge driver PWR errors, generally caused because the timer expires waiting for the dsp to change from active to retention or hibernation.

This event, if enabled, will be signaled as a fatal error, bridge driver will be unusable until a recovery method cleans the error state.

---
 drivers/dsp/bridge/Kconfig              |   11 +++++++++++
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |    4 ++++
 drivers/dsp/bridge/wmd/ue_deh.c         |    2 ++
 3 files changed, 17 insertions(+), 0 deletions(-)
drivers/dsp/bridge/Kconfig +11 -0
index 2fed82c..e494f02 100644
@@ -34,3 +34,14 @@ config BRIDGE_DEBUG
 	depends on MPU_BRIDGE
 	help
 	  Say Y to enable Bridge debugging capabilities
+
+comment "Bridge Notifications"
+	depends on MPU_BRIDGE
+
+config BRIDGE_NTFY_PWRERR
+	bool "Notify DSP Power Error"
+	depends on MPU_BRIDGE
+	help
+	  Enable notifications to registered clients on the event of power errror
+	  trying to suspend bridge driver. Say Y, to signal this event as a fatal
+	  error, this will require a bridge restart to recover.
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +4 -0
index f30da74..2d7be1c 100644
@@ -192,7 +192,9 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 	DSP_STATUS status = DSP_SOK;
 #ifdef CONFIG_PM
 	struct CFG_HOSTRES resources;
+#ifdef CONFIG_BRIDGE_NTFY_PWRERR
 	struct DEH_MGR *hDehMgr;
+#endif /* CONFIG_BRIDGE_NTFY_PWRERR */
 	u16 usCount = TIHELEN_ACKTIMEOUT;
 	enum HW_PwrState_t pwrState, targetPwrState;
 
@@ -267,8 +269,10 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 	if (!usCount) {
 		DBG_Trace(DBG_LEVEL7, "SleepDSP: Timed out Waiting for DSP"
 			 " STANDBY %x \n", pwrState);
+#ifdef CONFIG_BRIDGE_NTFY_PWRERR
 		DEV_GetDehMgr(pDevContext->hDevObject, &hDehMgr);
 		WMD_DEH_Notify(hDehMgr, DSP_PWRERROR, 0);
+#endif /* CONFIG_BRIDGE_NTFY_PWRERR */
 		return WMD_E_TIMEOUT;
 	} else {
 		DBG_Trace(DBG_LEVEL7, "SleepDSP: DSP STANDBY Pwr state %x \n",
drivers/dsp/bridge/wmd/ue_deh.c +2 -0
index 483a9c3..d6d6043 100644
@@ -280,6 +280,7 @@ DBG_Trace(DBG_LEVEL6, "WMD_DEH_Notify: DSP_MMUFAULT, "
 			HW_MMU_EventAck(resources.dwDmmuBase,
 					 HW_MMU_TRANSLATION_FAULT);
 			break;
+#ifdef CONFIG_BRIDGE_NTFY_PWRERR
 		case DSP_PWRERROR:
 			/* reset errInfo structure before use */
 			pDehMgr->errInfo.dwErrMask = DSP_PWRERROR;
@@ -290,6 +291,7 @@ DBG_Trace(DBG_LEVEL6, "WMD_DEH_Notify: DSP_MMUFAULT, "
 			printk(KERN_ERR "WMD_DEH_Notify: DSP_PWRERROR, errInfo "
 					"= 0x%x\n", dwErrInfo);
 			break;
+#endif /* CONFIG_BRIDGE_NTFY_PWRERR */
 		default:
 			DBG_Trace(DBG_LEVEL6,
 				 "WMD_DEH_Notify: Unknown Error, errInfo = "
Signature · 1 line
1.6.2.4
#7 lore raw

PATCH v2 7/18 DSPBRIDGE: Enable peripheral clocks on wake up

While suspending bridge disables peripheral clocks, but those are not enabled again if the power state is configured to be retention, which leaves the dsp not functional after suspend.

This patch re-enables the clocks on wakeup for off/ret power states.

---
 drivers/dsp/bridge/wmd/tiomap_sm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/dsp/bridge/wmd/tiomap_sm.c +3 -0
index 7d389e3..84e10ea 100644
@@ -148,6 +148,9 @@ DSP_STATUS CHNLSM_InterruptDSP2(struct WMD_DEV_CONTEXT *pDevContext,
 		temp = *(REG_UWORD32 *)(resources.dwDmmuBase + 0x10);
 
 		pDevContext->dwBrdState = BRD_RUNNING;
+	} else if (pDevContext->dwBrdState == BRD_RETENTION) {
+		/* Restart the peripheral clocks */
+		DSP_PeripheralClocks_Enable(pDevContext, NULL);
 	}
 
 	timeout = jiffies + msecs_to_jiffies(1);
Signature · 1 line
1.6.2.4
#8 lore raw

PATCH v2 8/18 DSPBRIDGE: Remove long busy-wait loops on PWRST transitions

Remove busy waiting on suspend and self hibernation paths by removing udelays.

Decrease the total timer waiting on power transitions to be less than 3 seconds, defined to wait for power transition approx. 200 msecs

Change required for:
http://android.git.kernel.org/?p=kernel/omap.git;a=commit;h=c8853459b739e5f43da0badc1605a0a0c0c8195d

---
 drivers/dsp/bridge/wmd/_tiomap_util.h   |    6 ++++++
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |   24 +++++++++++++-----------
 2 files changed, 19 insertions(+), 11 deletions(-)
drivers/dsp/bridge/wmd/_tiomap_util.h +6 -0
index 47e1e5d..bd1b571 100644
@@ -31,6 +31,12 @@
 /* Time out Values in uSeconds*/
 #define TIHELEN_ACKTIMEOUT  10000
 
+/*
+ * Time out for power state transition (in msecs), due to system
+ * latencies and HZ resolution this timer can vary.
+ */
+#define PWRSTST_TIMEOUT		200
+
 /*  Time delay for HOM->SAM transition. */
 #define  WAIT_SAM   1000000	/* in usec (1000 millisec) */
 
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +13 -11
index 2d7be1c..da59e4b 100644
@@ -110,7 +110,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
 #ifdef CONFIG_PM
-	u16 usCount = TIHELEN_ACKTIMEOUT;
+	u16 usCount = PWRSTST_TIMEOUT / 10;
 	struct CFG_HOSTRES resources;
 	enum HW_PwrState_t pwrState;
 #ifdef CONFIG_BRIDGE_DVFS
@@ -127,10 +127,12 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 
 	HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 			    &pwrState);
-	/* Wait for DSP to move into Off state,  how much time should
-	 * we wait? */
+	/* Wait for DSP to move into OFF state */
 	while ((pwrState != HW_PWR_STATE_OFF) && --usCount) {
-		udelay(500);
+		if (msleep_interruptible(10)) {
+			pr_err("Waiting for DSP OFF mode interrupted\n");
+			return DSP_EFAIL;
+		}
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 	}
@@ -195,7 +197,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 #ifdef CONFIG_BRIDGE_NTFY_PWRERR
 	struct DEH_MGR *hDehMgr;
 #endif /* CONFIG_BRIDGE_NTFY_PWRERR */
-	u16 usCount = TIHELEN_ACKTIMEOUT;
+	u16 usCount = PWRSTST_TIMEOUT / 10;
 	enum HW_PwrState_t pwrState, targetPwrState;
 
 	DBG_Trace(DBG_LEVEL7, "SleepDSP- Enter function \n");
@@ -256,12 +258,12 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 	HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 			&pwrState);
 
-	/*
-	 * Wait for DSP to move into Standby state,  how much time
-	 * should we wait?
-	 */
-	while ((pwrState != targetPwrState) && --usCount) {
-		udelay(500);
+	/* Wait for DSP to move into target power state */
+	while ((pwrState != targetPwrState) && usCount--) {
+		if (msleep_interruptible(10)) {
+			pr_err("Waiting for DSP to Suspend interrupted\n");
+			return DSP_EFAIL;
+		}
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 	}
Signature · 1 line
1.6.2.4
#9 lore raw

PATCH v2 9/18 DSPBRIDGE: Rename usCount to timeout

Rename usCount to timeout

---
 drivers/dsp/bridge/wmd/tiomap3430.c     |    6 +++---
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |   12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/dsp/bridge/wmd/tiomap3430.c +3 -3
index 018a5f4..65a21b2 100644
@@ -2089,14 +2089,14 @@ void configureDspMmu(struct WMD_DEV_CONTEXT *pDevContext, u32 dataBasePhys,
  */
 bool WaitForStart(struct WMD_DEV_CONTEXT *pDevContext, u32 dwSyncAddr)
 {
-	u16 usCount = TIHELEN_ACKTIMEOUT;
+	u16 timeout = TIHELEN_ACKTIMEOUT;
 
 	/*  Wait for response from board */
-	while (*((volatile u16 *)dwSyncAddr) && --usCount)
+	while (*((volatile u16 *)dwSyncAddr) && --timeout)
 		udelay(10);
 
 	/*  If timed out: return FALSE */
-	if (!usCount) {
+	if (!timeout) {
 		DBG_Trace(DBG_LEVEL7, "Timed out Waiting for DSP to Start\n");
 		return FALSE;
 	}
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +6 -6
index da59e4b..ea299a0 100644
@@ -110,7 +110,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 {
 	DSP_STATUS status = DSP_SOK;
 #ifdef CONFIG_PM
-	u16 usCount = PWRSTST_TIMEOUT / 10;
+	u16 timeout = PWRSTST_TIMEOUT / 10;
 	struct CFG_HOSTRES resources;
 	enum HW_PwrState_t pwrState;
 #ifdef CONFIG_BRIDGE_DVFS
@@ -128,7 +128,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 	HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 			    &pwrState);
 	/* Wait for DSP to move into OFF state */
-	while ((pwrState != HW_PWR_STATE_OFF) && --usCount) {
+	while ((pwrState != HW_PWR_STATE_OFF) && --timeout) {
 		if (msleep_interruptible(10)) {
 			pr_err("Waiting for DSP OFF mode interrupted\n");
 			return DSP_EFAIL;
@@ -136,7 +136,7 @@ DSP_STATUS handle_hibernation_fromDSP(struct WMD_DEV_CONTEXT *pDevContext)
 		HW_PWR_IVA2StateGet(resources.dwPrmBase, HW_PWR_DOMAIN_DSP,
 				    &pwrState);
 	}
-	if (usCount == 0) {
+	if (timeout == 0) {
 		DBG_Trace(DBG_LEVEL7, "Timed out Waiting for DSP Off mode \n");
 		status = WMD_E_TIMEOUT;
 		return status;
@@ -197,7 +197,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 #ifdef CONFIG_BRIDGE_NTFY_PWRERR
 	struct DEH_MGR *hDehMgr;
 #endif /* CONFIG_BRIDGE_NTFY_PWRERR */
-	u16 usCount = PWRSTST_TIMEOUT / 10;
+	u16 timeout = PWRSTST_TIMEOUT / 10;
 	enum HW_PwrState_t pwrState, targetPwrState;
 
 	DBG_Trace(DBG_LEVEL7, "SleepDSP- Enter function \n");
@@ -259,7 +259,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 			&pwrState);
 
 	/* Wait for DSP to move into target power state */
-	while ((pwrState != targetPwrState) && usCount--) {
+	while ((pwrState != targetPwrState) && timeout--) {
 		if (msleep_interruptible(10)) {
 			pr_err("Waiting for DSP to Suspend interrupted\n");
 			return DSP_EFAIL;
@@ -268,7 +268,7 @@ DSP_STATUS SleepDSP(struct WMD_DEV_CONTEXT *pDevContext, IN u32 dwCmd,
 				    &pwrState);
 	}
 
-	if (!usCount) {
+	if (!timeout) {
 		DBG_Trace(DBG_LEVEL7, "SleepDSP: Timed out Waiting for DSP"
 			 " STANDBY %x \n", pwrState);
 #ifdef CONFIG_BRIDGE_NTFY_PWRERR
Signature · 1 line
1.6.2.4
#10 lore raw

PATCH v2 10/18 DSPBRIDGE: Trivial cleanup on DBDCD

Trivial spacing cleanup on DSP/BIOS Bridge Configuration Database module.

---
 drivers/dsp/bridge/rmgr/dbdcd.c |  343 ++++++++++++++++++++-------------------
 1 files changed, 179 insertions(+), 164 deletions(-)
drivers/dsp/bridge/rmgr/dbdcd.c +179 -164
index fb4a9a6..b1391e2 100644
@@ -31,32 +31,32 @@
  *! ================
  *! 03-Dec-2003 map Changed DCD_OBJTYPE to DSP_DCDOBJTYPE
  *! 17-Dec-2002 map Modified DCD_GetDepLibs, DCD_GetNumDepLibs, GetDepLibInfo
- *!                 to include phase information
+ *!		 to include phase information
  *! 02-Dec-2002 map Modified DCD_GetLibraryName for phases in different
- *!                 libraries
+ *!		 libraries
  *! 26-Feb-2003 kc  Updated DCD_AutoUnregister and DCD_GetObjects to simplify
- *!                 DCD implementation.
+ *!		 DCD implementation.
  *! 17-Jul-2002 jeh Call COD_Open() instead of COD_OpenBase(), call COD_Close()
  *! 11-Jul-2002 jeh Added DCD_GetDepLibs(), DCD_GetNumDepLibs().
  *! 18-Feb-2003 vp  Code review updates
  *! 18-Oct-2002 vp  Ported to Linux platform
  *! 15-Mar-2002 jeh Read dynamic loading memory requirements into node object
- *!                 data. Added DCD_GetLibraryName().
+ *!		 data. Added DCD_GetLibraryName().
  *! 13-Feb-2002 jeh Get system stack size in GetAttrsFromBuf().
  *! 01-Aug-2001 ag: Added check for PROC "extended" attributes used for
- *!                    DSP-MMU setup. These are private attributes.
+ *!		    DSP-MMU setup. These are private attributes.
  *! 18-Apr-2001 jeh Use COD_OpenBase instead of COD_LoadBase.
  *! 03-Apr-2001 sg: Changed error names to DSP_EDCD* format.
  *! 11-Jan-2001 jeh Changes to DCD_GetObjectDef to match node.cdb, proc.cdb.
  *! 12-Dec-2000 kc: Added DCD_AutoUnregister. MSGNODE, DAISNODE added in
- *!                 GetAttrsFromBuf
+ *!		 GetAttrsFromBuf
  *! 22-Nov-2000 kc: Replaced sprintf() calls with strncat.
  *! 09-Nov-2000 kc: Optimized DCD module.
  *! 30-Oct-2000 kc: Added DCD_AutoRegister function; changed local var. names.
  *! 29-Sep-2000 kc: Added code review changes (src/reviews/dcd_reviews.txt).
  *! 06-Sep-2000 jeh Get message segid, message notification type. Added Atoi()
- *!                 to replace atoi(), until cdb generation can output in
- *!                 decimal format.
+ *!		 to replace atoi(), until cdb generation can output in
+ *!		 decimal format.
  *! 26-Jul-2000 kc: Created.
  *!
  */
@@ -88,12 +88,12 @@
 /*  ----------------------------------- Global defines. */
 #define SIGNATURE       0x5f444344	/* "DCD_" (in reverse). */
 
-#define IsValidHandle(h)    (((h) != NULL) && (h->dwSignature == SIGNATURE))
+#define IsValidHandle(h)	(((h) != NULL) && (h->dwSignature == SIGNATURE))
 
 #define MAX_INT2CHAR_LENGTH     16   /* Maximum int2char len of 32 bit int. */
 
 /* Name of section containing dependent libraries */
-#define DEPLIBSECT              ".dspbridge_deplibs"
+#define DEPLIBSECT		".dspbridge_deplibs"
 
 /* DCD specific structures. */
 struct DCD_MANAGER {
@@ -107,17 +107,13 @@ static u32 cEnumRefs;
 
 extern struct GT_Mask curTrace;
 
-/* helper function prototypes. */
+/* Helper function prototypes. */
 static s32 Atoi(char *pszBuf);
-
 static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 				  enum DSP_DCDOBJTYPE objType,
 				  struct DCD_GENERICOBJ *pGenObj);
-
 static void CompressBuf(char *pszBuf, u32 ulBufSize, s32 cCharSize);
-
 static char DspChar2GppChar(char *pWord, s32 cDspCharSize);
-
 static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
 				IN struct DSP_UUID *pUuid,
 				IN OUT u16 *pNumLibs,
@@ -131,9 +127,8 @@ static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
  *  Purpose:
  *      Parses the supplied image and resigsters with DCD.
  */
-
 DSP_STATUS DCD_AutoRegister(IN struct DCD_MANAGER *hDcdMgr,
-			    IN char *pszCoffPath)
+				IN char *pszCoffPath)
 {
 	DSP_STATUS status = DSP_SOK;
 
@@ -161,7 +156,7 @@ DSP_STATUS DCD_AutoRegister(IN struct DCD_MANAGER *hDcdMgr,
  *      Parses the supplied DSP image and unresiters from DCD.
  */
 DSP_STATUS DCD_AutoUnregister(IN struct DCD_MANAGER *hDcdMgr,
-			     IN char *pszCoffPath)
+				IN char *pszCoffPath)
 {
 	DSP_STATUS status = DSP_SOK;
 
@@ -172,8 +167,7 @@ DSP_STATUS DCD_AutoUnregister(IN struct DCD_MANAGER *hDcdMgr,
 
 	if (IsValidHandle(hDcdMgr)) {
 		status = DCD_GetObjects(hDcdMgr, pszCoffPath,
-				       (DCD_REGISTERFXN)DCD_RegisterObject,
-				       NULL);
+				(DCD_REGISTERFXN)DCD_RegisterObject, NULL);
 	} else {
 		status = DSP_EHANDLE;
 		GT_0trace(curTrace, GT_6CLASS,
@@ -190,9 +184,9 @@ DSP_STATUS DCD_AutoUnregister(IN struct DCD_MANAGER *hDcdMgr,
  *      Creates DCD manager.
  */
 DSP_STATUS DCD_CreateManager(IN char *pszZlDllName,
-			    OUT struct DCD_MANAGER **phDcdMgr)
+				OUT struct DCD_MANAGER **phDcdMgr)
 {
-	struct COD_MANAGER *hCodMgr;	/* COD manager handle */
+	struct COD_MANAGER *hCodMgr;		/* COD manager handle */
 	struct DCD_MANAGER *pDcdMgr = NULL;	/* DCD Manager pointer */
 	DSP_STATUS status = DSP_SOK;
 
@@ -203,43 +197,44 @@ DSP_STATUS DCD_CreateManager(IN char *pszZlDllName,
 		 phDcdMgr);
 
 	status = COD_Create(&hCodMgr, pszZlDllName, NULL);
-	if (DSP_SUCCEEDED(status)) {
 
-		/* Create a DCD object. */
-		MEM_AllocObject(pDcdMgr, struct DCD_MANAGER, SIGNATURE);
-		if (pDcdMgr != NULL) {
+	if (DSP_FAILED(status)) {
+		status = DSP_EFAIL;
+		GT_0trace(curTrace, GT_6CLASS,
+			 "DCD_CreateManager: COD_Create failed\n");
+		goto func_end;
+	}
 
-			/* Fill out the object. */
-			pDcdMgr->hCodMgr = hCodMgr;
+	/* Create a DCD object. */
+	MEM_AllocObject(pDcdMgr, struct DCD_MANAGER, SIGNATURE);
+	if (pDcdMgr != NULL) {
+		/* Fill out the object. */
+		pDcdMgr->hCodMgr = hCodMgr;
 
-			/* Return handle to this DCD interface. */
-			*phDcdMgr = pDcdMgr;
+		/* Return handle to this DCD interface. */
+		*phDcdMgr = pDcdMgr;
 
-			GT_2trace(curTrace, GT_5CLASS,
-				 "DCD_CreateManager: pDcdMgr 0x%x, "
-				 " hCodMgr 0x%x", pDcdMgr, hCodMgr);
-		} else {
-			status = DSP_EMEMORY;
+		GT_2trace(curTrace, GT_5CLASS,
+			 "DCD_CreateManager: pDcdMgr 0x%x, "
+			 " hCodMgr 0x%x", pDcdMgr, hCodMgr);
+	} else {
+		status = DSP_EMEMORY;
 
-			/*
-			 * If allocation of DcdManager object failed, delete the
-			 * COD manager.
-			 */
-			COD_Delete(hCodMgr);
+		/*
+		 * If allocation of DcdManager object failed, delete the
+		 * COD manager.
+		 */
+		COD_Delete(hCodMgr);
 
-			GT_0trace(curTrace, GT_6CLASS,
-				 "DCD_CreateManager: MEM_AllocObject failed\n");
-		}
-	} else {
-		status = DSP_EFAIL;
 		GT_0trace(curTrace, GT_6CLASS,
-			 "DCD_CreateManager: COD_Create failed\n");
+			 "DCD_CreateManager: MEM_AllocObject failed\n");
 	}
 
 	DBC_Ensure((DSP_SUCCEEDED(status)) || ((hCodMgr == NULL) &&
-		  (status == DSP_EFAIL)) || ((pDcdMgr == NULL) &&
-		  (status == DSP_EMEMORY)));
+			(status == DSP_EFAIL)) || ((pDcdMgr == NULL) &&
+			(status == DSP_EMEMORY)));
 
+func_end:
 	return status;
 }
 
@@ -259,7 +254,6 @@ DSP_STATUS DCD_DestroyManager(IN struct DCD_MANAGER *hDcdMgr)
 		 hDcdMgr);
 
 	if (IsValidHandle(hDcdMgr)) {
-
 		/* Delete the COD manager. */
 		COD_Delete(pDcdMgr->hCodMgr);
 
@@ -317,15 +311,15 @@ DSP_STATUS DCD_EnumerateObject(IN s32 cIndex, IN enum DSP_DCDOBJTYPE objType,
 		 * Pre-determine final key length. It's length of DCD_REGKEY +
 		 *  "_\0" + length of szObjType string + terminating NULL.
 		 */
-               dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
+		dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
 		DBC_Assert(dwKeyLen < REG_MAXREGPATHLENGTH);
 
 		/* Create proper REG key; concatenate DCD_REGKEY with
 		 * objType. */
-               strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
-               if ((strlen(szRegKey) + strlen("_\0")) <
+		strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
+		if ((strlen(szRegKey) + strlen("_\0")) <
 		   REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, "_\0", 2);
+			strncat(szRegKey, "_\0", 2);
 		} else {
 			status = DSP_EFAIL;
 		}
@@ -339,10 +333,10 @@ DSP_STATUS DCD_EnumerateObject(IN s32 cIndex, IN enum DSP_DCDOBJTYPE objType,
 			status = DSP_EFAIL;
 		} else {
 			status = DSP_SOK;
-                       if ((strlen(szRegKey) + strlen(szObjType)) <
+			if ((strlen(szRegKey) + strlen(szObjType)) <
 			   REG_MAXREGPATHLENGTH) {
-                               strncat(szRegKey, szObjType,
-                                          strlen(szObjType) + 1);
+				strncat(szRegKey, szObjType,
+					strlen(szObjType) + 1);
 			} else {
 				status = DSP_EFAIL;
 			}
@@ -447,7 +441,7 @@ DSP_STATUS DCD_GetNumDepLibs(IN struct DCD_MANAGER *hDcdMgr,
 		 hDcdMgr);
 
 	status = GetDepLibInfo(hDcdMgr, pUuid, pNumLibs, pNumPersLibs,
-			      NULL, NULL, phase);
+				NULL, NULL, phase);
 
 	return status;
 }
@@ -459,9 +453,9 @@ DSP_STATUS DCD_GetNumDepLibs(IN struct DCD_MANAGER *hDcdMgr,
  *      object type.
  */
 DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
-			   IN struct DSP_UUID *pObjUuid,
-			   IN enum DSP_DCDOBJTYPE objType,
-			   OUT struct DCD_GENERICOBJ *pObjDef)
+			IN struct DSP_UUID *pObjUuid,
+			IN enum DSP_DCDOBJTYPE objType,
+			OUT struct DCD_GENERICOBJ *pObjDef)
 {
 	struct DCD_MANAGER *pDcdMgr = hDcdMgr;	/* pointer to DCD manager */
 	struct COD_LIBRARYOBJ *lib = NULL;
@@ -495,15 +489,17 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 			 "DCD manager handle.\n");
 		goto func_end;
 	}
-	 /* Pre-determine final key length. It's length of DCD_REGKEY +
+
+	/* Pre-determine final key length. It's length of DCD_REGKEY +
 	 *  "_\0" + length of szObjType string + terminating NULL */
-       dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
+	dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
 	DBC_Assert(dwKeyLen < REG_MAXREGPATHLENGTH);
+
 	/* Create proper REG key; concatenate DCD_REGKEY with objType. */
-       strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
+	strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
 
-       if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
-               strncat(szRegKey, "_\0", 2);
+	if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
+		strncat(szRegKey, "_\0", 2);
 	else
 		status = DSP_EFAIL;
 
@@ -513,32 +509,34 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 	} else {
 		status = DSP_SOK;
 
-               if ((strlen(szRegKey) + strlen(szObjType)) <
+		if ((strlen(szRegKey) + strlen(szObjType)) <
 		   REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, szObjType, strlen(szObjType) + 1);
+			strncat(szRegKey, szObjType, strlen(szObjType) + 1);
 		} else {
 			status = DSP_EFAIL;
 		}
+
 		/* Create UUID value to set in registry. */
 		UUID_UuidToString(pObjUuid, szUuid, MAXUUIDLEN);
 
-               if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
-                       strncat(szRegKey, szUuid, MAXUUIDLEN);
-               else
+		if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
+			strncat(szRegKey, szUuid, MAXUUIDLEN);
+		else
 			status = DSP_EFAIL;
 
 		/* Retrieve paths from the registry based on struct DSP_UUID */
 		dwBufSize = REG_MAXREGPATHLENGTH;
 	}
-	if (DSP_SUCCEEDED(status)) {
+	if (DSP_SUCCEEDED(status))
 		status = REG_GetValue(szRegKey, (u8 *)szRegData, &dwBufSize);
-	}
+
 	if (DSP_FAILED(status)) {
 		status = DSP_EUUID;
 		GT_0trace(curTrace, GT_6CLASS, "DCD_GetObjectDef: "
 			 "REG_GetValue() failed\n");
 		goto func_end;
 	}
+
 	/* Open COFF file. */
 	status = COD_Open(pDcdMgr->hCodMgr, szRegData, COD_NOLOAD, &lib);
 	if (DSP_FAILED(status)) {
@@ -547,13 +545,16 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 			 "COD_OpenBase() failed\n");
 		goto func_end;
 	}
+
 	/* Ensure szUuid + 1 is not greater than sizeof szSectName. */
-       DBC_Assert((strlen(szUuid) + 1) < sizeof(szSectName));
+	DBC_Assert((strlen(szUuid) + 1) < sizeof(szSectName));
+
 	/* Create section name based on node UUID. A period is
 	 * pre-pended to the UUID string to form the section name.
 	 * I.e. ".24BC8D90_BB45_11d4_B756_006008BDB66F" */
-       strncpy(szSectName, ".", 2);
-       strncat(szSectName, szUuid, strlen(szUuid));
+	strncpy(szSectName, ".", 2);
+	strncat(szSectName, szUuid, strlen(szUuid));
+
 	/* Get section information. */
 	status = COD_GetSection(lib, szSectName, &ulAddr, &ulLen);
 	if (DSP_FAILED(status)) {
@@ -562,10 +563,11 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 			 " COD_GetSection() failed\n");
 		goto func_end;
 	}
+
 	/* Allocate zeroed buffer. */
 	pszCoffBuf = MEM_Calloc(ulLen + 4, MEM_PAGED);
 #ifdef _DB_TIOMAP
-       if (strstr(szRegData, "iva") == NULL) {
+	if (strstr(szRegData, "iva") == NULL) {
 		/* Locate section by objectID and read its content. */
 		status = COD_ReadSection(lib, szSectName, pszCoffBuf, ulLen);
 	} else {
@@ -578,13 +580,14 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 #endif
 	if (DSP_SUCCEEDED(status)) {
 		/* Compres DSP buffer to conform to PC format. */
-               if (strstr(szRegData, "iva") == NULL) {
+		if (strstr(szRegData, "iva") == NULL) {
 			CompressBuf(pszCoffBuf, ulLen, DSPWORDSIZE);
 		} else {
 			CompressBuf(pszCoffBuf, ulLen, 1);
 			GT_0trace(curTrace, GT_4CLASS, "Compressing IVA "
 				 "COFF buffer by 1 for IVA !!\n");
 		}
+
 		/* Parse the content of the COFF buffer. */
 		status = GetAttrsFromBuf(pszCoffBuf, ulLen, objType, pObjDef);
 		if (DSP_FAILED(status)) {
@@ -597,6 +600,7 @@ DSP_STATUS DCD_GetObjectDef(IN struct DCD_MANAGER *hDcdMgr,
 		GT_0trace(curTrace, GT_6CLASS, "DCD_GetObjectDef: "
 			 "COD_ReadSection() failed\n");
 	}
+
 	/* Free the previously allocated dynamic buffer. */
 	MEM_Free(pszCoffBuf);
 func_end:
@@ -605,6 +609,7 @@ func_end:
 
 	if (szUuid)
 		MEM_Free(szUuid);
+
 	return status;
 }
 
@@ -635,6 +640,7 @@ DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr, IN char *pszCoffPath,
 			 "DCD_GetObjects: invalid DCD manager handle.\n");
 		goto func_end;
 	}
+
 	/* Open DSP coff file, don't load symbols. */
 	status = COD_Open(pDcdMgr->hCodMgr, pszCoffPath, COD_NOLOAD, &lib);
 	if (DSP_FAILED(status)) {
@@ -643,6 +649,7 @@ DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr, IN char *pszCoffPath,
 			 "DCD_AutoRegister: COD_Open() failed\n");
 		goto func_cont;
 	}
+
 	/* Get DCD_RESIGER_SECTION section information. */
 	status = COD_GetSection(lib, DCD_REGISTER_SECTION, &ulAddr, &ulLen);
 	if (DSP_FAILED(status) ||  !(ulLen > 0)) {
@@ -652,6 +659,7 @@ DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr, IN char *pszCoffPath,
 			 "- no auto register section\n");
 		goto func_cont;
 	}
+
 	/* Allocate zeroed buffer. */
 	pszCoffBuf = MEM_Calloc(ulLen + 4, MEM_PAGED);
 #ifdef _DB_TIOMAP
@@ -678,15 +686,19 @@ DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr, IN char *pszCoffPath,
 			GT_0trace(curTrace, GT_4CLASS, "Compress COFF buffer "
 				 "with 1 word for IVA !!\n");
 		}
+
 		/* Read from buffer and register object in buffer. */
 		pszCur = pszCoffBuf;
 		while ((pToken = strsep(&pszCur, seps)) && *pToken != '\0') {
 			/*  Retrieve UUID string. */
 			UUID_UuidFromString(pToken, &dspUuid);
+
 			/*  Retrieve object type */
 			pToken = strsep(&pszCur, seps);
+
 			/*  Retrieve object type */
 			cObjectType = Atoi(pToken);
+
 			/*
 			 *  Apply registerFxn to the found DCD object.
 			 *  Possible actions include:
@@ -715,6 +727,7 @@ DSP_STATUS DCD_GetObjects(IN struct DCD_MANAGER *hDcdMgr, IN char *pszCoffPath,
 		GT_0trace(curTrace, GT_6CLASS, "DCD_GetObjects: "
 			 "COD_ReadSection() failed\n");
 	}
+
 	/* Free the previously allocated dynamic buffer. */
 	MEM_Free(pszCoffBuf);
 func_cont:
@@ -732,9 +745,9 @@ func_end:
  *
  */
 DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
-			     IN struct DSP_UUID *pUuid,
-			     IN OUT char *pstrLibName, IN OUT u32 *pdwSize,
-			     enum NLDR_PHASE phase, OUT bool *fPhaseSplit)
+			IN struct DSP_UUID *pUuid,
+			IN OUT char *pstrLibName, IN OUT u32 *pdwSize,
+			enum NLDR_PHASE phase, OUT bool *fPhaseSplit)
 {
 	char szRegKey[REG_MAXREGPATHLENGTH];
 	char szUuid[MAXUUIDLEN];
@@ -751,16 +764,18 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
 		 "DCD_GetLibraryName: hDcdMgr 0x%x, pUuid 0x%x, "
 		 " pstrLibName 0x%x, pdwSize 0x%x\n", hDcdMgr, pUuid,
 		 pstrLibName, pdwSize);
+
 	/*
 	 *  Pre-determine final key length. It's length of DCD_REGKEY +
 	 *  "_\0" + length of szObjType string + terminating NULL.
 	 */
-       dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
+	dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
 	DBC_Assert(dwKeyLen < REG_MAXREGPATHLENGTH);
+
 	/* Create proper REG key; concatenate DCD_REGKEY with objType. */
-       strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
-       if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
-               strncat(szRegKey, "_\0", 2);
+	strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
+	if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
+		strncat(szRegKey, "_\0", 2);
 	else
 		status = DSP_EFAIL;
 
@@ -789,17 +804,17 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
 		status = DSP_EFAIL;
 	} else {
 		status = DSP_SOK;
-               if ((strlen(szRegKey) + strlen(szObjType))
-		   < REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, szObjType, strlen(szObjType) + 1);
+		if ((strlen(szRegKey) + strlen(szObjType)) <
+		   REG_MAXREGPATHLENGTH) {
+			strncat(szRegKey, szObjType, strlen(szObjType) + 1);
 		} else {
 			status = DSP_EFAIL;
 		}
 		/* Create UUID value to find match in registry. */
 		UUID_UuidToString(pUuid, szUuid, MAXUUIDLEN);
-               if ((strlen(szRegKey) + MAXUUIDLEN) <
+		if ((strlen(szRegKey) + MAXUUIDLEN) <
 		   REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, szUuid, MAXUUIDLEN);
+			strncat(szRegKey, szUuid, MAXUUIDLEN);
 		} else {
 			status = DSP_EFAIL;
 		}
@@ -808,29 +823,30 @@ DSP_STATUS DCD_GetLibraryName(IN struct DCD_MANAGER *hDcdMgr,
 		/* Retrieve path from the registry based on DSP_UUID */
 		status = REG_GetValue(szRegKey,	(u8 *)pstrLibName, pdwSize);
 	}
+
 	/* If can't find, phases might be registered as generic LIBRARYTYPE */
 	if (DSP_FAILED(status) && phase != NLDR_NOPHASE) {
 		if (fPhaseSplit)
 			*fPhaseSplit = false;
 
-               strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
-               if ((strlen(szRegKey) + strlen("_\0")) <
+		strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
+		if ((strlen(szRegKey) + strlen("_\0")) <
 		   REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, "_\0", 2);
+			strncat(szRegKey, "_\0", 2);
 		} else {
 			status = DSP_EFAIL;
 		}
 		sprintf(szObjType, "%d", DSP_DCDLIBRARYTYPE);
-               if ((strlen(szRegKey) + strlen(szObjType))
+		if ((strlen(szRegKey) + strlen(szObjType))
 		   < REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, szObjType, strlen(szObjType) + 1);
+			strncat(szRegKey, szObjType, strlen(szObjType) + 1);
 		} else {
 			status = DSP_EFAIL;
 		}
 		UUID_UuidToString(pUuid, szUuid, MAXUUIDLEN);
-               if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
-                       strncat(szRegKey, szUuid, MAXUUIDLEN);
-               else
+		if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
+			strncat(szRegKey, szUuid, MAXUUIDLEN);
+		else
 			status = DSP_EFAIL;
 
 		status = REG_GetValue(szRegKey, (u8 *)pstrLibName, pdwSize);
@@ -857,11 +873,11 @@ bool DCD_Init(void)
 		 cRefs);
 
 	if (cRefs == 0) {
-
 		/* Initialize required modules. */
 		fInitMEM = MEM_Init();
 		fInitCOD = COD_Init();
 		fInitREG = REG_Init();
+
 		if (!fInitMEM || !fInitCOD || !fInitREG) {
 			fInit = false;
 			GT_0trace(curTrace, GT_6CLASS, "DCD_Init failed\n");
@@ -897,91 +913,94 @@ bool DCD_Init(void)
  *      If pszPathName == NULL, unregister the specified DCD object.
  */
 DSP_STATUS DCD_RegisterObject(IN struct DSP_UUID *pUuid,
-			     IN enum DSP_DCDOBJTYPE objType,
-			     IN char *pszPathName)
+			IN enum DSP_DCDOBJTYPE objType,
+			IN char *pszPathName)
 {
 	DSP_STATUS status = DSP_SOK;
 	char szRegKey[REG_MAXREGPATHLENGTH];
 	char szUuid[MAXUUIDLEN + 1];
 	u32 dwPathSize = 0;
-	u32 dwKeyLen;		/* Len of REG key. */
+	u32 dwKeyLen;				/* Len of REG key. */
 	char szObjType[MAX_INT2CHAR_LENGTH];	/* str. rep. of objType. */
 
 	DBC_Require(cRefs > 0);
 	DBC_Require(pUuid != NULL);
 	DBC_Require((objType == DSP_DCDNODETYPE) ||
-		   (objType == DSP_DCDPROCESSORTYPE) ||
-		   (objType == DSP_DCDLIBRARYTYPE) ||
-		   (objType == DSP_DCDCREATELIBTYPE) ||
-		   (objType == DSP_DCDEXECUTELIBTYPE) ||
-		   (objType == DSP_DCDDELETELIBTYPE));
+			(objType == DSP_DCDPROCESSORTYPE) ||
+			(objType == DSP_DCDLIBRARYTYPE) ||
+			(objType == DSP_DCDCREATELIBTYPE) ||
+			(objType == DSP_DCDEXECUTELIBTYPE) ||
+			(objType == DSP_DCDDELETELIBTYPE));
 
 	GT_3trace(curTrace, GT_ENTER, "DCD_RegisterObject: object UUID 0x%x, "
 		 "objType %d, szPathName %s\n", pUuid, objType, pszPathName);
+
 	/*
 	 * Pre-determine final key length. It's length of DCD_REGKEY +
 	 *  "_\0" + length of szObjType string + terminating NULL.
 	 */
-       dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
+	dwKeyLen = strlen(DCD_REGKEY) + 1 + sizeof(szObjType) + 1;
 	DBC_Assert(dwKeyLen < REG_MAXREGPATHLENGTH);
+
 	/* Create proper REG key; concatenate DCD_REGKEY with objType. */
-       strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
-       if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
-               strncat(szRegKey, "_\0", 2);
-	else
+	strncpy(szRegKey, DCD_REGKEY, strlen(DCD_REGKEY) + 1);
+	if ((strlen(szRegKey) + strlen("_\0")) < REG_MAXREGPATHLENGTH)
+		strncat(szRegKey, "_\0", 2);
+	else {
 		status = DSP_EFAIL;
+		goto func_end;
+	}
 
 	status = snprintf(szObjType, MAX_INT2CHAR_LENGTH, "%d", objType);
 	if (status == -1) {
 		status = DSP_EFAIL;
 	} else {
 		status = DSP_SOK;
-               if ((strlen(szRegKey) + strlen(szObjType)) <
+		if ((strlen(szRegKey) + strlen(szObjType)) <
 		   REG_MAXREGPATHLENGTH) {
-                       strncat(szRegKey, szObjType, strlen(szObjType) + 1);
-		} else {
+			strncat(szRegKey, szObjType, strlen(szObjType) + 1);
+		} else
 			status = DSP_EFAIL;
-		}
+
 		/* Create UUID value to set in registry. */
 		UUID_UuidToString(pUuid, szUuid, MAXUUIDLEN);
-               if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
-                       strncat(szRegKey, szUuid, MAXUUIDLEN);
-               else
+		if ((strlen(szRegKey) + MAXUUIDLEN) < REG_MAXREGPATHLENGTH)
+			strncat(szRegKey, szUuid, MAXUUIDLEN);
+		else
 			status = DSP_EFAIL;
-
 	}
 
-	if (DSP_SUCCEEDED(status)) {
-		/*
-		 * If pszPathName != NULL, perform registration, otherwise,
-		 * perform unregistration.
-		 */
-		if (pszPathName) {
-			/* Add new reg value (UUID+objType) with COFF path
-			 * info. */
-                       dwPathSize = strlen(pszPathName) + 1;
-			status = REG_SetValue(szRegKey, (u8 *)pszPathName, dwPathSize);
-			GT_2trace(curTrace, GT_6CLASS, "REG_SetValue  "
-				  "(u8 *)pszPathName=%s, dwPathSize=%d\n",
-				  pszPathName, dwPathSize);
-
-			if (DSP_FAILED(status)) {
-				status = DSP_EFAIL;
-				GT_0trace(curTrace, GT_6CLASS,
+	if (DSP_FAILED(status))
+		goto func_end;
+
+	/*
+	 * If pszPathName != NULL, perform registration, otherwise,
+	 * perform unregistration.
+	 */
+	if (pszPathName) {
+		/* Add new reg value (UUID+objType) with COFF path info */
+		dwPathSize = strlen(pszPathName) + 1;
+		status = REG_SetValue(szRegKey, (u8 *)pszPathName, dwPathSize);
+		GT_2trace(curTrace, GT_6CLASS, "REG_SetValue "
+			"(u8 *)pszPathName=%s, dwPathSize=%d\n",
+			pszPathName, dwPathSize);
+
+		if (DSP_FAILED(status)) {
+			status = DSP_EFAIL;
+			GT_0trace(curTrace, GT_6CLASS,
 				  "DCD_RegisterObject: REG_SetValue failed!\n");
-			}
-		} else {
-			/* Deregister an existing object. */
-			status = REG_DeleteValue(szRegKey);
-			if (DSP_FAILED(status)) {
-				status = DSP_EFAIL;
-				GT_0trace(curTrace, GT_6CLASS,
-					"DCD_UnregisterObject: "
-					"REG_DeleteValue failed!\n");
-			}
+		}
+	} else {
+		/* Deregister an existing object */
+		status = REG_DeleteValue(szRegKey);
+		if (DSP_FAILED(status)) {
+			status = DSP_EFAIL;
+			GT_0trace(curTrace, GT_6CLASS, "DCD_UnregisterObject: "
+				"REG_DeleteValue failed!\n");
 		}
 	}
 
+
 	if (DSP_SUCCEEDED(status)) {
 		/*
 		 *  Because the node database has been updated through a
@@ -990,10 +1009,9 @@ DSP_STATUS DCD_RegisterObject(IN struct DSP_UUID *pUuid,
 		 *  current enumerations to reflect this update in the node
 		 *  database.
 		 */
-
 		cEnumRefs = 0;
 	}
-
+func_end:
 	return status;
 }
 
@@ -1080,7 +1098,6 @@ static s32 Atoi(char *pszBuf)
 				c = c - 'a' + 10;
 			else
 				c -= '0';
-
 		}
 		result += c;
 		++pch;
@@ -1116,7 +1133,6 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 		    || (objType == DSP_DCDPROCESSORTYPE));
 	DBC_Require(pGenObj != NULL);
 
-
 	switch (objType) {
 	case DSP_DCDNODETYPE:
 		/*
@@ -1137,12 +1153,12 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 		token = strsep(&pszCur, seps);
 
 		/* acName */
-               DBC_Require(token);
+		DBC_Require(token);
 		cLen = strlen(token);
 		if (cLen > DSP_MAXNAMELEN - 1)
 			cLen = DSP_MAXNAMELEN - 1;
 
-               strncpy(pGenObj->objData.nodeObj.ndbProps.acName,
+		strncpy(pGenObj->objData.nodeObj.ndbProps.acName,
 			   token, cLen);
 		pGenObj->objData.nodeObj.ndbProps.acName[cLen] = '\0';
 		token = strsep(&pszCur, seps);
@@ -1220,8 +1236,8 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 			Atoi(token);
 		token = strsep(&pszCur, seps);
 
-		/* char * pstrCreatePhaseFxn */
-               DBC_Require(token);
+		/* char *pstrCreatePhaseFxn */
+		DBC_Require(token);
 		cLen = strlen(token);
 		pGenObj->objData.nodeObj.pstrCreatePhaseFxn =
 			MEM_Calloc(cLen + 1, MEM_PAGED);
@@ -1230,8 +1246,8 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 		pGenObj->objData.nodeObj.pstrCreatePhaseFxn[cLen] = '\0';
 		token = strsep(&pszCur, seps);
 
-		/* char * pstrExecutePhaseFxn */
-               DBC_Require(token);
+		/* char *pstrExecutePhaseFxn */
+		DBC_Require(token);
 		cLen = strlen(token);
 		pGenObj->objData.nodeObj.pstrExecutePhaseFxn =
 			 MEM_Calloc(cLen + 1, MEM_PAGED);
@@ -1240,8 +1256,8 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 		pGenObj->objData.nodeObj.pstrExecutePhaseFxn[cLen] = '\0';
 		token = strsep(&pszCur, seps);
 
-		/* char * pstrDeletePhaseFxn */
-               DBC_Require(token);
+		/* char *pstrDeletePhaseFxn */
+		DBC_Require(token);
 		cLen = strlen(token);
 		pGenObj->objData.nodeObj.pstrDeletePhaseFxn =
 			MEM_Calloc(cLen + 1, MEM_PAGED);
@@ -1258,7 +1274,7 @@ static DSP_STATUS GetAttrsFromBuf(char *pszBuf, u32 ulBufSize,
 		pGenObj->objData.nodeObj.uMsgNotifyType = Atoi(token);
 		token = strsep(&pszCur, seps);
 
-		/* char * pstrIAlgName */
+		/* char *pstrIAlgName */
 		if (token) {
 			cLen = strlen(token);
 			pGenObj->objData.nodeObj.pstrIAlgName =
@@ -1388,7 +1404,6 @@ static void CompressBuf(char *pszBuf, u32 ulBufSize, s32 cCharSize)
 		return;
 
 	for (q = pszBuf; q < (pszBuf + ulBufSize);) {
-
 		ch = DspChar2GppChar(q, cCharSize);
 		if (ch == '\\') {
 			q += cCharSize;
@@ -1424,7 +1439,6 @@ static void CompressBuf(char *pszBuf, u32 ulBufSize, s32 cCharSize)
 	/* NULL out remainder of buffer. */
 	while (p < q)
 		*p++ = '\0';
-
 }
 
 /*
@@ -1460,8 +1474,8 @@ static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
 	char *pszCur;
 	char *pszFileName = NULL;
 	struct COD_LIBRARYOBJ *lib = NULL;
-	u32 ulAddr = 0;	/* Used by COD_GetSection */
-	u32 ulLen = 0;	/* Used by COD_GetSection */
+	u32 ulAddr = 0;				/* Used by COD_GetSection */
+	u32 ulLen = 0;				/* Used by COD_GetSection */
 	u32 dwDataSize = COD_MAXPATHLENGTH;
 	char seps[] = ", ";
 	char *pToken = NULL;
@@ -1494,6 +1508,7 @@ static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
 		status = DCD_GetLibraryName(hDcdMgr, pUuid, pszFileName,
 			 &dwDataSize, phase, NULL);
 	}
+
 	/* Open the library */
 	if (DSP_SUCCEEDED(status)) {
 		status = COD_Open(pDcdMgr->hCodMgr, pszFileName,
@@ -1525,6 +1540,7 @@ static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
 
 	/* Compress and format DSP buffer to conform to PC format. */
 	CompressBuf(pszCoffBuf, ulLen, DSPWORDSIZE);
+
 	/* Read from buffer */
 	pszCur = pszCoffBuf;
 	while ((pToken = strsep(&pszCur, seps)) && *pToken != '\0') {
@@ -1564,4 +1580,3 @@ func_cont:
 
 	return status;
 }
-
Signature · 1 line
1.6.2.4
#11 lore raw

PATCH v2 11/18 DSPBRIDGE: Do not panic on bad page count

If a page doesn't have a sane count, do not panic or release it. Loudly complain with dump_stack but do not halt with BUG.

---
 drivers/dsp/bridge/wmd/tiomap3430.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
drivers/dsp/bridge/wmd/tiomap3430.c +7 -5
index 65a21b2..f41763c 100644
@@ -301,7 +301,7 @@ static void bad_page_dump(u32 pa, struct page *pg)
 		current->comm, pg, (int)(2*sizeof(unsigned long)),
 		(unsigned long)pg->flags, pg->mapping,
 		page_mapcount(pg), page_count(pg));
-	BUG();
+	dump_stack();
 }
 
 /*
@@ -1707,9 +1707,10 @@ static DSP_STATUS WMD_BRD_MemUnMap(struct WMD_DEV_CONTEXT *hDevContext,
 						"COUNT 0 FOR PA 0x%x, size = "
 						"0x%x\n", pAddr, ulNumBytes);
 					bad_page_dump(pAddr, pg);
+				} else {
+					SetPageDirty(pg);
+					page_cache_release(pg);
 				}
-				SetPageDirty(pg);
-				page_cache_release(pg);
 				pAddr += HW_PAGE_SIZE_4KB;
 			}
 			if (HW_MMU_PteClear(pteAddrL2, vaCurr, pteSize)
@@ -1772,9 +1773,10 @@ skip_coarse_page:
 						"COUNT 0 FOR PA 0x%x, size = "
 						"0x%x\n", pAddr, ulNumBytes);
 					bad_page_dump(pAddr, pg);
+				} else {
+					SetPageDirty(pg);
+					page_cache_release(pg);
 				}
-				SetPageDirty(pg);
-				page_cache_release(pg);
 			}
 			pAddr += HW_PAGE_SIZE_4KB;
 		}
Signature · 1 line
1.6.2.4
#12 lore raw

PATCH v2 12/18 DSPBRIDGE: support loading 4 dependent DLL

From: Fernando Guzman Lugo <[email protected]>

This patch fixes loading a SN that has 4 dependent DLLs, previously it was failing due to a non-null terminated string.

---
 drivers/dsp/bridge/rmgr/dbdcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dsp/bridge/rmgr/dbdcd.c +1 -1
index b1391e2..fb06ff2 100644
@@ -1529,7 +1529,7 @@ static DSP_STATUS GetDepLibInfo(IN struct DCD_MANAGER *hDcdMgr,
 		goto func_cont;
 
 	/* Allocate zeroed buffer. */
-	pszCoffBuf = MEM_Calloc(ulLen, MEM_PAGED);
+	pszCoffBuf = MEM_Calloc(ulLen + 4, MEM_PAGED);
 	if (pszCoffBuf == NULL)
 		status = DSP_EMEMORY;
 
Signature · 1 line
1.6.2.4
#13 lore raw

PATCH v2 13/18 DSPBRIDGE: Memory leak in Node Register Notify

From: Ernesto Ramos Falcon <[email protected]>

Fix for memory leak in DSPNode_RegisterNotify when unregistering an object.

---
 drivers/dsp/bridge/pmgr/wcd.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/dsp/bridge/pmgr/wcd.c +5 -0
index 3fb5208..93460d1 100644
@@ -1403,6 +1403,11 @@ u32 NODEWRAP_RegisterNotify(union Trapped_Args *args)
 	notification.psName = NULL;
 	notification.handle = NULL;
 
+	if (!args->ARGS_PROC_REGISTER_NOTIFY.uEventMask)
+		cp_fm_usr(&notification,
+			args->ARGS_PROC_REGISTER_NOTIFY.hNotification,
+			status, 1);
+
 	status = NODE_RegisterNotify(args->ARGS_NODE_REGISTERNOTIFY.hNode,
 				    args->ARGS_NODE_REGISTERNOTIFY.uEventMask,
 				    args->ARGS_NODE_REGISTERNOTIFY.uNotifyType,
Signature · 1 line
1.6.2.4
#14 lore raw

PATCH v2 14/18 DSPBRIDGE: check pointer before calling Proc_Detach

From: Ernest Ramos Falcon <[email protected]>

This patch adds a check before calling Proc_Detach, otherwise we will see an error.

---
 drivers/dsp/bridge/rmgr/drv_interface.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/dsp/bridge/rmgr/drv_interface.c +2 -1
index a2df832..6415955 100644
@@ -592,7 +592,8 @@ static int bridge_release(struct inode *ip, struct file *filp)
 		if (DSP_SUCCEEDED(dsp_status)) {
 			flush_signals(current);
 			DRV_RemoveAllResources(pr_ctxt);
-			PROC_Detach(pr_ctxt->hProcessor);
+			if (pr_ctxt->hProcessor)
+				PROC_Detach(pr_ctxt->hProcessor);
 			DRV_RemoveProcContext((struct DRV_OBJECT *)hDrvObject,
 					pr_ctxt, (void *)pr_ctxt->pid);
 		} else {
Signature · 1 line
1.6.2.4
#15 lore raw

PATCH v2 15/18 DSPBRIDGE: check the status of DMM_GetHandle

Check the status of DMM_GetHandle

---
 drivers/dsp/bridge/rmgr/proc.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
drivers/dsp/bridge/rmgr/proc.c +10 -7
index 3c23d85..1ab6181 100644
@@ -1833,16 +1833,19 @@ DSP_STATUS PROC_UnMap(DSP_HPROCESSOR hProcessor, void *pMapAddr)
 	}
 
 	status = DMM_GetHandle(hProcessor, &hDmmMgr);
-	/* Critical section */
-	(void)SYNC_EnterCS(hProcLock);
 	if (DSP_FAILED(status)) {
 		GT_1trace(PROC_DebugMask, GT_7CLASS, "PROC_UnMap: "
-			 "Failed to get DMM Mgr handle: 0x%x\n", status);
-	} else {
-		/* Update DMM structures. Get the size to unmap.
-		 This function returns error if the VA is not mapped */
-		status = DMM_UnMapMemory(hDmmMgr, (u32) vaAlign, &sizeAlign);
+			"Failed to get DMM Mgr handle: 0x%x\n", status);
+		goto func_end;
 	}
+
+	/* Critical section */
+	(void)SYNC_EnterCS(hProcLock);
+	/*
+	 * Update DMM structures. Get the size to unmap.
+	 * This function returns error if the VA is not mapped
+	 */
+	status = DMM_UnMapMemory(hDmmMgr, (u32) vaAlign, &sizeAlign);
 	/* Remove mapping from the page tables. */
 	if (DSP_SUCCEEDED(status)) {
 		status = (*pProcObject->pIntfFxns->pfnBrdMemUnMap)
Signature · 1 line
1.6.2.4
#16 lore raw

PATCH v2 16/18 DSPBRIDGE: KFILE_Seek & KFILE_Tell, u32 replaced with loff_t

KFILE_Seek & KFILE_Tell, u32 replaced with loff_t

---
 drivers/dsp/bridge/pmgr/cod.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/dsp/bridge/pmgr/cod.c +2 -2
index a85f2a7..1ebbe8d 100644
@@ -199,7 +199,7 @@ static s32 COD_fRead(void __user *pBuffer, s32 cSize, s32 cCount,
 
 static s32 COD_fSeek(struct file *hFile, s32 lOffset, s32 cOrigin)
 {
-	u32 dwCurPos;
+	loff_t dwCurPos;
 
 	/* check for valid file handle */
 	if (!hFile)
@@ -217,7 +217,7 @@ static s32 COD_fSeek(struct file *hFile, s32 lOffset, s32 cOrigin)
 
 static s32 COD_fTell(struct file *hFile)
 {
-	u32 dwCurPos;
+	loff_t dwCurPos;
 
 	if (!hFile)
 		return DSP_EHANDLE;
Signature · 1 line
1.6.2.4
#17 lore raw

PATCH v2 17/18 DSPBRIDGE: Delete unused files

These files seem to be unused, deleting them.

---
 arch/arm/plat-omap/include/dspbridge/dbl.h  |  354 -------
 arch/arm/plat-omap/include/dspbridge/dbof.h |  117 ---
 drivers/dsp/bridge/dynload/dlclasses_hdr.h  |   41 -
 drivers/dsp/bridge/pmgr/dbl.c               | 1385 ---------------------------
 4 files changed, 0 insertions(+), 1897 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/dbl.h
 delete mode 100644 arch/arm/plat-omap/include/dspbridge/dbof.h
 delete mode 100644 drivers/dsp/bridge/dynload/dlclasses_hdr.h
 delete mode 100644 drivers/dsp/bridge/pmgr/dbl.c
arch/arm/plat-omap/include/dspbridge/dbl.h deleted +0 -354
deleted file mode 100644
index 19847f9..0000000
@@ -1,354 +0,0 @@
-/*
- * dbl.h
- *
- * DSP-BIOS Bridge driver support functions for TI OMAP processors.
- *
- * Copyright (C) 2005-2006 Texas Instruments, Inc.
- *
- * This package is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-
-/*
- *  ======== dbl.h ========
- *
- *! Revision History
- *! ================
- *! 19-Mar-2002 jeh     Pass DBL_Symbol pointer to DBL_getAddr, DBL_getCAddr
- *!                     to accomodate dynamic loader library.
- *! 20-Nov-2001 jeh     Removed DBL_loadArgs().
- *! 24-Sep-2001 jeh     Code review changes.
- *! 07-Sep-2001 jeh     Added DBL_LoadSect(), DBL_UnloadSect().
- *! 05-Jun-2001 jeh     Created based on zl.h.
- */
-
-#ifndef DBL_
-#define DBL_
-
-#include <dspbridge/dbdefs.h>
-#include <dspbridge/dbldefs.h>
-
-/*
- *  ======== DBL_close ========
- *  Close library opened with DBL_open.
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *  Returns:
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *  Ensures:
- */
-	extern void DBL_close(struct DBL_LibraryObj *lib);
-
-/*
- *  ======== DBL_create ========
- *  Create a target object by specifying the alloc, free, and write
- *  functions for the target.
- *  Parameters:
- *      pTarget         - Location to store target handle on output.
- *      pAttrs          - Attributes.
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_EMEMORY:    Memory allocation failed.
- *  Requires:
- *      DBL initialized.
- *      pAttrs != NULL.
- *      pTarget != NULL;
- *  Ensures:
- *      Success:        *pTarget != NULL.
- *      Failure:        *pTarget == NULL.
- */
-	extern DSP_STATUS DBL_create(struct DBL_TargetObj **pTarget,
-				     struct DBL_Attrs *pAttrs);
-
-/*
- *  ======== DBL_delete ========
- *  Delete target object and free resources for any loaded libraries.
- *  Parameters:
- *      target          - Handle returned from DBL_Create().
- *  Returns:
- *  Requires:
- *      DBL initialized.
- *      Valid target.
- *  Ensures:
- */
-	extern void DBL_delete(struct DBL_TargetObj *target);
-
-/*
- *  ======== DBL_exit ========
- *  Discontinue use of DBL module.
- *  Parameters:
- *  Returns:
- *  Requires:
- *      cRefs > 0.
- *  Ensures:
- *      cRefs >= 0.
- */
-	extern void DBL_exit(void);
-
-/*
- *  ======== DBL_getAddr ========
- *  Get address of name in the specified library.
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      name            - Name of symbol
- *      ppSym           - Location to store symbol address on output.
- *  Returns:
- *      TRUE:           Success.
- *      FALSE:          Symbol not found.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      name != NULL.
- *      pAddr != NULL.
- *  Ensures:
- */
-	extern bool DBL_getAddr(struct DBL_LibraryObj *lib, char *name,
-				struct DBL_Symbol **ppSym);
-
-/*
- *  ======== DBL_getAttrs ========
- *  Retrieve the attributes of the target.
- *  Parameters:
- *      target          - Handle returned from DBL_Create().
- *      pAttrs          - Location to store attributes on output.
- *  Returns:
- *  Requires:
- *      DBL initialized.
- *      Valid target.
- *      pAttrs != NULL.
- *  Ensures:
- */
-	extern void DBL_getAttrs(struct DBL_TargetObj *target,
-				 struct DBL_Attrs *pAttrs);
-
-/*
- *  ======== DBL_getCAddr ========
- *  Get address of "C" name in the specified library.
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      name            - Name of symbol
- *      ppSym           - Location to store symbol address on output.
- *  Returns:
- *      TRUE:           Success.
- *      FALSE:          Symbol not found.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      name != NULL.
- *      pAddr != NULL.
- *  Ensures:
- */
-	extern bool DBL_getCAddr(struct DBL_LibraryObj *lib, char *name,
-				 struct DBL_Symbol **ppSym);
-
-/*
- *  ======== DBL_getEntry ========
- *  Get program entry point.
- *
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      pEntry          - Location to store entry address on output.
- *  Returns:
- *      TRUE:           Success.
- *      FALSE:          Failure.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      pEntry != NULL.
- *  Ensures:
- */
-	extern bool DBL_getEntry(struct DBL_LibraryObj *lib, u32 *pEntry);
-
-/*
- *  ======== DBL_getSect ========
- *  Get address and size of a named section.
- *  Parameters:
- *      lib             - Library handle returned from DBL_open().
- *      name            - Name of section.
- *      pAddr           - Location to store section address on output.
- *      pSize           - Location to store section size on output.
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_ENOSECT:    Section not found.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      name != NULL.
- *      pAddr != NULL;
- *      pSize != NULL.
- *  Ensures:
- */
-	extern DSP_STATUS DBL_getSect(struct DBL_LibraryObj *lib, char *name,
-				      u32 *pAddr, u32 *pSize);
-
-/*
- *  ======== DBL_init ========
- *  Initialize DBL module.
- *  Parameters:
- *  Returns:
- *      TRUE:           Success.
- *      FALSE:          Failure.
- *  Requires:
- *      cRefs >= 0.
- *  Ensures:
- *      Success:        cRefs > 0.
- *      Failure:        cRefs >= 0.
- */
-	extern bool DBL_init(void);
-
-/*
- *  ======== DBL_load ========
- *  Add symbols/code/data defined in file to that already present on
- *  the target.
- *
- *  Parameters:
- *      lib             - Library handle returned from DBL_open().
- *      flags           - Specifies whether loading code, data, and/or symbols.
- *      attrs           - May contain write, alloc, and free functions.
- *      pulEntry        - Location to store program entry on output.
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_EFREAD:     File read failed.
- *      DSP_EFWRITE:    Write to target failed.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      pEntry != NULL.
- *  Ensures:
- */
-	extern DSP_STATUS DBL_load(struct DBL_LibraryObj *lib, DBL_Flags flags,
-				   struct DBL_Attrs *attrs, u32 *pEntry);
-
-/*
- *  ======== DBL_loadSect ========
- *  Load a named section from an library (for overlay support).
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      sectName        - Name of section to load.
- *      attrs           - Contains write function and handle to pass to it.
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_ENOSECT:    Section not found.
- *      DSP_EFWRITE:    Write function failed.
- *  Requires:
- *      Valid lib.
- *      sectName != NULL.
- *      attrs != NULL.
- *      attrs->write != NULL.
- *  Ensures:
- */
-	extern DSP_STATUS DBL_loadSect(struct DBL_LibraryObj *lib,
-				       char *sectName,
-				       struct DBL_Attrs *attrs);
-
-/*
- *  ======== DBL_open ========
- *  DBL_open() returns a library handle that can be used to load/unload
- *  the symbols/code/data via DBL_load()/DBL_unload().
- *  Parameters:
- *      target          - Handle returned from DBL_create().
- *      file            - Name of file to open.
- *      flags           - Specifies whether to load symbols now.
- *      pLib            - Location to store library handle on output.
- *  Returns:
- *      DSP_SOK:            Success.
- *      DSP_EMEMORY:        Memory allocation failure.
- *      DSP_EFOPEN:         File open failure.
- *      DSP_EFREAD:         File read failure.
- *      DSP_ECORRUPTFILE:   Unable to determine target type.
- *  Requires:
- *      DBL initialized.
- *      Valid target.
- *      file != NULL.
- *      pLib != NULL.
- *      struct DBL_Attrs fopen function non-NULL.
- *  Ensures:
- *      Success:        Valid *pLib.
- *      Failure:        *pLib == NULL.
- */
-	extern DSP_STATUS DBL_open(struct DBL_TargetObj *target, char *file,
-				   DBL_Flags flags,
-				   struct DBL_LibraryObj **pLib);
-
-/*
- *  ======== DBL_readSect ========
- *  Read COFF section into a character buffer.
- *  Parameters:
- *      lib             - Library handle returned from DBL_open().
- *      name            - Name of section.
- *      pBuf            - Buffer to write section contents into.
- *      size            - Buffer size
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_ENOSECT:    Named section does not exists.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      name != NULL.
- *      pBuf != NULL.
- *      size != 0.
- *  Ensures:
- */
-	extern DSP_STATUS DBL_readSect(struct DBL_LibraryObj *lib, char *name,
-				       char *pBuf, u32 size);
-
-/*
- *  ======== DBL_setAttrs ========
- *  Set the attributes of the target.
- *  Parameters:
- *      target          - Handle returned from DBL_create().
- *      pAttrs          - New attributes.
- *  Returns:
- *  Requires:
- *      DBL initialized.
- *      Valid target.
- *      pAttrs != NULL.
- *  Ensures:
- */
-	extern void DBL_setAttrs(struct DBL_TargetObj *target,
-				 struct DBL_Attrs *pAttrs);
-
-/*
- *  ======== DBL_unload ========
- *  Remove the symbols/code/data corresponding to the library lib.
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      attrs           - Contains free() function and handle to pass to it.
- *  Returns:
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *  Ensures:
- */
-	extern void DBL_unload(struct DBL_LibraryObj *lib,
-			       struct DBL_Attrs *attrs);
-
-/*
- *  ======== DBL_unloadSect ========
- *  Unload a named section from an library (for overlay support).
- *  Parameters:
- *      lib             - Handle returned from DBL_open().
- *      sectName        - Name of section to load.
- *      attrs           - Contains free() function and handle to pass to it.
- *  Returns:
- *      DSP_SOK:        Success.
- *      DSP_ENOSECT:    Named section not found.
- *  Requires:
- *      DBL initialized.
- *      Valid lib.
- *      sectName != NULL.
- *  Ensures:
- */
-	extern DSP_STATUS DBL_unloadSect(struct DBL_LibraryObj *lib,
-					 char *sectName,
-					 struct DBL_Attrs *attrs);
-
-#endif				/* DBL_ */
arch/arm/plat-omap/include/dspbridge/dbof.h deleted +0 -117

117 lines not on this page · raw message

drivers/dsp/bridge/dynload/dlclasses_hdr.h deleted +0 -41

41 lines not on this page · raw message

drivers/dsp/bridge/pmgr/dbl.c deleted +0 -1385

1,385 lines not on this page · raw message

Signature · 1 line
1.6.2.4
#18 lore raw

PATCH v2 18/18 DSPBRIDGE: Compilation fixes 2.6.31

Compilation fixes 2.6.31

board-sdp3430.h not found
clk_handle undefined because of DVFS flag

---
 arch/arm/mach-omap2/dspbridge.c         |    2 ++
 drivers/dsp/bridge/rmgr/drv_interface.c |    8 ++++----
 drivers/dsp/bridge/rmgr/proc.c          |    3 +++
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |    3 ---
 4 files changed, 9 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/dspbridge.c +2 -0
index 9724a95..ea109a3 100644
@@ -13,7 +13,9 @@
 
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_BRIDGE_DVFS
 #include <mach/omap-pm.h>
+#endif
 
 #include <dspbridge/host_os.h>
 
drivers/dsp/bridge/rmgr/drv_interface.c +4 -4
index 6415955..16529d8 100644
@@ -59,8 +59,6 @@
 #include <linux/moduleparam.h>
 #include <linux/cdev.h>
 
-#include <mach/board-3430sdp.h>
-
 /*  ----------------------------------- DSP/BIOS Bridge */
 #include <dspbridge/std.h>
 #include <dspbridge/dbdefs.h>
@@ -96,8 +94,10 @@
 #include <dspbridge/drv.h>
 #endif
 
+#ifdef CONFIG_BRIDGE_DVFS
 #include <mach/omap-pm.h>
 #include <mach-omap2/omap3-opp.h>
+#endif
 
 #define BRIDGE_NAME "C6410"
 /*  ----------------------------------- Globals */
@@ -458,10 +458,10 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 		driverContext = 0;
 		DBC_Assert(ret == true);
 	}
-
+#ifdef CONFIG_BRIDGE_DVFS
 	clk_put(clk_handle);
 	clk_handle = NULL;
-
+#endif
 func_cont:
 	MEM_ExtPhysPoolRelease();
 
drivers/dsp/bridge/rmgr/proc.c +3 -0
index 1ab6181..f4f756c 100644
@@ -142,7 +142,10 @@
 /*  ----------------------------------- This */
 #include <dspbridge/proc.h>
 #include <dspbridge/pwr.h>
+
+#ifdef CONFIG_BRIDGE_DVFS
 #include <mach-omap2/omap3-opp.h>
+#endif
 
 #ifndef RES_CLEANUP_DISABLE
 #include <dspbridge/resourcecleanup.h>
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +0 -3
index ea299a0..00202e1 100644
@@ -66,9 +66,6 @@
 #include <mach-omap2/prm-regbits-34xx.h>
 #include <mach-omap2/cm-regbits-34xx.h>
 
-#ifdef CONFIG_PM
-#include <mach/board-3430sdp.h>
-#endif
 extern s32 dsp_test_sleepstate;
 extern struct MAILBOX_CONTEXT mboxsetting;
 
Signature · 1 line
1.6.2.4
#19 lore raw

cover dsp-bridge: PM cleanups

From: Felipe Contreras <[email protected]>

These patches apply on top of a commit in Omar's wip dspbridge-baseline:
cd0c004e5c6bc9da58d03931766115ec1e8bcaaf

They are supposed to replace "Compilation fixes 2.6.31".

Felipe Contreras (2):
dsp-bridge: improve PM conditional code
dsp-bridge: remove unused includes

 arch/arm/mach-omap2/dspbridge.c         |    2 ++
 drivers/dsp/bridge/rmgr/drv_interface.c |    8 ++++----
 drivers/dsp/bridge/rmgr/proc.c          |    1 -
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |    3 +--
 4 files changed, 7 insertions(+), 7 deletions(-)
#20 lore raw

PATCH 1/2 dsp-bridge: improve PM conditional code

In reply to Omar Ramirez Luna
---
 arch/arm/mach-omap2/dspbridge.c         |    2 ++
 drivers/dsp/bridge/rmgr/drv_interface.c |    5 ++++-
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/dspbridge.c +2 -0
index 9724a95..ea109a3 100644
@@ -13,7 +13,9 @@
 
 #include <linux/platform_device.h>
 
+#ifdef CONFIG_BRIDGE_DVFS
 #include <mach/omap-pm.h>
+#endif
 
 #include <dspbridge/host_os.h>
 
drivers/dsp/bridge/rmgr/drv_interface.c +4 -1
index 6415955..90d4bad 100644
@@ -96,8 +96,10 @@
 #include <dspbridge/drv.h>
 #endif
 
+#ifdef CONFIG_BRIDGE_DVFS
 #include <mach/omap-pm.h>
 #include <mach-omap2/omap3-opp.h>
+#endif
 
 #define BRIDGE_NAME "C6410"
 /*  ----------------------------------- Globals */
@@ -147,7 +149,6 @@ static int omap34xxbridge_suspend_lockout(
 	}
 	return 0;
 }
-
 #endif
 
 #ifdef DEBUG
@@ -459,8 +460,10 @@ static int __devexit omap34xx_bridge_remove(struct platform_device *pdev)
 		DBC_Assert(ret == true);
 	}
 
+#ifdef CONFIG_BRIDGE_DVFS
 	clk_put(clk_handle);
 	clk_handle = NULL;
+#endif /* #ifdef CONFIG_BRIDGE_DVFS */
 
 func_cont:
 	MEM_ExtPhysPoolRelease();
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +1 -1
index ea299a0..8a0cb02 100644
@@ -68,8 +68,8 @@
 
 #ifdef CONFIG_PM
 #include <mach/board-3430sdp.h>
-#endif
 extern s32 dsp_test_sleepstate;
+#endif
 extern struct MAILBOX_CONTEXT mboxsetting;
 
 /*
Signature · 1 line
1.6.6.rc2.5.g49666
#21 lore raw

PATCH 2/2 dsp-bridge: remove unused includes

In reply to Omar Ramirez Luna
---
 drivers/dsp/bridge/rmgr/drv_interface.c |    3 ---
 drivers/dsp/bridge/rmgr/proc.c          |    1 -
 drivers/dsp/bridge/wmd/tiomap3430_pwr.c |    1 -
 3 files changed, 0 insertions(+), 5 deletions(-)
drivers/dsp/bridge/rmgr/drv_interface.c +0 -3
index 90d4bad..8c804af 100644
@@ -59,8 +59,6 @@
 #include <linux/moduleparam.h>
 #include <linux/cdev.h>
 
-#include <mach/board-3430sdp.h>
-
 /*  ----------------------------------- DSP/BIOS Bridge */
 #include <dspbridge/std.h>
 #include <dspbridge/dbdefs.h>
@@ -97,7 +95,6 @@
 #endif
 
 #ifdef CONFIG_BRIDGE_DVFS
-#include <mach/omap-pm.h>
 #include <mach-omap2/omap3-opp.h>
 #endif
 
drivers/dsp/bridge/rmgr/proc.c +0 -1
index 1ab6181..267f29c 100644
@@ -142,7 +142,6 @@
 /*  ----------------------------------- This */
 #include <dspbridge/proc.h>
 #include <dspbridge/pwr.h>
-#include <mach-omap2/omap3-opp.h>
 
 #ifndef RES_CLEANUP_DISABLE
 #include <dspbridge/resourcecleanup.h>
drivers/dsp/bridge/wmd/tiomap3430_pwr.c +0 -1
index 8a0cb02..fd6097d 100644
@@ -67,7 +67,6 @@
 #include <mach-omap2/cm-regbits-34xx.h>
 
 #ifdef CONFIG_PM
-#include <mach/board-3430sdp.h>
 extern s32 dsp_test_sleepstate;
 #endif
 extern struct MAILBOX_CONTEXT mboxsetting;
Signature · 1 line
1.6.6.rc2.5.g49666
#22 lore raw

Re: [PATCHv2 18/18] DSPBRIDGE: Compilation fixes 2.6.31

In reply to Omar Ramirez Luna
Quoted 4 lines · Omar Ramirez Luna

Compilation fixes 2.6.31

       board-sdp3430.h not found
       clk_handle undefined because of DVFS flag

In fact, these are not specific to 2.6.31. The changes are good to have even on 2.6.28; they would get rid of warnings on certain configurations.

So I'm sending a proposal that's a bit different: first I clean the PM idefs, then I remove unused headers. The end result is almost the
same: the code compiles on 2.6.31 :)

Signature · 5 lines
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#23 lore raw

RE: [PATCHv2 18/18] DSPBRIDGE: Compilation fixes 2.6.31

Hi,

Quoted 14 lines

-----Original Message-----
From: Felipe Contreras [mailto:[email protected]]
Sent: Friday, December 18, 2009 11:49 AM
To: Ramirez Luna, Omar
Cc: linux-omap; Hiroshi Doyu; Ameya Palande; Felipe Contreras; Guzman Lugo, Fernando; Ramos Falcon, Ernesto
Subject: Re: [PATCHv2 18/18] DSPBRIDGE: Compilation fixes 2.6.31

Quoted 4 lines · Omar Ramirez Luna

Compilation fixes 2.6.31

       board-sdp3430.h not found
       clk_handle undefined because of DVFS flag

Quoted 8 lines

In fact, these are not specific to 2.6.31. The changes are good to have even on 2.6.28; they would get rid of warnings on certain configurations.

So I'm sending a proposal that's a bit different: first I clean the PM idefs, then I remove unused headers. The end result is almost the
same: the code compiles on 2.6.31 :)

Had a quick look at them, I agree patch 18 (DSPBRIDGE: Compilation fixes 2.6.31) can be replaced.

- omar
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html