From patchwork Thu Feb 11 19:22:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Chitriki X-Patchwork-Id: 78796 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1BJMVRq003408 for ; Thu, 11 Feb 2010 19:22:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756853Ab0BKTWN (ORCPT ); Thu, 11 Feb 2010 14:22:13 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:45510 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756835Ab0BKTWM (ORCPT ); Thu, 11 Feb 2010 14:22:12 -0500 Received: from dlep36.itg.ti.com ([157.170.170.91]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1BJM8BW031696 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Feb 2010 13:22:09 -0600 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o1BJM8RL011089; Thu, 11 Feb 2010 13:22:08 -0600 (CST) Received: from soldel-laptop (soldel-laptop.am.dhcp.ti.com [128.247.79.63]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o1BJM8Z04569; Thu, 11 Feb 2010 13:22:08 -0600 (CST) Received: by soldel-laptop (Postfix, from userid 1000) id BF0B8606040; Thu, 11 Feb 2010 13:22:07 -0600 (CST) From: Deepak Chitriki To: linux-omap Cc: Deepak Chitriki , Ameya Palande , Omar Ramirez Luna , Nishanth Menon Subject: [PATCH v3] DSPBRIDGE: Fix to avoid possible recursive locking Date: Thu, 11 Feb 2010 13:22:01 -0600 Message-Id: <1265916121-5601-1-git-send-email-deepak.chitriki@ti.com> X-Mailer: git-send-email 1.6.3.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 11 Feb 2010 19:22:33 +0000 (UTC) diff --git a/drivers/dsp/bridge/wmd/msg_sm.c b/drivers/dsp/bridge/wmd/msg_sm.c index 7de3705..7414113 100644 --- a/drivers/dsp/bridge/wmd/msg_sm.c +++ b/drivers/dsp/bridge/wmd/msg_sm.c @@ -295,9 +295,8 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue, (struct list_head *)pMsgFrame); if (LST_IsEmpty(hMsgQueue->msgUsedList)) SYNC_ResetEvent(hMsgQueue->hSyncEvent); - else { + else SYNC_SetEvent(hMsgQueue->hSyncEvent); - } fGotMsg = true; } @@ -345,9 +344,9 @@ DSP_STATUS WMD_MSG_Get(struct MSG_QUEUE *hMsgQueue, } hMsgQueue->refCount--; /* Reset the event if there are still queued messages */ - if (!LST_IsEmpty(hMsgQueue->msgUsedList)) { + if (!LST_IsEmpty(hMsgQueue->msgUsedList)) SYNC_SetEvent(hMsgQueue->hSyncEvent); - } + /* Exit critical section */ (void)SYNC_LeaveCS(hMsgMgr->hSyncCS); }