>From f9f553588f8e3bf391bab72e59ee2593ee5f5f9b Mon Sep 17 00:00:00 2001
From: armando uribe <[email protected]>
Date: Wed, 16 Jun 2010 20:15:04 -0500
Subject: [PATCH] DSPBRIDGE: decrease message pending in case of timeout

In the function bridge_msg_put() the pending message counter was not being 
drecreased in case of timeout, leading MPU get stalled in delete_node()

Signed-off-by: armando <[email protected]>
---
 drivers/dsp/bridge/wmd/msg_sm.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c 
index b505c5e..d56b46b 100644
--- a/drivers/dsp/bridge/wmd/msg_sm.c
+++ b/drivers/dsp/bridge/wmd/msg_sm.c
@@ -446,12 +446,16 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,
                syncs[1] = msg_queue_obj->sync_done;
                status = sync_wait_on_multiple_events(syncs, 2, utimeout,
                                                      &index);
-               if (DSP_FAILED(status))
-                       goto func_end;
                /* Enter critical section */
                spin_lock_bh(&hmsg_mgr->msg_mgr_lock);
+               msg_queue_obj->io_msg_pend--;
+
+               if (DSP_FAILED(status)) {
+                       spin_unlock_bh(&hmsg_mgr->msg_mgr_lock);
+                       goto func_end;
+               }
+
                if (msg_queue_obj->done) {
-                       msg_queue_obj->io_msg_pend--;
                        /* Exit critical section */
                        spin_unlock_bh(&hmsg_mgr->msg_mgr_lock);
                        /*  Signal that we're not going to access msg_queue_obj 
@@ -484,7 +488,6 @@ int bridge_msg_put(struct msg_queue *msg_queue_obj,
                                iosm_schedule(hmsg_mgr->hio_mgr);
                        }
 
-                       msg_queue_obj->io_msg_pend--;
                        /* Reset event if there are still frames available */
                        if (!LST_IS_EMPTY(hmsg_mgr->msg_free_list))
                                sync_set_event(hmsg_mgr->sync_event);
--
1.6.3.3

--
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

Reply via email to