summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Peiffer <pierre.peiffer@stericsson.com>2011-08-16 17:43:12 +0200
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:06:57 +0200
commitdcab3e4c337744c28f7512059dd8b0e2c685be8f (patch)
tree83acc24d2015aa1b51edce5a0420e8c00cad604b
parent907ef065c49bfe1e085f883fdae7a9325d7daa16 (diff)
U8500 CM: make call to stopper synchronous
When a component uses the MMDSP hardware pipe, make the call to the stopper synchronous. Otherwise, the hardware pipe is stopped before the stopper is called, which may be wrong if the stopper still needs to access the pipe. ST-Ericsson ID: 352780 ST-Ericsson Linux next: - ST-Ericsson FOSS-OUT ID: Trivial Signed-off-by: Pierre Peiffer <pierre.peiffer@stericsson.com> Change-Id: I9aaac434f2b11e25c54fae2c12ef3d812dd716ec Depends-On: I8c2e2d6f33af3c53d2438e57658337f6c9f91477
-rw-r--r--drivers/staging/nmf-cm/cm/engine/communication/src/communication.c3
-rw-r--r--drivers/staging/nmf-cm/cm/engine/component/src/initializer.c1
-rw-r--r--drivers/staging/nmf-cm/cm/engine/component/src/instantiater.c15
-rw-r--r--drivers/staging/nmf-cm/cm/engine/memory/src/chunk_mgr.c9
-rw-r--r--drivers/staging/nmf-cm/inc/nmf-def.h2
-rw-r--r--drivers/staging/nmf-cm/share/communication/inc/initializer.h1
6 files changed, 20 insertions, 11 deletions
diff --git a/drivers/staging/nmf-cm/cm/engine/communication/src/communication.c b/drivers/staging/nmf-cm/cm/engine/communication/src/communication.c
index 897ed8038d1..5bd9fbe22fa 100644
--- a/drivers/staging/nmf-cm/cm/engine/communication/src/communication.c
+++ b/drivers/staging/nmf-cm/cm/engine/communication/src/communication.c
@@ -52,7 +52,8 @@ PRIVATE const t_callback_method internalHostJumptable[] = {
processSyncAcknowledge,
processAsyncAcknowledge,
processSyncAcknowledge,
- processSyncAcknowledge
+ processSyncAcknowledge, // Start sync
+ processSyncAcknowledge // Stop sync
};
PUBLIC t_cm_error cm_COM_Init(t_nmf_coms_location _comsLocation)
diff --git a/drivers/staging/nmf-cm/cm/engine/component/src/initializer.c b/drivers/staging/nmf-cm/cm/engine/component/src/initializer.c
index 7391669419e..72bc286d1d4 100644
--- a/drivers/staging/nmf-cm/cm/engine/component/src/initializer.c
+++ b/drivers/staging/nmf-cm/cm/engine/component/src/initializer.c
@@ -134,6 +134,7 @@ PUBLIC t_cm_error cm_COMP_CallService(
t_uint16 params[INIT_COMPONENT_CMD_SIZE];
t_bool isSynchronous = (serviceIndex == NMF_CONSTRUCT_SYNC_INDEX ||
serviceIndex == NMF_START_SYNC_INDEX ||
+ serviceIndex == NMF_STOP_SYNC_INDEX ||
serviceIndex == NMF_DESTROY_INDEX)?TRUE:FALSE;
params[INIT_COMPONENT_CMD_HANDLE_INDEX] = (t_uint16)((unsigned int)pComp & 0xFFFF);
diff --git a/drivers/staging/nmf-cm/cm/engine/component/src/instantiater.c b/drivers/staging/nmf-cm/cm/engine/component/src/instantiater.c
index 2f517a98179..7897a237838 100644
--- a/drivers/staging/nmf-cm/cm/engine/component/src/instantiater.c
+++ b/drivers/staging/nmf-cm/cm/engine/component/src/instantiater.c
@@ -584,6 +584,7 @@ t_cm_error cm_stopComponent(t_component_instance* component, t_nmf_client_id cli
{
char value[MAX_PROPERTY_VALUE_LENGTH];
t_cm_error error = CM_OK;
+ t_bool isHwProperty;
/*
* Special code for SINGLETON handling
@@ -609,6 +610,12 @@ t_cm_error cm_stopComponent(t_component_instance* component, t_nmf_client_id cli
// CM_ASSERT component->state == STATE_RUNNABLE
component->state = STATE_STOPPED;
+ isHwProperty = (cm_getComponentProperty(
+ component,
+ "hardware",
+ value,
+ sizeof(value)) == CM_OK);
+
if (cm_DSP_GetState(component->template->dspId)->state != MPC_STATE_BOOTED)
{
error = CM_MPC_NOT_RESPONDING;
@@ -621,7 +628,7 @@ t_cm_error cm_stopComponent(t_component_instance* component, t_nmf_client_id cli
if(component->template->LCCStopAddress != 0)
{
if ((error = cm_COMP_CallService(
- NMF_STOP_INDEX,
+ isHwProperty ? NMF_STOP_SYNC_INDEX : NMF_STOP_INDEX,
component,
component->template->LCCStopAddress)) != CM_OK)
{
@@ -634,11 +641,7 @@ t_cm_error cm_stopComponent(t_component_instance* component, t_nmf_client_id cli
/*
* Power on, HW resources if required
*/
- if(cm_getComponentProperty(
- component,
- "hardware",
- value,
- sizeof(value)) == CM_OK)
+ if(isHwProperty)
{
cm_PWR_DisableMPC(MPC_PWR_HWIP, component->template->dspId);
}
diff --git a/drivers/staging/nmf-cm/cm/engine/memory/src/chunk_mgr.c b/drivers/staging/nmf-cm/cm/engine/memory/src/chunk_mgr.c
index 26c00cdeb77..78a549a74ce 100644
--- a/drivers/staging/nmf-cm/cm/engine/memory/src/chunk_mgr.c
+++ b/drivers/staging/nmf-cm/cm/engine/memory/src/chunk_mgr.c
@@ -19,10 +19,10 @@ struct t_page_chuncks {
t_cm_chunk chunks[CHUNKS_PER_PAGE];
};
-static struct t_page_chuncks *firstPage;
+static struct t_page_chuncks *firstPage = 0;
-static unsigned int freeChunks;
-static t_cm_chunk *firstFreeChunk;
+static unsigned int freeChunks = 0;
+static t_cm_chunk *firstFreeChunk = 0;
t_cm_chunk* allocChunk()
{
@@ -91,4 +91,7 @@ void freeChunkPool(void)
firstPage = firstPage->nextPage;
OSAL_Free(tofree);
}
+
+ firstFreeChunk = 0;
+ freeChunks = 0;
}
diff --git a/drivers/staging/nmf-cm/inc/nmf-def.h b/drivers/staging/nmf-cm/inc/nmf-def.h
index 8e042d3fe62..86e28626498 100644
--- a/drivers/staging/nmf-cm/inc/nmf-def.h
+++ b/drivers/staging/nmf-cm/inc/nmf-def.h
@@ -21,7 +21,7 @@
*
* \ingroup NMF_VERSION
*/
-#define NMF_VERSION ((2 << 16) | (10 << 8) | (110))
+#define NMF_VERSION ((2 << 16) | (10 << 8) | (113))
/*!
* \brief Get NMF major version corresponding to NMF version number
diff --git a/drivers/staging/nmf-cm/share/communication/inc/initializer.h b/drivers/staging/nmf-cm/share/communication/inc/initializer.h
index ea5aa68f2dc..10985c3981a 100644
--- a/drivers/staging/nmf-cm/share/communication/inc/initializer.h
+++ b/drivers/staging/nmf-cm/share/communication/inc/initializer.h
@@ -19,6 +19,7 @@
#define NMF_ULP_ALLOWSLEEP 8
#define NMF_CONSTRUCT_SYNC_INDEX 9
#define NMF_START_SYNC_INDEX 10
+#define NMF_STOP_SYNC_INDEX 11
/*
* Index of datas in command parameter format